In SQL Server Reporting Services lets you create data sets. One of the best practices for these data sets to minimize, preferably one for yourself. Once anyone ever need to change the report he does not have many data sets to search through everything, but he may provide a dataset.
The example below shows how you can solve in your dataset. No complicated things in the report but the source address;
AdventureWorksDW USE AdventureWorksDW GO @GeselecteerdeKlantID AS INT DECLARE @ GeselecteerdeKlantID AS INT @GeselecteerdeLandID AS INT DECLARE @ GeselecteerdeLandID AS INT @GeselecteerdeKlantID = 0 SET @ GeselecteerdeKlantID = 0 @GeselecteerdeLandID = 2 SET @ GeselecteerdeLandID = 2 DC. CustomerKey , SELECT DC. CustomerKey, , DC. FirstName, , DG. GeographyKey, , DG. English Country Name Region, ( FIS. SalesAmount ) AS SalesAmount SUM (Amount FIS. Sales) AS Sales Amount FactInternetSales AS FIS FROM Fact Internet Sales AS FIS DimCustomer AS DC ON FIS. CustomerKey = DC. CustomerKey LEFT OUTER JOIN AS DimCustomer DC ON FIS. CustomerKey = DC. CustomerKey DimGeography AS DG ON DC. GeographyKey = DG. GeographyKey LEFT OUTER JOIN AS DimGeography DG ON DC. GeographyKey = DG. GeographyKey ( WHERE ( @GeselecteerdeKlantID, 0 ) = 0 ISNULL (@ GeselecteerdeKlantID, 0) = 0 = @GeselecteerdeKlantID ) OR DC. CustomerKey = @ GeselecteerdeKlantID) AND ( @GeselecteerdeLandID, 0 ) = 0 ISNULL (@ GeselecteerdeLandID, 0) = 0 = @GeselecteerdeLandID ) OR DG. GeographyKey = @ GeselecteerdeLandID) DC. CustomerKey , GROUP BY DC. CustomerKey, , DC. FirstName, , DG. GeographyKey, General. English Country Region Name






















Tags 