Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grouping data in an RDLC

I'm sorry if this seems silly, but I'm new to using Report Definition Language (RDLC) files and I'm looking for advice on the best "plan of attack" for a report I must create.

THE REPORT The report (itself) must display a table of data above a related set of calculations for each a grouping (of data). I'm hoping to keep one group per page...but that may not be possible as each table may become quite long (but that is another question for another day).

...There can be 1 to N GROUPS

Example

  • (GROUP 1)
  • TABLE
  • FORM CALCULATIONS

PAGE BREAK

  • (GROUP 2)
  • TABLE
  • FORM CALCULATIONS

...and so on.

IS THIS THE BEST WAY TO DO THIS?
Place each group into a SUBREPORT. The sub report would then contain the table & form calculations.

...is this right or is there a better way to do this?

like image 938
Prisoner ZERO Avatar asked Dec 28 '22 08:12

Prisoner ZERO


1 Answers

THE ACTUAL ANSWER IS

The outer RDLC contains a LIST control which contained the following controls:

  • TABLE (containing items related to the collection as a whole)
  • SUBREPORT

The SUBREPORT points to an RDLC which contained the following controls:

  • TABLE (containing row items)

(1) Use the LIST's "grouping" property to group your 1-to-N collections.
The "grouping" property is found by choosing the LIST control then choosing Visual Studio's menu options as such: VIEW > PROPERTIES WINDOW.

(2) Next, set the LIST's data source.
This is found using by choosing the REPORT and then choosing Visual Studio's menu options as such: REPORT > DATA SOURCES. Drag any field onto the control and the data source will automatically set itself up.

NOTE:
If you cannot "see" any data sources in Visual Studio's data sources window it is "probably" because service references in your project are causing issues...temporarily exclude them from your project and choose RESFRESH icon within Visual Studio's data sources window (they should then appear). Sadly, you must do this EVERY TIME your data source changes.

Once you have the LIST iterating properly you can add-in the SUBREPORT and any other controls.

...I now OFFICIALLY hate RDLC's.

like image 167
Prisoner ZERO Avatar answered Jan 13 '23 13:01

Prisoner ZERO