It turns out that you can delete the group columns after you've specified them to be used for grouping and page break. You simply right-click on the the handle of the column(s) to be removed and select "Delete Columns" -> "Delete columns only".
SSRS Report - Use column for page breaks, but make invisible
-
24-06-2022 - |
Вопрос
I'm using SQL Server Data Tools 2012 in Visual Studio. I have a Reporting Services report containing a table with some columns that are optional, based on selections from a multivalued parameter, and other columns that are required.
Among the required columns, the first two - call them SalesOutlet and ProductType - are to be used to create separate worksheets when downloaded to an Excel spreadsheet. For instance, I want a worksheet for each of these combinations:
- "Springfield" + "Books"
- "Springfield" + "Music"
- "Portland" + "Books"
... etc. Since these columns are used to create the separate worksheets, it would be redundant to show them in the sheets, so I want to hide them.
I can create the separate worksheets by making SalesOutlet and ProductType be row groups and selecting page breaks "Between each instance of a group" in the Page Breaks tab of the Group Properties dialog. However, if I then go to the Visibility tab and select to Hide the groups, it hides all the columns in my report, since Hide will hide all columns of a group.
How do I use columns for grouping and page break criteria, and hide them in my downloaded result, while still showing their child member columns?
Решение 2
Другие советы
Say you have some data like this:
And a simple report to display the data:
Note that the only column being displayed is Title
. However, we are grouping on the other two to create the required group and page breaks:
Don't forget to set up the group-level PageName property to something like:
=Fields!SalesOutlet.Value + " " + Fields!ProductType.Value
To get named worksheets:
This gives the required results of grouping/paging on columns that aren't actually displayed in the report: