Jump to content
We've recently updated our Privacy Statement, available here ×

How to make textfield in header show on all pages of report


duncanstanton

Recommended Posts

I have a report with a header band where I have a text field with a conditional (if/else) expression. The expression looks for a certain value and then prints static text from a variable. I am able to have that field show up on the first page of the report, but on the second page the field is blank. The field is only blank on the second page if I use a field without the conditional (if/else) expression. If I use a field from the data source by itself, the field is printed on both pages of the report. I am having to use the conditional expression to print static text because it does not exist in the data source. Does anyone have any advice on how to make a field like this print on all pages? Below is the code in the textfield :

$F{plant_code}.contains("101") || $F{plant_code}.contains("201")? $V{v_201_Remit} : $F{plant_code}.contains("102") || $F{plant_code}.contains("202") ? $V{v_202_Remit} :
$F{plant_code}.contains("103") || $F{plant_code}.contains("203") ? $V{v_203_Remit} : $F{plant_code}.contains("104") || $F{plant_code}.contains("204") ? $V{v_204_Remit} :
$F{plant_code}.contains("105") || $F{plant_code}.contains("205") ? $V{v_205_Remit} : $F{plant_code}.contains("106") || $F{plant_code}.contains("206") ? $V{v_206_Remit} :
$F{plant_code}.contains("108") || $F{plant_code}.contains("208") ? $V{v_208_Remit} : "CONTACT BILLING - PLANT CODE ISSUE"

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Looks that you are using a VARIABLE.... this could have another calculation time... so if you use it in header bands they are probably null.

Try to change the EVALUATION_TIME at your Textfield to something other than NOW.... e.g. to REPORT..... (depends on what your variables are doing)

But also caution:

The PrintWhenExpression at the TextField is always interpreted ADHOC (so now).... so be aware when using variables in PrintWhenExpressions... especially in PAGE_HEADER / GROUP_HEADER bands!

hth + regards

C-Box

Link to comment
Share on other sites

I tried changing the Evaluation Time on the textfield and went through all of the different options with the same result. Also, I am not using "Print When Expression", the code above is what is in the actual text field expression. The form seems to process this field once and prints it on the report, but it does not seem to want to process the text field expression a second time to make it show up in the header on the second page.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...