Sub Report or CustomReportItem to display complex data using SSRS?
Each record in my report includes (amongst other information) a set of other data items of the format "ItemName X Y Z" where X, Y & Z are numerical values.
When displayed this set will be grouped (as illustrated below) according to a properties of each item, and displayed in a table or similar.
The values X, Y and Z will be displayed pictorially and formatting will be applied to other items (i.e. background colours applied to different group names) to make the information easier to read.
What would be the best way to display this in a report? Current options seem to be using either Sub Reports or to build a new control using CustomReportItems.
- Level 1 Group 1 Name
- Level 2 Group 1.1 Name
- ItemName X Y Z
- ItemName X Y Z
- ItemName X Y Z
- Level 2 Group 1.2 Name
- ItemName X Y Z
- ItemName X Y Z
- ItemName X Y Z
- Level 2 Group 1.1 Name
- Level 1 Group 2 Name
- Level 2 Group 2.1 Name
- ItemName X Y Z
- ItemName X Y Z
- ItemName X Y Z
- Level 2 Group 2.2 Name
- ItemName X Y Z
- ItemName X Y开发者_JS百科 Z
- ItemName X Y Z
- Level 2 Group 2.1 Name
From my understanding of the requirements, all of this can be achieved in a single table (or list) object, without requiring subreports:
- Set up your data query.
- Insert a table object into the report, with the dataset specified as the dataset for the query.
- Insert groups into the reports for each of the Level 1 and Level 2 grouping criteria. Include group header sections, but not group footers.
- To format a cell's colour based on a data item in the detail section (ie. at ItemName X Y Z level), select that cell in the Report Designer and set the BackgroundColour property (from the Properties window) to be an expression selecting the desired colour, using the Edit Expression dialog. (Immediately below the BackgroundColour property is a BackgroundImage property, which can also be set using an expression, if you want to use specific images rather than colours.)
精彩评论