Question

I have to create a report consisting of several pages each containing a table. The report dataset looks like this:

Col1 | Col2 | Col3 | ...
-----+------+------+----
Val1 | xxxx | xxxx | ...
Val1 | xxxx | xxxx | ...
Val1 | xxxx | xxxx | ...
Val2 | xxxx | xxxx | ...
Val2 | xxxx | xxxx | ...

For that data the report should have two pages (one for Val1 and one for Val2). On each page there should be a table containing the corresponding values of Col2, Col3, etc.

I'm trying to solve that using List control with table or subreport in it. The problem I have is that the list is repeated 3 times for Val1 and 2 times for Val2 (cannnot specify DISTINCT on Col1).

Can you tell me whether using List control with table or subreport is the right aproach? Should I use two different datasets or there is a way to use single one?

No correct solution

OTHER TIPS

The following steps might be easier, as it doesn't require an additional containing list:

  1. Add the table as you want it to show
  2. Group based on Col1
  3. Add page breaks before each instance of a group (see final section)
  4. Repeat the group headers on each page

As a side note, I think step 2 can also be performed on the list you currently have, also effectively solving the issue you're experiencing. This may be the preferred option if you have more than just the table for each value in Col1 (a header, image, legend, etc).

I've implemented the report like that:

  • only one dataset is required (as in the example above)
  • the report requires two reports: MainReport and SubReport
  • MainReport: references a shared dataset consuming the stored procedure with the data. It contains a List Control with RowGrouping on Col1. Every row contains a SubReport reference and passes current Col1 value to it.
  • SubReport: consums the same stored procedure BUT AS EMBEDDED DATASET AND NOT AS SHARED DATASET (shared dataset retrieving causes error). The dataset is filtered by Col1 value to be equal to parameter by MainReport. The SubReport comprises a table usind the data of that dataset.

In my implementation MainReport has a Report Header which is repeated on every page. Alternatively you can define header on the List Control and specify it to repeat on every page.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top