Monday, March 12, 2012

repeating a header with fields from the dataset

Hi,

I'm designing a report and have the requirement that the report title needs to be repeated on each page. However, the report title is dynamic, retrieved from the database, so i cannot place it in the page header (what an annoyance). The solution i first thought of was placing the title in a table, repeating the table header on each page, however the problem i'm encountering is that when i have a subreport in that table, that subreport is in one row

--> if the subreport spans across multiple pages, the header will only be shown on the first page the row where the subreport is actually in...

any thoughts anyone on a possible solution?

1. Place a hidden textbox in the report body with a value of =First(Fields!<TitleField>.Value).

2. Place another textbox in the page header referencing the first textbox with a value of =ReportItems!<Textbox1Name>.Value.

|||

hi

thanks for the reply but that actually doesn't quite fully solve my problem; apparently it will only display the value of the textbox on the page where that textbox WOULD be rendered; my report consists of several subreports, i placed the hidden textbox "after" all the subreports, and the title would only appear on the last page.

Putting the textbox at the first place in the report yielded similar results; it would only display on the first page...

|||i'm testing the report by exporting to pdf, by the way|||

Yes, the report item will come back as null if not rendered on the page. If possible, make the hidden textbox repeatable on every page. For example, if the report has a table put the hidden textbox on a detail table row. You will need to change the scope of the hidden textbox expression to reference the dataset, e.g. =First(Fields!<TitleField>.Value, "<DatasetName").

An ugly hack, I know.

No comments:

Post a Comment