The Document Map in SSRS gives the navigation links in the preview of a report. The user can use those links to navigate between multiple pages or between reports.
Document Map in SSRS Example
In this example, we will show you how to create or Enable Document Map Labels in SSRS or SQL Server Reporting Services with an example.
For this SSRS Document Map demo, we are going to use the below-shown report. Please refer to the Grouping in Table Reports article to understand the Data Source and the grouping technique we used in this SSRS report.
SELECT Territory.SalesTerritoryCountry AS Country, Prodcat.EnglishProductCategoryName AS [Product Category], prodSubcat.EnglishProductSubcategoryName AS [Product SubCategory], prod.EnglishProductName AS [ProductName], SUM(fact.SalesAmount) AS Sales, SUM(fact.TaxAmt) AS Tax FROM dbo.DimProduct as prod INNER JOIN dbo.DimProductSubcategory AS prodSubcat ON prod.ProductSubcategoryKey = prodSubcat.ProductSubcategoryKey INNER JOIN dbo.DimProductCategory AS Prodcat ON prodSubcat.ProductCategoryKey = Prodcat.ProductCategoryKey INNER JOIN dbo.FactInternetSales AS fact ON fact.ProductKey = prod.ProductKey INNER JOIN DimSalesTerritory AS Territory ON fact.SalesTerritoryKey = Territory.SalesTerritoryKey GROUP BY Territory.SalesTerritoryCountry, prod.EnglishProductName, prod.Color, Prodcat.EnglishProductCategoryName, prodSubcat.EnglishProductSubcategoryName
In SSRS reporting services, We can enable the Document Map in three ways:
The first approach to Enable Document Map in SSRS
First, select the column and right-click on the column to open the context menu. From the context menu, Please select the Row Group option and then select the Group Properties.. option as shown below
The Second approach to Enable Document Map in SSRS
The second method, Go to Row Groups pane and right-click on the column name to open the context menu. Please select the Group Properties.. option from it
Once you selected the Group Properties.. option, a new window will be opened to configure the group properties.
Please navigate to Advanced Tab and select the column name under the Document map property. These column values will display as Document map output
Click Ok to finish configuring the SSRS Document Map Label property. Let us click the preview button to see the report preview
From the above screenshot, you can observe that the report preview is displaying a separate tab with countries list. If you click on any country name, the report server will navigate to that country name. For instance, the below screenshot is displaying the results of Germany.
Though we added a document map for countries list, we are unable to navigate this large report. Let’s add Product Category to the document map label as well
Now, if you observe the below screenshot, you can see the better navigations. It looks like a PDF file with an index on the left side
We used the above steps to Configure Document Map label property on our previously created Subreports also. Please refer to the SSRS Subreports article to understand the Subreport design and configurations.
Document Map in SSRS at Tablix level
In real-time, we may see multiple tables or multiple tablix will embed in a single report. If this is the case, it will be tough to navigate between two tables. In these situations, we can use the SSRS Document Map Property at the tablix level for better navigation.
For better understanding, We will show you one example. If you observe the below screenshot, we added one more table to the First example
First, Select the first table and go to the Tablix properties. Within the properties pane, Please select the DocumentMapLabel property and assign a unique name to it. From the below screenshot you can observe that We assigned Country Sale
Next, select the second table and go to the Tablix properties. Within the properties pane, Please select the DocumentMapLabel property and assign a unique name to it. We assigned Product Sale
Click the Preview tab to see the SSRS Document Map report Preview. If you observe the below screenshot, Report manager is displaying the Document map labels of two tables
If you want to see the second table, click on Product Sale label as shown below