-
Notifications
You must be signed in to change notification settings - Fork 78
Open
Description
This happens whenever I try to process a report that requires a subreport.
Error fill report: Erro fill internal: net.sf.jasperreports.engine.JRException: Resource not found at: null*.jasper.
Where * is the name of the report file.
Obviously this reports needs a subreport, but I can't figure out how to insert it. I've tried reading other solutions users have submitted and the Python Doc but still couldn't figure out how to insert my .Jasper subreports.
Any help would be appreciated! This is what I currently got. Thanks for your attention!
def advanced_example_using_database():
try:
varname='*'
REPORTS_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'reports')
OUTPUT_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'final_report')
input_file = os.path.join(REPORTS_DIR, f'{varname}.jasper')
output_file = os.path.join(OUTPUT_DIR, 'hello_world')
conn = {
... #Assume this is correct. I can create reports that require no subreports.
}
pyreportjasper = PyReportJasper()
pyreportjasper.config(
input_file,
output_file,
db_connection=conn,
output_formats=["pdf", "rtf"],
parameters={'python_version': python_version()},
locale='en_US',
)
pyreportjasper.process_report()
output_file = output_file + '.pdf'
return FileResponse(open(output_file, 'rb'), as_attachment=True)
except Exception as E:
exc_type, exc_obj, exc_tb = sys.exc_info()
fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
logger.error(f'{exc_type}, {fname}, {exc_tb.tb_lineno}, {exc_obj}')
raise EReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels