tmagalhaes Posted November 25, 2009 Share Posted November 25, 2009 Is it possible to get the value of parameters from the filled JasperPrint object?I could look at the JasperReport.getParameters, but that only gives me the default values passed into the report.Our reports have some parameters that get their values from the underlying scriptlet and the optimal solution to our problem would be to peek the parameter value when the report finishes running.An alternative would be to get the JasperPrint object to expose the scriptlet instance. Any ideas? Link to comment Share on other sites More sharing options...
Teodor Danciu Posted November 30, 2009 Share Posted November 30, 2009 Hi, I'm not sure I understand what you want to do, but you could try use custom properties with expressions, at report level, and then you'll find them attached to the JasperPrint object.Make sure you use custom properties with a name that starts with the "net.sf.jasperreports.export" prefix, or add your own prefix to the list of prefixes that JR recognizes when it transfers properties from the design model to the print model, using a config property like this:net.sf.jasperreports.print.transfer.my_prefix=my.property.export.prefix I hope this helps.Teodor Link to comment Share on other sites More sharing options...
loge Posted December 22, 2009 Share Posted December 22, 2009 I followed your suggestion but custom properties at report level dont support expressions as it seems. Its easy to get back a static value which you defined at properties on report level but i need to get a evaluated expression. You can see this also when using iREport. On field properties level, you can check a "expressions" checkbox while on report level, you dont have that.Marc Link to comment Share on other sites More sharing options...
lucianc Posted December 22, 2009 Share Posted December 22, 2009 You're right, Teodor missed the fact that report level properties cannot have expressions. So if you want to get a parameter value from a JasperPrint object, you'll have to use one of the report elements to set the custom properties.But if you want to get the calculated parameter value after the report runs (as in the original post), you can get it from the Map object that you pass to the fillReport method.Regards,Lucian Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now