March 30, 2009 at 4:41 am
I have a requirement to show the company name in the report header based on the login user id. User id and his corresponding comapny name is stored in a database(Table). How to achieve this?. Any help is greatly appreciated.
March 30, 2009 at 6:57 am
Sounds like you need a dataset that returns the company name with a parameter for user id.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
March 30, 2009 at 7:16 am
I placed the text box in the page header and added the following expression
=First(Fields!companyname.Value, "DataSet_ServiceCenterComapnyName")
But I'm getting the following error
An error occured during local report processing
The expression for the textbox 'companyname' refers to a field.Fields cannot be used in page header or footer
March 30, 2009 at 11:09 pm
Hi,
It is not possible to access Fields values in Report Header and Footer,follow this approach:
1.Fetch company Name by user id from Database.
2.Put a Text Box in the Body area of report (TextBox Name: CompayName)
3.Put your expression in the Text Box
i.e (Fields!companyname.Value, "DataSet_ServiceCenterComapnyName")
4.Set the TextBox as hidden.
5.In header put ReportItems!CompanyName.Value
After the 5th step you will get the company name in the Header.
Do let me know if any thing is unclear.
Thanks,
Richa
March 31, 2009 at 1:00 am
Thanks for your response Richa
But i'm getting the CompanyName in page header only in the first page not in all the page of the header.
Please help me to solve this issue. I need report header(CompanyName) in all the page of the report.
March 31, 2009 at 4:03 am
Ya.. i solved this in the below manner
I created a parameter(Report_Parameter_1) and get the default value as CompanyName from dataset
I kept a text box in the page header and added the following code
=Parameters!Report_Parameter_1.Value
Now it is dispalying the CompanyName in report header for all the pages.
But good effort Richa.Thanks for your reply
April 1, 2009 at 12:59 pm
I get around this problem by putting a couple of rows at the top of my report table to hold my "header" variables or expressions. I put them above the column headers and the values print on each page. I put a first() around the data item so I only get one value.
May 16, 2011 at 3:42 pm
richa.gupta (3/30/2009)
Hi,It is not possible to access Fields values in Report Header and Footer,follow this approach:
1.Fetch company Name by user id from Database.
2.Put a Text Box in the Body area of report (TextBox Name: CompayName)
3.Put your expression in the Text Box
i.e (Fields!companyname.Value, "DataSet_ServiceCenterComapnyName")
4.Set the TextBox as hidden.
5.In header put ReportItems!CompanyName.Value
After the 5th step you will get the company name in the Header.
Do let me know if any thing is unclear.
Thanks,
Richa
Hi Richa,
I can't get the report to run using ReportItems!COMMODITY.Value. It will work with Fields!COMMODITY.Value but won't change value on commodity breaks.
Is there a way to do this with dynamic header data? For example, I am processing 2 crop years (2009 and 2010) with 2 commodities (grapes, dried fruit). Each crop year has grapes and dried fruit. I want the header data to change when crop year and/or the commodity changes.
Thank you,
Jerri
May 17, 2011 at 10:25 am
I got it to work. I was trying to put the reportitems in the column headers and when I moved it to the header area it worked.
May 9, 2014 at 7:16 am
It is entirely possible to do this:
Create a hidden field in the details record to hold the value you want to see in the header
Name the textbox "header_field_1"
populate it with the database value you want to display on the header.
Next, within the header, reference the report textbox in an expression where you store the value: =ReportItems!header_field_1.value
note that this is different from referenceing the data value from your dataset.
HERE IS THE ISSUE THAT I CANNOT FIGURE OUT THOUGH.....
When the report renders it looks fine... but when you go to print it, the headers become static and only the data from the first row is printed.
If anyone figures this one out then you have my votes.
March 29, 2017 at 10:28 pm
I am having the exact same issue. I've created a shipping label that has the order number, customer's name, address, and PO in the page header. In the tablix, I have the item details that often require a second page to show all the items on the pallet. I can get the dynamic properties to display in the page header by placing a textbox in the tablix header and assign an expression of something like =First(ReportItems!tboxDocNo.Value) in the header control but it only displays on the first page. Is there a way to display these values on subsequent pages?
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply