0

I have a .jrxml JasperReport report. Within the I refer to children who are in the same folder. If I put the route as it is down works in development, but to generate the war path is not valid.

<subreportExpression><![CDATA[net.sf.jasperreports.engine.JasperCompileManager.compileReport("./src/main/resources/report/General.jrxml")]]></subreportExpression>

I tried it with:

"General.jrxml"
"./Genereal.jrxml"

But in all cases it tells me:

Caused by: net.sf.jasperreports.engine.JRException: java.io.FileNotFoundException: General.jrxml (No such file or directory)

What is the correct syntax to access its jrxml on the child, you still are in the same folder. Thank you very much.

Jose
  • 1,779
  • 4
  • 26
  • 50
  • ($P{"General.jrxml"}) , ($PGeneral.jrxml), ($P+"General.jrxml"), ($P+"/General.jrxml") = I've tried all these options, and not get it to work. No I'm doing wrong. – Jose Sep 01 '16 at 09:47

1 Answers1

0

In the java class

ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
parameters.put("path", classLoader.getResource("report/").getPath());

In the file jrxml

($P{path}+"General.jrxml")
Jose
  • 1,779
  • 4
  • 26
  • 50