Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 13th, 2006, 12:31 PM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default "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
  #2 (permalink)  
Old July 13th, 2006, 12:43 PM
Registered User
 
Join Date: Mar 2006
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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".

  #3 (permalink)  
Old July 13th, 2006, 01:05 PM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you!

Cynthia
  #4 (permalink)  
Old August 2nd, 2006, 04:21 PM
Registered User
 
Join Date: Aug 2006
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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?
  #5 (permalink)  
Old August 2nd, 2006, 07:32 PM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I JUST discovered this myself!!! This is awful. I don't know the answer -- anyone??

Cynthia
  #6 (permalink)  
Old August 3rd, 2006, 07:08 AM
Registered User
 
Join Date: Aug 2006
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.

  #7 (permalink)  
Old August 3rd, 2006, 11:12 AM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
  #8 (permalink)  
Old August 3rd, 2006, 12:13 PM
Registered User
 
Join Date: Aug 2006
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

  #9 (permalink)  
Old August 3rd, 2006, 01:06 PM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
  #10 (permalink)  
Old August 3rd, 2006, 01:11 PM
Registered User
 
Join Date: Aug 2006
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Locking Header and/or Footer x_ray Word VBA 1 January 2nd, 2007 12:02 AM
HOw can i add Header and footer? NinaWilliam ASP.NET 1.0 and 1.1 Basics 0 April 25th, 2006 04:22 AM
header footer zaman1111 JSP Basics 0 July 28th, 2005 05:00 PM
addin a header and footer rom XSLT 0 July 28th, 2005 03:24 AM
Regarding Word header and footer Hari_Word General .NET 0 November 19th, 2004 05:22 AM



All times are GMT -4. The time now is 12:15 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.