Jaspersoft - group Start New Page ignores print when expression - jasper-reports

I have a group header which contains a title, a short description and then in the details band I print out the content.
I've set it up so that for each new group (grouped by title) it should start on a new page. Now I want to make sure that I don't print the title and the short description if I don't have any content related to it. So I've made a field which checks for a unique id in the content and use that field in the group band properties print when expression and in my details band print when expression.
And that works, I no longer print the title and short description if there is no content related to it. Here's the problem, with this setup I get a lot of empty pages inside my report where it originally printed the title and short description without content. If I remove the Start New Page option in my group I no longer get these empty pages. So somehow my group starts a new page before checking my print when expression, then checks it and decides not to print the groups content.
Have I've done something wrong or is there any way to bypass this behavior?

Instead of using the Start New Page setting in the group I used a break element with a Print When Expression, this does exactly what I thought the Start New Page option would do.

Related

SSRS does not work when input parameter has a + sign

I'm creating a report which has as input parameters: id and name. These parameters are used in the where clause of the select from which I get the records to display in my list.
The problem is that if there is a + sign into the name the parameter (that I print on the page to display the filter) name appears with a space instead:
Input parameter = "record+story"
Parameter shown in report: "record story"
So the result of the select is empty, since the name doesn't match!
What am I missing?
EDIT: I open the report through a client application, based on VB6. There is a main page with a table and a list od ids, when I click on a row of the list it redirects me to an IE page performing the filtering and showing only the needed data.
The parameters are: id - Integer, and name - text.
When it opens the IE page I see that if the name contains a plus sign there appears instead a space, which of course is wrong, therefore the resulting report is empty.
I already tried to add the System.Web reference to VB6 in the client application, but it doesn't work.
Here a picture to clarify what I mean.
Thank you
C.
In the end I got the solution. I only need to encode my parameter so that the + sign is read as a + sign. This is achieved by using the hex value in the code behind:
example: namewithplussign ==> replace(namewithplussign , "+", "%2b")

The column footer band not to print on last page

How can I achieve this? I also tried using "print when expression" with condition
new Boolean($V{PAGE_NUMBER}.intValue() < $V{PAGE_COUNT}.intValue())
but sadly it does not work. Please help me.
This print when expression works fine for me $V{PAGE_NUMBER}<$V{PAGE_COUNT}. It works when applied to either the column footer band or the footer band element (I used static text).
Comparing PAGE_NUMBER and PAGE_COUNT is like comparing apples and oranges.
The Built-In Variables
PAGE_NUMBER: At every iteration it contains the number of the pages that compose the report.
PAGE_COUNT: Contains the number of record processed in the current page
To answer the question: JasperReports knows a band type "Last Page Footer" (wiki description) to define a different footer on the last page.
(Your problem might already be solved. But I stumbled upon this two year old question while having a similar issue and wanted to leave a hint, that one should not compare those variables.)

Printing the head line only on first page

I have jasper report which is created by many objects.
I want the header in one object. The object may come any where in the report.
How can i print header only on the first page of the object.
Can i use print when expression if page number equals 1.
is that page no means for whole pdf report or for only single jrxml object.
Thanks.
What does you mean anywhere in the report? If you want to print a title only once and in the first page, use the Title band in the jasper reports. No need of additional conditions required.

JasperReports Continued on next page Grouping

I have a jasperreport that prints debtors statements. I need to print 'Continued on the next page' in place of my existing group footer when there are more records than can fit on the first page.
I have created a second group footer which has the message and I want to print this when there is more to print, and the existing when it has finished.
Is there a way I can tell, at the end of the page, if there are more records in the group to print so I can build a "Print with Expression" expression?
With thanks
Mark
Ok this is the way I solved this.
I moved my subtotals for each client to the Page Footer and I added a text field with the words 'Continued...'.
In my group footer I placed a subreport component. I created a Boolean var called returnValue and passed it to and back from the subreport which set it false.
Using the print expression I only print the subtotal fields when returnValue is false and the 'Continue...' field when it tests null.

Fix Detail Band Relative To Top In The Page It Is Being Printed

I am using iReport version 4.0.1. I am facing a problem in which I want to display some information that must come on the 2nd page only. So, its neither a FOOTER nor a LAST-PAGE-FOOTER. I am using iReport for generating the jrxml files and the design looks something like below.
{HEADER}
{DETAIL-BAND-1} Remarks: Till this point my 1st page finishes
{DETAIL-BAND-2} Remarks: This is coming from a sub-report
{DETAIL-BAND-3} Remarks : This is coming from a sub-report
Some Random Empty Space Is Left
{DETAIL-BAND-4} Remarks: This is where my 2nd page footer needs to come.
.
.
.
.
{Lots of Bands}
.
.
{MAIN-REPORT-FINISHES}
So, I want the footer (actually it is not a footer, its some detail that only need to come on the 2nd page of the pdf generated by JR) to be fixed relative to the top of the page in which it is being printed. Is there a way to do that?
Thanks
Try to use the property "Print When Expression" and then you can use a variable that already exists in your iReport called PAGE_COUNT and it will be printed only when this expression is true.