I am stuck in a scenario where I have to Pass the Sub report as a parameter to my Jasper Report Object.I am new to Jasper and Spring Boot. Because When I pass the sub-report in parameter list locally it work fine but when i Deploy it on server It says my fileName.jrxml not found.
It is not the Parameter Issue. Its file Path issue. You need to load the jrxml file in the form of stream other wise on server due to the file path resolving in Springboot some time create complex paths which usually not found or people make mistakes defining path. You have to follow some steps.
Create folder in Resources directory of you project
Place your jrxml there
Load your jrxml file as Stream
InputStream stream=getClass().getResourceAsStream("/yourdir/yourfile.jrxml");
Compile the Stream into jasperReport Obeject
JasperReport subReportJasperCompileManager.compileReport(stream);
Now Pass it in Param List with the same name in your Parent Report
parameters.put("sub_report_setting", subJasperReportSetting);
Here are the 3,4 and 5th steps.
InputStream stream=getClass().getResourceAsStream("/yourdir/yourfile.jrxml");
JasperReport subReportJasperCompileManager.compileReport(stream);
parameters.put("sub_report", subJasperReportSetting);