 |
BOOK: Professional SQL Server 2005 Reporting Services ISBN: 0-7645-8497-9  | This is the forum to discuss the Wrox book Professional SQL Server 2005 Reporting Services by Paul Turley, Todd Bryant, James Counihan, Dave DuVarney; ISBN: 9780764584978 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Professional SQL Server 2005 Reporting Services ISBN: 0-7645-8497-9 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

July 13th, 2006, 12:31 PM
|
Registered User
|
|
Join Date: Jul 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
"ReportItems" collection re header/footer
On page 270 of the book, in a section entitled "Working with the strengths and limitations of the architecture", there is a table that enumerates many of the limitations and offers workarounds and alternatives.
For the limitation "Page header and footer cannot reference field values", one of the alternatives offered is "Place hidden text boxes in the report body and then reference these in the ReportItems collection".
That's it -- nothing else. A check of the index shows no further references to "ReportItems collection".
I presume this is done as custom code or in the "code" box?
How exactly would this be done?
Cynthia
|

July 13th, 2006, 12:43 PM
|
Registered User
|
|
Join Date: Mar 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
The Report Items collection can be used in expressions. Very similar to how you use the fields colleciton. If you want to reference the field "FirstName" your texbox will contain the expression "=Fields!FirstName.Value".
So, if you put a textbox on your report called "MyTextBox", you can reference it using its name. In your header place another textbox and give it the expression "=ReportItems!MyTextBox.Value". If that doesn't work, try "=ReportItems!MyTextBox.Text".
|

July 13th, 2006, 01:05 PM
|
Registered User
|
|
Join Date: Jul 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thank you!
Cynthia
|

August 2nd, 2006, 04:21 PM
|
Registered User
|
|
Join Date: Aug 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I've noticed that if your report spans multiple pages, the textboxes in the header seem to lose the reference to the hidden cell beyond page one...is there a way around this?
|

August 2nd, 2006, 07:32 PM
|
Registered User
|
|
Join Date: Jul 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I JUST discovered this myself!!! This is awful. I don't know the answer -- anyone??
Cynthia
|

August 3rd, 2006, 07:08 AM
|
Registered User
|
|
Join Date: Aug 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
My problem was (is) that my data table spans mulitple pages. I found a work around, though I am not satisfied it is the best solution: added a hidden column to my table, containing my hidden textbox referencing the parameter. As the table propogates to the other pages, so do the hidden fields.
Seems to work.
|

August 3rd, 2006, 11:12 AM
|
Registered User
|
|
Join Date: Jul 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Yes, I tried that too. It works in the Visual Studio preview.
However, when I exported the report to PDF format, it did not work. All the fields in header/footer that depended on hidden information in the tables were blank.
Unfortunately, we are required to use the PDF format for our reports, because of the quirk (feature?) in SSRS 2005 that makes HTML format come out wrong if there are overlapping elements. We just can't get away from overlapping elements in our reports.
I have come up with a solution, I think, that will work for me -- the header can apparently accept report parameters. Since the variable information in the header is consistent over an entire report in my case, this will work for me, though it's inconvenient. (Much of the information in the header previously came from just one report parameter, and now I have to send several.)
However, I have another problem. Our reports are required to have totals in the footer of each page. Originally, I tried picking up the data from the (hidden) table footer, and again, it worked in the Visual Studio preview, so I thought I had solved that problem. Much later, when I exported to PDF, I discovered that the footer fields came out blank. (Trust me, you didn't want to be within earshot of me when this discovery was made!)
The totals are required to be group totals -- totals from one of the groups in the table. That means that even if I used a subreport in the footer (which I don't even know will work), I would have to somehow send it the ID of the current group, and I don't know how to do that.
I may have to do something with code, saving the totals in global variables or the like -- but I don't know how to do that. It's a mess.
Cynthia
|

August 3rd, 2006, 12:13 PM
|
Registered User
|
|
Join Date: Aug 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Ack...you're right. I also see that I get extra pages in my PDF, basically blank pages with a header inserted between the real data.
We may be the only ones posting here ?
Any ideas?
John
jmbaute <at> yahoo.com
|

August 3rd, 2006, 01:06 PM
|
Registered User
|
|
Join Date: Jul 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I think the problem with the extra pages is caused by the report being too wide for the PDF format. You can usually fix that by tweaking the margins in your report.
Unfortunately, the other problem is not so easily solved!
Yes, no one else seems to be hearing our problem, though surely others must have run into this.
Cynthia
|

August 3rd, 2006, 01:11 PM
|
Registered User
|
|
Join Date: Aug 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Yep...somehow my page had drifted .125 inches. Well, I am out of ideas. Hopefully one of the experts will check in here soon. Good luck.
John
|
|
 |