How to add page number in multipage pdf report

2019-09-18 10:02发布

问题:

I have created multiple pages pdf report using iReport as below.

Pdf report

How to put page number like (page 1 of 2) in this pdf report ?

If i will put same in iReport it will take all pages as separate page and give numbers accordingly, like:

for page1.jrml >> page 1 of 2 and page 2 of 2
for page2.jrml >> agian same page 1 of 1

...

it should be like:

for page1.jrml >> page 1 of 3 and page 2 of 3
for page2.jrml >> page 3 of 3

Please suggest.

回答1:

You page numbering won't be correct because by using that approach you are creating 2 reports and merging them into 1 PDF, instead of creating a single report.

If you embed the second report into the first as a subreport, the page numbering should then be correct.



回答2:

Im guessing you are putting the page number inside subreport. Page numbers should be in the page footer section of the main report.