views:

591

answers:

2

I'm creating a report with a table that is grouped by a department code. There's a page break at the end, so each page only has data for that department code. Outside of the table, I want to have a textbox that contains the department code for that page/group.

I've tried using a hidden column with the data, but the textbox only ends up showing the last page's department code on every single page. I imagine I'm missing a simple solution, but I can't figure it out and Google seems to be failing me.

A: 

Could you maybe add a column to the table that just looks like its outside of the rest of the table to the user, but is actually in the table. Maybe pad a couple of blank cols then show the data.

If you are handling the page break in the logic of the table you will probably have to keep the data in the table.

beakersoft
A column would work but they want the data to be displayed at the top and bottom of the page, far from the actual table. You would think it would be possible to reference data from the current page you're on in a separate textbox, but apparently it's a bit harder than I expected.
Gary the Llama
+1  A: 

the problem is that you are just setting the report to break at certain points in the data instead of, say, rendering a sub-report multiple times by passing a parameter to it. the data only exists inside the scope of the table.

what you could do is set up a sub report that accepts a department parameter and generates data for one department. in the sub report you could then add the header by referencing the parameter that's being passed. then in your main report you create a table with a dataset of unique departments. group by the department in the table, and drag the sub report into the table and set the parameter. if you do it right you should get the same effect, but with the department header.

if you need more clarification, feel free to ask.

DForck42
This sounds like it will work. I haven't used sub-reports before, so I'm going to give it a shot. I'll accept your answer if it works. Thanks!
Gary the Llama
I did a quick test and it looks like it's going to work. Thanks!
Gary the Llama
awesome, glad it worked
DForck42