Jump to content
We've recently updated our Privacy Statement, available here ×

About page number


Recommended Posts

By: Painter - torlh

About page number

2006-03-16 23:54

Hello,

 

My name is Curt Huang. I have a question here. In JasperReport 0.6.0, we can have batch export using parameter JRExporterParameter.JASPER_PRINT_LIST. After we export three reports which contains page number to one file, the file still keeps the original page numbers of each report. I suggest this exported file may generate the page numbers again for all pages. Thus all pages in the exported file has continus page numbers.

 

Thank you!

Curt

 

 

By: jasperkan - jasperkannan

RE: About page number

2006-03-17 09:48

Its not clear wht you mean here ? do u mean that if a report has subreports , then page number of the subreport should be continous ? I think

the subreport page number is independent of the main report ,so it starts again from 1 . To solve this, We are passing PAGE_NUMBER as a parameter to the subreport and using it to set page numbers .

 

 

By: Painter - torlh

RE: About page number

2006-03-22 19:02

Hi,

 

Let me clarify my question here. For example, in the demo sample,"batchexport",we have three jrxml files(Report1,Report2 and Report3) which has their independent page number. After we use the JASPER_PRINT_LIST parameter to combine the three reports and export to one file like PDF. The page numbers in the exported file has original numbers from the three report files which are not a series. I think sometime we may need to change page numbers in the exported file such that we can have continous page numbers in the exported report file.

Link to comment
Share on other sites

  • 3 years later...
  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

  • 3 weeks later...
  • 2 weeks later...

Hi!!

I did manage it, i hope it can help you. I had two reports, one with data(reportA) and another with a chart(reportB), and each one has its own pages.

I obtained the jasperPrint of the report A.

with the jasper print i already know the number of pages of the reportA.

I already know that the reportB has only one Page, so I send a

parameterMap.put("totalPage",String.valueOf((jasperPrint.getPages().size()+1)));

In the jrxml of the reportB I created a parameter totalPage, and used it to display the pages.

I show the pages like 1 / 3 for example,

and the text field expression is

(($P{totalPage}.length() == 0)?(" " + $V{PAGE_NUMBER}+ " "):(" " +$P{totalPage})+ " ")

In my case i use the reportB with other reports also, wich means that if send 0 in totalPage then its also ok.

the evaluation time is different, for the 1 is "now", and for the 3 the evaluation time is Report.

My reportA is in portrait and the reportB in Landscape and it works fine.

I hope it helped you.

 

 



Post Edited by nnvc at 11/20/2009 11:20
Link to comment
Share on other sites

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