Friday, March 30, 2012

Print Name (field from dataset) On Every Page (Page Header)

Hello,

I am using the ReportViewer control and Client-Side Processing to display a Training Report that works great.

However, I need find a way to have one of the fields of my dataset display on every page of the report (Page Header).

I receive this message "The Value expression for the textbox FName refers to a field. Fields cannot be used in page headers or footers".

Is there a way to get this field to appear on every page of the report (preferably at the top).

Thanks for any help that you can provide me.

This is easy all what you need to to is to add ne parameters which get his value from your dataset fileds and then use this parameters in your page header or footer read this turtorial it will help you

http://technet.microsoft.com/en-us/library/bb508810.aspx

read the section titled " Assigning report parameter values using consolidated fields "

|||

hey

I told the answerin different post ( http://forums.asp.net/t/1160246.aspx ), but repeat it for you

you should define a Parameter for your report from Layout section ,then ( right click insome empty place in outeside of your report table, you'll see a context menu with 4 Items , select the Report Parameter) ,then create a Textbox inside your Header or Footer , then rightclick onthe textbox and and select Expression , then put the followingcode in it .

=Parameters!ReportFooterParameterName.Value

goodluck ,|||

I appreciate the help. I am not quite sure what to do when setting up the Report Parameters to fill this textboxt with the field from my dataset. Would you mind giving me a little guidance in this area?

I am getting the message A Value expression used for the report parameter 'Name' refers to a field. Fields cannot be used in report parameter expressions.

Thanks again!

|||

ok ,

let me describe it for you

there is 2 different type of value in reporting server ,

1 ) the filed that you provide by DataBase that will display like Filelds!DBFiledName.Value

2 ) the filed that you provide by getting information fromuser or from yourexisting Query this type of values called Parameters and will display asParameters!ReportFooterParameterName.Value

when you want to show oneparameter inHeader orFooter ,you can't useFields it means all the textbox that you put in header / footer , shouldcomplete byParameters ,

for sending parameters to header or footer , you have2 option ,

Take it FromUser or programmatically fill the Parameter , in commonly uses , we set the parameters Programatically , like

@.myParameter = "hello world!"

when I use the myParameter in Header, itwill display thehello world! ,

but if youuse the Fields inHeader or Footer it cousean error thatyou taken it .

for sending a parameter to your header , pleaseread the post above ,

Thank you , 7 Goodluck

No comments:

Post a Comment