0

My question is about a specific situation. Current project is with DynamicJasper 5.0.0. It create a main dynamic report with many subreports concatenate one after another, and each subreport also take an existing jrxml template:

String jrxmlTemplateFile = "META-INF/jasperReports/single_subreport.jrxml";
subBuilder.setTemplateFile(jrxmlTemplateFile, false, false, true, false);

I set the 4th parameter to true because there are parameters defined in the single_subreport.jrxml, and I really like to pass the value from java.

subReport.addParameter(name, className);

can add parameter into the dynamic report but don't know how to pass the parameter, and where can set the position of the parameter.

So I really appreciate if there is any way to restore the usage like

report.setParameters(..)

so I can pass any value I want to the existing jrxml template.

Thanks in advance !

Dreamer
  • 7,333
  • 24
  • 99
  • 179
  • 1
    Have u define the parameters in `single_subreport.jrxml`? something like ``. That will allow you to pass the parameter value from java. – ggDeGreat Sep 14 '15 at 06:16
  • Registering a parameter is needed if later in your template you want to reference it by name, but you can have dynamic params by referencing the $P{REPORT_PARAMETERS_MAP}.get("your key") y your expressions (and casting properly, etc, etc) – Dj Mamana Oct 12 '15 at 22:29

0 Answers0