locked
[Report Viewer] Problem with Field in Header RRS feed

  • Question

  • User461429187 posted

    Hello, I'm working with ReportViewer and I have a problem.

    In report there are different Textbox that show specific informations. I would that some of this informations are move on header of report.

    I have define a Report Parameter to solve the problem but this solutions need to modify the codebehind and I can't for some reasons; then I Have add a textbox to header that refer to textbox of body that contain the information (in thi way =ReportItems!textbox2.value), and I hide the textbox in the body.

    The problem with this solution is that the information is displayed only on first page of report, is possible repeat the hidden textbox on every page to allow the header to show informations on every page?

     
    Thanks for any help.

    PS: sorry for my english, I'm italian.
     

    Monday, May 5, 2008 10:33 AM

All replies

  • User1869667223 posted

    The problem with this solution is that the information is displayed only on first page of report, is possible repeat the hidden textbox on every page to allow the header to show informations on every page?

    We can did the same by settting the PrintOnFirstPage = false in properties of page header.  

    Tuesday, May 6, 2008 1:09 AM
  • User461429187 posted

    We can did the same by settting the PrintOnFirstPage = false in properties of page header.  

     

     

    But I want that the header is printed also in first page, the problem is another: the textbox in the header (that refer to hidden textbox in body) load the value only in first page...probably because the hidden texbox is not repeat on every page.

    Can you suggest me a possible solution?
     

    Tuesday, May 6, 2008 2:53 AM
  • User1869667223 posted

    Hi,

    why you are referring a textbox in body,can we keep that in header itself and refer to the corressponding column in that datasource am i right?

    Whats exaclty the content in that body textbox ? its just a column from datatable or someother calculations you are doing?

     

    Tuesday, May 6, 2008 5:42 AM
  • User461429187 posted

    The textbox in body have this content: "=Fields!RagSoc.Value" 

     If I move the textbox on header space I have this error message: The Value expression for the textbox 'textbox2' refers to a field.  Fields cannot be used in page headers or footers.

    How can I do?

     

    Tuesday, May 6, 2008 5:51 AM
  • User1869667223 posted

    Hi Luca,

    We have to go with parameters fields only i think,  if you have any other options keep post in this thread. Good luck!! 

    Tuesday, May 6, 2008 6:02 AM
  • User461429187 posted

     I know but the problem is that the parameter load a value only on first page because the relative field is in first page, how can I do to allow parameter to load the value of field on every page?

    Tuesday, May 6, 2008 6:07 AM
  • User-1136466523 posted

    Hi

    <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p> </o:p>

    You can create a textbox in the body and set the visible attribute as false. And in the report header, use a new textbox, and assign the expression as =ReportItems!TextboxInBody.Value.

    <o:p> </o:p>

    But according to the expression you mentioned, =Fields!RagSoc.Value Here’s a question for you.

    <o:p> </o:p>

    Why do you need to map to a field in dataset and display it in header region? You know there are several rows in dataset, so there are several values for one field. Then which value would you like to display?  

    <o:p> </o:p>

    Since there are several pages in your report, when you render the second ,or the third page, it only render the table part. (Since other parts in body region would not be rendered, if you access the textbox you set in body which is outside of the table, it would not be displayed.)

    <o:p> </o:p>

    Thanks.

     

    Wednesday, May 7, 2008 12:33 AM
  • User461429187 posted

    Why do you need to map to a field in dataset and display it in header region? You know there are several rows in dataset, so there are several values for one field. Then which value would you like to display?   

     

    The textboxinbody is inside a List. In the List there is a filter that select the right value.

    Any idea? 

    Wednesday, May 7, 2008 3:13 AM
  • User-1390663741 posted

    Luca,

    I'm facing same problem now , did you get solution for this problem  ?  If so , can you please share with us ?

    Tuesday, June 10, 2008 10:19 AM
  • User461429187 posted

    I don't found a real solution but an alternative.

    I have inserted some hidden textbox inside a list, so to repeat the textboxs on every page, and then I have use the refer "=ReportItems!textbox.value" to display information on header.

     

    Wednesday, June 11, 2008 8:52 AM
  • User-1390663741 posted

    Thanks Luca,

    but how can you repeat list on every page. My scenario is , I have a dataset which has only one record for header information, I'm placing all the fields  in the table and making them hidden and showing in header with Reportitems!textbox.value, but this is good for only one page. I have reports which always goes more than one page  and needs header and footer on every page. So in this case if have only one record in dataset of header then it will not span through out all the pages. Hope I'm clear on the problem.

    Advice.

     

    thanks

    Dharmen 

    Thursday, June 12, 2008 8:54 PM
  • User461429187 posted
    I have inserted the hidden box on the bottom of the block that repeat on the list and it works, but in my scenario at least one block of object is show in a single page. I don't know if it work also for you.
    Friday, June 13, 2008 2:47 AM