pyreportjasper
pyreportjasper copied to clipboard
Resource not found when calling sub report
Describe the bug I have one main report calling another sub report and that sub report calling another sub-sub-report. Here is my code :
def run_jasper(incon, report_name, out_name, out_format, inpara): input_file = os.path.join(REPORTS_DIR, report_name) output_file = os.path.join(OUTPUT_DIR, out_name) pyreportjasper = PyReportJasper() pyreportjasper.config( input_file, output_file, output_formats=out_format, parameters=inpara, resource=RESOURCE_DIR, db_connection=incon, ) print('Before calling report....') pyreportjasper.process_report()
when I call this report, it throws the following error:
NameError: Error fill report: Erro fill internal: net.sf.jasperreports.engine.JRException: Resource not found at: repo:PB_Common_Data.jasper.
Could you please me know how to resolve this issue?
Desktop (please complete the following information):
- OS: Mac
- Python version [e.g. 3.10]
- Java version [openjdk 11.0.13]
Jaspersoft Studio (please complete the following information):
- Version [e.g. 8.1.0]
Additional context Add any other context about the problem here.
I used an parameter 'reportdirectory' as quickfix, and referenced the parameter in the subreportExpression ($P{reportdir}+"SubEmployee.jasper")
Try using version 2.1.3
of pyreportjasper as there have been improvements in this regard. There's also an example of how to use it made using version 2.1.2, which is also supported in the new version. Here is the example link.
Here is the example link. This link is no longer available, it doesn't show anything
@arnaldocorreaxO Link available again.
Will be closing soon due to lack of engagement.