iReport - display Page x / y only if number of pages is > 1

1,080 views
Skip to first unread message

Nicolas Micoud

unread,
Sep 6, 2017, 10:09:15 AM9/6/17
to iDempiere
Hi all,

I'm struggling with iReport (4.6.0) trying to create a report for an invoice that will display "Page x/y" (x is current page and y number of pages) when the report has more than one page.

ATM, I have 2 fields :
#1 : "Page " + String.valueOf($V{PAGE_NUMBER}) + "/ "
#2 : String.valueOf($V{PAGE_NUMBER})

And i use different evaluation times to get values (Now for current page, Report for total)

But i can't find a way to display them only when the report has more than one page.

Any hint ?

Thanks,

Nicolas

Hiep Lq

unread,
Sep 6, 2017, 11:47:01 AM9/6/17
to Mohemmed Bilal Ilyas
not sure it can work in your case, but jasper report have display expression.

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/a450756f-6ace-4e19-8705-d63005a4b9a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Lê Quý Hiệp
Email: hie...@hasuvimex.vn
Skype: admin.hasuvimex

Company: Thanh Hoa Fishery Import - Export J.s.c  (HasuvimexDL 47
Add: Lot E, Le Mon Industrial Zone, Thanh Hoa, Vietnam

Rheine Adithia

unread,
Sep 15, 2017, 2:30:06 AM9/15/17
to iDempiere
hello, 

you use a default variable called $V{Page_Number} with the evaluation Time set as "Now" for the current page, or the "x" in your example
and use the same variable (yes the $V{Page_Number} with the evealuation Time set as "Report" for the sum of all page in the report ( the "Y")

Hope this helps :D

Best Regard,
Rheine Adithia Kurniawan

Nicolas Micoud

unread,
Sep 15, 2017, 3:28:05 AM9/15/17
to iDempiere
Hi,

Yep, that's what i'm doing ; the issue is about using it for "print when expression".
I want to display fields only on some particular pages, according to their number.

Nicolas

Anozi Mada

unread,
Sep 20, 2017, 1:20:29 AM9/20/17
to iDempiere
You can try add count records in the query, compare it with $V{PAGE_COUNT} and use that as your Print When Expression. Basically it compares the total number of records with the number of records in current page so you will know if you have more than one page. It's not elegant and it's not correct when you have summary band in separate page by itself but that's a workaround I could think of.

Regards,
Anozi Mada
Reply all
Reply to author
Forward
0 new messages