Hi.
I want some information stored in the database to be shown on the top of each page in my report. But in the report designer I get an error message if I try to drop a table in the header, and if I try to assign the value of a textbox in the header to e.g. "First(Fields!sometable.Value)", I get a runtime-error in the preview that says "... Fields cannot be used in page headers or footers".
How can I do this?
Regards, Tomsi
Hi Tomsi,
you can not place a databound field in the page header directly. Instead, you can place it in the body of the report and make it hidden.
you can refer to this hidden field content using the similar syntax
=ReportItems!txt_1.Value
and display in a text box placed in the header.
Rgds,
Ramesh
|||
Nice workaround. Thanks.
But why doesn't Reporting Services support this feature / when will it come? Workarounds like this will in the long run make the reports complex and messy. I'm converting reports from Crystal Reports, and my customer will obviously dislike this "missing" feature in RS.
The ideal solution would be have a databound table in the header...
Tomsi
|||I tried this on some of the reports we have been creating and it works great on the first page but in the rest of the report the cells in the header are unable to reference the cells in the body. We are using 2005.|||Another option is to add a (hidden) report parameter at the beginning of your list of report parameters with a query-based default value (the field you want to show in the report header). If your query returns multiple rows, you will need to perform aggregations (e.g. Max(...)) directly in the query so that the first row contains the value you want to use for the parameter value.
Then, in the report header reference the parameter value.
-- Robert
|||I'm experiencing the same issue, were you able to resolve the problem? It works fine on page 1, but not on subsequent pages.
Alternatively, I was able to use the Parameters!parameter.value consistently in the header, but when I used Parameters!parameter.label, the value would disappear from the header when I changed any parameter that affected a report filter without requerying.
|||The secret of this is, to embed the data in a table header. Have the table header repeat on every page, and refer to the table header cell in the text field of the page header.
unfortuantely the only way I've been able hide the data, in the table header, and not be noticeable, is take make the font really small, and make the text, and row black. Hope this helps.
M
|||Another way to do this is to have the Data you want displayed in the header to be retrieved into Report paramaters.
Then the parameters can be put in the Page Header.
Set up a Paramater for each piece of Data you require and retrieve into the Paramaters setting the default values with the values you want displayed.
It works fine. It would be much better if we could ust put Data bound fields into the Page Header.
Dave
|||I created a report (rs2005) with a hidden header row in the table that repeats on each page. When I view the report it looks fine, but when I export to a PDF the ReportItem data is missing from the header.
Header before exporting to PDF:
Title: This Should be Easier Date: 5/19/06
Header after exporting to PDF:
Title: Date:
Is there any way to fix this?
|||This could quite possibly be the biggest pain in Reporting Services, compared to other reporting tools. It is quite probable that anyone doing reports is doing so in a corporate environment where key data values must be displayed in the header. When report details relating to these key data values span more than one page, the RS engine should be able to handle this and continue to display the data associated with these values in the header. In addition, it should be able to handle changes in this data and apply appropriate page breaks.
I have tried all these so called "work arounds" and they only work about 80% of the time. I am slowly, (or quickly, and can't admit it) coming to the conclusion that RS is not yet ready for Prime-Time corporate reporting. I agree with the previous post that these only make development in RS much more difficult and hoaky work-arounds make for difficult to maintain and basically not very functional reports.
I have some complicated reports that use subreports, datalists, and intrictate formating of textboxes and images which need to span multiple pages and print nicely in PDF. Unfortunately, the reference to a textbox or reference to hidden row in a table just does not always work.
IS THERE ANYONE out there that has found a simple, consistant and non-cumbersome way of doing this.
AND for Microsoft RS development team...when are you going to provide an actual solution to this issue? It was a problem in RS2000 and continues in RS2005.
|||You hit the nail right on the head there buddy. This task is so basic it seems ridiculous to have to resort to these tricks. I hope they get this fixed cause it's ugly.Frank|||
I have a few clients who love SRS but almost dropped it because of this.
We have found ways around it by using a table and putting a subreports into table headers so we could control if they displayed on first page only or all pages or not at all. Or for simpler solutions by using parameters to store the data that is required in the header.
Either way it's a huge pain in the ^$% for what should be a simple task.
I would also like to plead to the PM of this project to fix this in the next release or a patch it's a necessary feature if you plan to compete with other reporting tools.
Dave
|||I tried putting the value into a parameter field, but we are setting the datasource of the report at runtime. It works fine in the development environment, but when I deploy the app (even locally) I get this error:
I used Oracle Reports for years and must admit, SSRS is a pretty disappointing enterprise reporting tool. No data fields in headers, no multi axis charts ... and the list goes on. Nice designer and clicky windows but presenting information is just a pain in the neck. Hope the SSRS team will get their act together and provide some basic corporate features.
|||i agree with that, microsoft need to improve its reporting services by keeping corporate business in mind