Is it possible to know how pages will be?

Hello,

Is it possible to know how pages will be?

I need to popup custom dialog to user if no pages in report.

I am showing report like that:

Map<String,Date> params = new HashMap<String,Date>();
params.put("dateFrom",this.dateFrom.getDate());
params.put("dateUntil",this.dateUntil.getOneDayFuture());

jasperPrint = JasperFillManager.fillReport(reportName,params,DBConnection.getConnection());

When no pages i got to message boxes "The document have no pages"

Why it message box appears twice?

Is it some way to change message, i want to use other language. I now i can change in source but maybe there are some method?

Thanks a lot
Post edited by: prancius, at: 2006/09/03 20:17
prancius's picture
111
Joined: Jul 22 2006 - 7:13pm
Last seen: 1 year 11 months ago

3 Answers:

Not exactly, what you can do is print the variable
PAGE_NUMBER in a textfield with evaluation time Report.
The value printed will be the number of pages hold by the variable at the end of the report generation.

Giulio
giulio's picture
74017
Joined: Jan 2 2007 - 4:15pm
Last seen: 1 day 2 hours ago
I need to know how many pages before showing a report. If pages are 0 so i am popup some message to user and do not showing report.

Anyway why its popup two messages ???
prancius's picture
111
Joined: Jul 22 2006 - 7:13pm
Last seen: 1 year 11 months ago
you do not need sooo much complexity

if you look at the jasperreports there is a fucnction


isEmpty(), which returns a boolean. you do not need to check page count against a "0", just check the IsEmpty() function.
Code_Slave's picture
Joined: Aug 3 2006 - 8:42am
Last seen: 17 years 1 month ago
Feedback
randomness