Tuesday, 11 February 2020

Tip : Page numbers of report having sub reports in Jaspersoft Design Studio reports


Master/Parent Report : 
* Call all the sub reports from Master Report.
* It is not required to give any variables in Mater report to get the page numbers (at least in this example)

Sub Report-1 : 
* In Sub Report-1 drag $V{MASTER_CURRENT_PAGE} variable to the band (presuming the page number is kept in Title band in this case)
* In the variable properties, keep Evaluation Time = Master




Sub Report-2: 
  Perform the same steps as in Sub Reprot-1
Sub Report-3: 
Perform the same steps as in Sub Reprot-1
.
.
.
Sub Report-N: 
Perform the same steps as in Sub Reprot-1


Sample outputs from original example in which I did not keep page number variable for first sub report so my report is displaying page numbers starting from 2nd page.



NOTE: If you publish any of the sub report as an individual report, the report always displays page number starting from 1 

No comments:

Post a Comment