Link to home
Start Free TrialLog in
Avatar of bkpierce
bkpierceFlag for United States of America

asked on

SQL Reporting Page Headers

I have a SQL Report in SQL RS 2008, I have tables setup to group on project number and display various information about the project. The report is setup to page break after each group.

I want to have a header that will display pertinant information in the header of each page. My understanding is page headers can only contain static data and not expressions but I can refer to text boxes within the report.

So if I have a text box in my report, for example, Job number, that changes on each page with the grouping how do I reference that in the page header? I'm sure it's a simple syntax but I am still pretty new to SQL.

Thank You
ASKER CERTIFIED SOLUTION
Avatar of Megan Brooks
Megan Brooks
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bkpierce

ASKER

Thanks for the info, I'm looking for ways to add items to the page header instead of the group header. If I refernce something from the dataset in the page header it just shows info for one job on every single page, it does not change with the page break groups.

Is tried referencing a text box with =Reportitems!textbox1 but when I run the report it just shows #Error
When the group headers repeat on page overflow, the group header in effect becomes a page header. You can include any information in this header that is available at the group's scope.
I have a report that shows details about organizations and that groups at 3 organizational levels, and has 1 static (outside of any group) and 3 dynamic group header rows, all marked to repeat on each page. At the top of each page you see the static row plus the current information about all three org levels, whether it is starting a new group or whether it is in the middle of outputting detail rows.
It wouldn't be necessary to have three separate group header rows; I just wanted it to look that way. All of the information could have been combined into one row associated with the innermost group.
SOLUTION
Avatar of Howard Cantrell
Howard Cantrell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I ended up removing the page header and just putting everything within a list box and doing a page break on that.
Referencing the ReportItems collection in the page header, mentioned by planocz, should work for a simple, static page header, to fetch values from textboxes that will always be present on the page.. I had actually forgotten about that collection, probably because much of the time I use headers that vary in number of rows depending upon the grouping level of the data.
Repeating the group headers seems to me like a more flexible and predictable approach.