Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource not found when calling sub report #138

Open
raviselva4 opened this issue Jan 10, 2023 · 5 comments
Open

Resource not found when calling sub report #138

raviselva4 opened this issue Jan 10, 2023 · 5 comments

Comments

@raviselva4
Copy link

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.

@jserve
Copy link

jserve commented Jan 26, 2023

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

@jadsonbr
Copy link
Collaborator

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.

@arnaldocorreaxO
Copy link

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

@jadsonbr
Copy link
Collaborator

@arnaldocorreaxO Link available again.

@jadsonbr
Copy link
Collaborator

Will be closing soon due to lack of engagement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants