views:

50

answers:

2

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?

A: 

Hi,
personally if i had to do this report i will do it with two different tables. In one rdlc you can put two datatables one will display GROUP 1 Data the second one GROUP 2 Data. The Table has option Page break at end of datatable which can give the PAGE BREAK Between the two datatables.
Best Regards,
Iordan

IordanTanev
Unfortunately, this won't work as there can be 1 to N GROUPS.
It can work but it reures some coding. The idea is this RDLC files are simple xml file you can opne one and edit it using XMLDocument. What you need to do is load the rdlc into XMLDocument and add table by code and the pass the edited xml to the reportviewer
IordanTanev
A: 

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)

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. 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. 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.