views:

35

answers:

2

Is it possible to display dynamic number of tablix(es) in a report? That is, if we do not know the number of tables/tablixes to be displayed in advance. The requirement is that all the output tables will have exact same structure (row and column lables, groupings, etc.).

A: 

If you are using data from a single data source, you could achieve this result by using a single tablix, having the highest grouping on the item(s) you want to use to break up the tablix and including a page break as part of that grouping.

Mark Bannister
Thanks for the response. Sorry, I did not specify all the requirements earlier (for brevity). Each of the tablix will have a corresponding lable just above it using a textbox. The highest grouping will actually be shown in that text box. I tried couple of ways:1. Similar to what you suggested, one tablix, highest grouping on a group-header row, etc. But in this case, the group-header-lable shows up below the table headings. There is no such thing as "GroupAboveColumnHeaders" similar to "GroupBeforeRowHeaders" :-(2. Nested tablix- But the nested table headers do not repeat on page break.
jm9
Have you tried adding the label into the Page Header section?
Mark Bannister
Each nested tablix can span more than one page. If the headers for these also showed up on page breaks that would solve the problem. But I am not able to achieve that. Setting "RepeatOnNewPage" to true for the static regions of nested tablix seems to have no effect.
jm9
Yes I tried the Page Header that but that was when there was only one table. Actually, I should try that again, since we can have different headers values on different page. Thanks for reminding :-) Will try it out. It should probably work in this case.But in general, shouldn't there be a way to repeat any items (or group of items) any number of times? But that may make RDL structure complicated like XSLT..
jm9
I think the alternative would be to use a sub-report - although I think that would be more work than doing it all in a single tablix (if possible).
Mark Bannister
Hmm, that Page Header did not work.1. Because it can use only aggregate values like first() or sum() from the available DataSets. So it does not change on pages with sub-tables.2. Also tried by using expr=Code.Get/SetValue(). Each group header sets the value, and each page header gets the value. But!!!, header gets processed before the following table body, so it shows #Error on all pages.
jm9
Just had a thought - if you add the same items that you used as your page-break row grouping, as your new highest column grouping, they should appear above all the other column grouping headings.
Mark Bannister
Not sure.. The column groups span left to right as opposed to row groups spanning from top to bottom. For now the solution I posted earlier is working. But it will work only so far as the sub-tables are all similar in structure, sharing the common headers of the outer tablix. Will see if they come up with a way to repeat report items with different values from a single dataset. May be sub-report is the only way to do it, like you said. But haven't tried it.
jm9
A: 

For now, I found a way to solve it. Created a static row within the top group and set set its RepeatOnNewPaAge=true. Remove the borders, so that it looks like a separate text above the table. This way, it prints the latest group info at the top (because it is part of the group) and also gets displayed on every page, because it is statc. Cool huh? :-)

jm9