Jump to content
Changes to the Jaspersoft community edition download ×

printWhen problems

Recommended Posts

By: Stefan G  ng - bishop3337

printWhen problems

2003-03-21 03:00


i've got to differentiate between a site counter on all pages from the first to n-1 and a summary only on the last page.

i know how to use page counters, but when i use the variable PAGE_COUNTER to check if the actual page is the last one it does not work. my code in the printWhenExpression:

new Boolean($V{PAGE_NUMBER}==$V{AmountOfPages}) (AmountofPages is my own variable using $V{PAGE_NUMBER}, calculation type="Highest" and Reset Type="Report")

i tried new Boolean($V{PAGE_NUMBER}.intValue()==$V{AmountOfPages}.intValue()) and new Boolean($V{PAGE_NUMBER}.equals($V{AmountOfPages})), too but i the field is always shownin the report.

the reason for that is that at the time of the comparision the two variables have the same value because the evaluation time is "Now" for both variables.

how can i solve this problem?





By: Teodor Danciu - teodord

RE: printWhen problems

2003-03-21 04:27




The "printWhenExpression" is always evaluated

"Now", that is using the current values of the variables.




For example, you cannot know or use the total

number of pages in a "printWhenExpression",

because your decision to print something or not,

based on that value, will probably affect the total

number of pages itself.



The "evaluationTime" is only a bonus feature that

allows you to display text field or image content that is calculated later. But as you can see,

the text fields that have "evaluationTime" different

than "Now" cannot stretch.

Again why?

Because when we go back to display the content

we cannot rearrange elements on the page knowing

that this way the page breaks will change and

all the calculations already made will have

to be updated.


The last page of the report could only be intercepted

using scriptlets. There are some tricks explainig

how to do that in the forum.

Not very simple, but I'm working to simplify that.


I hope this helps.







By: Stefan G  ng - bishop3337

RE: printWhen problems

2003-03-21 05:26

thanks again teodor!

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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...