An expression in a page header or footer can refer to only one report item.

Unanswered An expression in a page header or footer can refer to only one report item.

  • Friday, January 06, 2012 1:46 PM
     
     

    Hello,

    I want to give an expression to my textbox in the header of my report page.

    But when I do an if statement like:

    =IIf(ReportItems!PageNumberTotalTextBox.Value = "", "1", ReportItems!PageNumberTotalTextBox.Value)

    it gives me the following error:

    the Value expression for the textbox ‘textbox1’ refers to more than one report item. An expression in a page header or footer can refer to only one report item.

    Also, when I try to merge/combine different fields on my header (like the code below) it gives me the same error, that I can't use more then 1 reportitem.

    =ReportItems!PageTextBox.Value & " of " & ReportItems!PageNumberTotalTextBox.Value

    How can I bypass this? I find it rather strange that I can only use a reportitems once in the header, and multiple times in the body.

    Thanks in advance for your help,

    Gert

All Replies

  • Friday, January 06, 2012 1:51 PM
     
      Has Code
    ="Page " & Globals!PageNumber & "of" & Globals.TotalPages
    

  • Monday, January 09, 2012 9:41 AM
     
     

    Hello Sygrien,

     

    In those textboxes are other/special values then PageNumber & TotalPages, so I can't use that expresion.

    I just need to combine 2 textbox fields in the header or must be able to do an iif statement where I use 2 times a header textbox.

  • Monday, January 09, 2012 2:19 PM
     
      Has Code

    Hi,

    Please follow below steps:

    1. Take one text box in report header (which you already have)
    2. In expression write below
    3. =ReportItems!PageTextBox.Value
    4. Click in textbox (edit mode)  -> Right Click -> Add Place holder
    5. In place holder write below expression:
    6. = " of " & ReportItems!PageNumberTotalTextBox.Value
      

    Regards,

    Asim Bagwan

    Kindly mark the replies as Answers if they help!

  • Tuesday, January 10, 2012 3:23 PM
     
     

    Hello,

    Sadly enoug I can't find the 'Place Holder' option in the right click on my textbox, or in the properties of this textbox.

    Am I missing something?

    Thanks for your answer,

    Gert

     

     

  • Tuesday, January 10, 2012 3:34 PM
     
      Has Code

    Hi,

    First you have to click on textbox in edit mode i.e. cursor will blink inside textbox then right click.

    If you still do not see place holder then try below:

    Take one more textbox (say textbox10) in body (Visible = False) and write expression there

    =ReportItems!PageTextBox.Value & " of " & ReportItems!PageNumberTotalTextBox.Value
    
    and then refer this textbox10  in header.


    Regards,

    Asim Bagwan

    Kindly mark the replies as Answers if they help!

  • Wednesday, January 11, 2012 9:51 AM
     
     

    Hello Asim,

    Thanks for your help so far.

    Sadly enough, I can't see the place holder, even when I'm inside my textfield.

    And when I put a textbox in the body, that combines 2 header textboxes, I get the following error:

    Error    1    The Value expression for the textbox ‘textbox1’ refers to the report item ‘PageTextBox’.  Report item expressions can only refer to other report items within the same grouping scope or a containing grouping scope.  

    Error    2    The Value expression for the textbox ‘textbox1’ refers to the report item ‘PageNumberTotalTextBox’.  Report item expressions can only refer to other report items within the same grouping scope or a containing grouping scope.   
  • Wednesday, January 11, 2012 10:25 AM
     
     

    Hi,

    Are the PageNumberTotalTextBox text box and PageTextBox textbox in the body section? or they are placed in header / footer?

    Try to put suggested new textbox in same area where these two textboxes placed.


    Regards,

    Asim Bagwan

    Kindly mark the replies as Answers if they help!


    • Edited by Asim Bagwan Wednesday, January 11, 2012 10:26 AM
    •  
  • Wednesday, January 11, 2012 2:35 PM
     
     

    Hello Asim,

     

    They are both in the header, and they must remain in the header, to get a perfect outcome.

    But if I combine those 2 textboxes I get the same original message:

    The Value expression for the textbox ‘textbox1’ refers to more than one report item.  An expression in a page header or footer can refer to only one report item.  

    Where the expression is:

    =ReportItems!PageTextBox.Value & " of " & ReportItems!PageNumberTotalTextBox.Value

  • Friday, August 17, 2012 10:11 AM
     
     

    Hi,

    How to handle following condition if it is necessary in page footer-

    =IIf(ReportItems!xTextBox.Value = "", "0", ReportItems!xTextBox.Value)

    Regards,

    Samir