Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get parameters defined in jasper file?

I need to get the parameters defined in a jasper file so I can generate inputs depending of the type of these parameters to fill the report.
I'm working with jasperreports-5.0.0

like image 259
Ouadie Avatar asked Apr 10 '13 12:04

Ouadie


1 Answers

JasperReport jasperReport = (JasperReport)JRLoader.loadObject(new File("report.jasper"));
JRParameter[] params = jasperReport.getParameters();

for(JRParameter param : params) {
  if(!param.isSystemDefined() && param.isForPrompting()){
     param.getName();
     param.getDescription();
     param.getDefaultValueExpression();
     param.getNestedTypeName();
  }
}
like image 103
Ouadie Avatar answered Sep 18 '22 23:09

Ouadie