pyreportjasper icon indicating copy to clipboard operation
pyreportjasper copied to clipboard

Resource not found when calling sub report

Open raviselva4 opened this issue 2 years ago • 5 comments

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.

raviselva4 avatar Jan 10 '23 21:01 raviselva4

I used an parameter 'reportdirectory' as quickfix, and referenced the parameter in the subreportExpression ($P{reportdir}+"SubEmployee.jasper")

jserve avatar Jan 26 '23 08:01 jserve

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.

jadsonbr avatar Dec 29 '23 11:12 jadsonbr

Here is the example link. This link is no longer available, it doesn't show anything

arnaldocorreaxO avatar Jan 27 '24 20:01 arnaldocorreaxO

@arnaldocorreaxO Link available again.

jadsonbr avatar Jan 28 '24 01:01 jadsonbr

Will be closing soon due to lack of engagement.

jadsonbr avatar Apr 15 '24 12:04 jadsonbr