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

0

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"

duncanstanton's picture
Joined: Jul 3 2019 - 11:59am
Last seen: 3 weeks 2 days ago

2 Answers:

0

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

C-Box's picture
2250
Joined: Jul 19 2006 - 5:58pm
Last seen: 1 week 2 days ago
0

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.

duncanstanton's picture
Joined: Jul 3 2019 - 11:59am
Last seen: 3 weeks 2 days ago
Feedback