Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 Dataset Values in Footer

Author  Topic 

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2005-08-25 : 17:27:48
OK, so you can't directly insert a Dataset value in your header or footer, but you can reference a text box in the body of your report using the ReportItems!... syntax.
quote:
From Reporting Services BOL...


You cannot refer directly to a field in a text box in a page header or footer. (For example, you cannot use the expression =Fields!LastName.Value.) To display field information in a page header or footer, place the field expression in a text box in the body of the report, and then refer to that text box in the page header or footer...
OK, fine, I've done that. BUT, if the textbox only exists on page 1, then apparently the value is not available on any other pages. Anyone have any ideas around this?

Here's my setup. My report has a list object that pulls from one dataset (guaranteed to return only one row), included in which is the client's name, address, etc. Next in the report are a couple of table objects which pull from different datasets. These tables cause the report to break over multiple pages. Everything works fine up to this point.

Then I wanted to add a Footer with page number (no problem) and the Client's name, so that we could ensure that Page 2 goes with that Page 1, etc. When I put the ReportItems! reference in the Footer, the name shows up on page 1, which is where the actual text box displays, but the footer on all the other pages comes up with a blank for the name.

---------------------------
EmeraldCityDomains.com

gcowhsu
Starting Member

38 Posts

Posted - 2005-08-31 : 12:37:21
There is an option to repeat footers on every page when you add a table to a report and then you do not have to use the report's footer for what you want. I know tables are very limited though.

Your situation is kind of wierd because what if a page has 3 clients on it, what do you put at the bottom then?

If you want one page per client then you have to resize your list to be 8x11 and then you can remove the footer and put the pages number and client name at the bottom of the list so it acts like a footer, but not really.
Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2005-08-31 : 12:43:16
A report is run for only one client, guaranteed, and his info is in the List object on page 1. There are two tables, each with multiple rows about the orders and such that that client has placed. Those tables contain footer rows with subtotals and totals, and I want those only at the end of their respective table, not repeated on each page. Because these tables will span multiple rows, I want an actual footer on each page that identifies the client that the whole report applies to (again, found in the List on Page 1).

---------------------------
EmeraldCityDomains.com
Go to Top of Page

gcowhsu
Starting Member

38 Posts

Posted - 2005-08-31 : 12:51:38
I see, if you are guaranteed one customer per report run, then is it a parameter?
Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2005-08-31 : 14:27:43
The parameter that the report is based on is a pointer to a master order which then contains a pointer to the client. So I can retrieve the client name based on a parameter, but the name is not the parameter itself.

I'm considering creating some hidden field that would "appear" on each page and then could be referenced, hoping that would solve the issue. But I was hoping there was a simpler way. I already have the name on the report, but it's only on page 1. So creating another invisible name seems silly.

---------------------------
EmeraldCityDomains.com
Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2005-08-31 : 17:24:29
Well, upon further testing, I find that if I put the name in a previously blank cell in the Header row of a table, and repeat the header rows on each page, then it works. Unfortunately, if I set the Hidden property to true, then it doesn't work. However, I can set the font of that cell to White and it works okay.

Unfortunately, I have two tables that can each span multiple pages, I cannot name the cells the same in the two tables, and a textbox in the footer cannot reference more than one Report Item. I can create a second textbox to hold the value from table 2 and place them near one another, but there's the potential for both to appear on one page. This is ugly. I hope they have come up with a better solution in the new version!

---------------------------
EmeraldCityDomains.com
Go to Top of Page
   

- Advertisement -