I'm developing a Java project with JasperReports(v.4.0.6) and DynamicJasperReports(v.4.0.1). I have generated a custom .jrxml with the most recent iReport plugin for Eclipse.
In my .jrxml report, I define two parameters which will be filled by the Java program according to some input given by the user.
<parameter name="ReportTitle" class="java.lang.String"/>
<parameter name="DataFile" class="java.lang.String"/>
Then, as this tutorial states, and since I want to maintain a couple of parameters predefined, I invoke the setTemplate() method from my code.
String table_template = "report_templates/TableTemplate.jrxml";
Map<String, String> params;
...
DynamicReportBuilder drb = new DynamicReportBuilder();
drb.setTemplateFile(table_template, true, true, true, true);
DynamicReport dr = drb.build();
I pass the parameters to the template doing the following:
params.put("ReportTitle", "CustomTitle");
params.put("DataFile", "CustomSubtitle");
However, when I genereate de report, these two fields appear blank, as if the DJ library hadn't save the places in which to insert the values beforehand. I don't get any other errors or exceptions.
I've tried downgrading the Jasper library to al older version, but to no avail either.
I'd appreciate if someone could give me some insight to what I am doing wrong.
Thanks in advance.