March 16, 2014 at 8:13 am
In a new ssrs 2008 r2 report, I need to display 2 of the parameter values in the heading of the report. One of the parameter values in the name and customer number. The second heading value is the city and state where the particular customer is located at. The customer table has the following values:
a. cust_id int primary-id,
b. customer_name varchar(50),
c. cust_address1 varchar (50),
d. cust_address2 varchar (50),
e. cust_city_state varchar(40),
f. cust_zip_providence varchar(30),
g. cust_country varchar(30).
Thus I need to place the paramter values of customer_name and cust_city_state that are obtained from a dropdown list in the heading.
when I try =first(customer_name) in the heading, the value is only good for the first customer name. After that, the wrong parameter value is displayed.
Thus can you tell me and/or show me code of what I can do to place the parameter values
of customer_name and cust_city_state in the heading of the report?
March 17, 2014 at 12:08 pm
If the values in the parameters are the same as in the result set, could you not make a group and us the values for the result set as your header values?
March 17, 2014 at 9:39 pm
Not sure you can do what you want (basically like the data in the margins in a phone book), but this is as close as I could find:
http://blogs.msdn.com/b/robertbruckner/archive/2008/10/26/fields-in-page-header.aspx
After further research and testing, it's actually really simple...
Create a textbox in the header/footer, and set the expression to:
=First(ReportItems!txtLast_Name.Value)
=Last(ReportItems!txtLast_Name.Value)
where txtLast_Name the name of a textbox control in the body of your report. Then as the pages change, the values you'll get the first and last values on the page in the header/footer.
Figured there had to be a way... just took a little while to find it. FYI, Robert Bruckner is one of the guys that wrote Professional SSRS Reporting (whatever the Wrox title is).
March 18, 2014 at 7:06 am
That's a slick solution. I always forget about the ReportItems collection, or when I remember it, there's a reason I can;t use it. This one I have to remember.
March 18, 2014 at 10:01 am
Might have to go get his book... I'd love one that's actually easy to read. Lachev's book is pretty good, but a rough read.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply