john.doe1991 Posted October 11, 2013 Share Posted October 11, 2013 Hi guys,Could you please advise me how can I setup single property file accessible for all reports and set the default value for parameter (with default value expression in iReport) something like $R{my.shared.property} from that property file. Is there any solution? Link to comment Share on other sites More sharing options...
Teodor Danciu Posted October 11, 2013 Share Posted October 11, 2013 Hi,Can you give more details about what you want to achieve? Do you mean you have a parameter that exists in all your reports and you want it to have a default value coming from a resource bundle?Are you looking for a way to ensure all reports have a parameter already pre-defined in them? Thanks,Teodor Link to comment Share on other sites More sharing options...
john.doe1991 Posted October 11, 2013 Author Share Posted October 11, 2013 I'm looking for a way I have a single common properties file for all reports. And I would like to be able to get this property in report for default value expression something like $R{my.prop} or $P{REPORT_RESOURCE_BUNDLE}.getString("my.prop") Link to comment Share on other sites More sharing options...
Teodor Danciu Posted October 11, 2013 Share Posted October 11, 2013 I still don't understand what exactly prevents you from using the same resource bundle file for all your reports by poiting to the same resource bundle using the resourceBundle property of the report template. Please give more details about what exactly you want to reuse across all your reports because I simply don't get it from the two rows of text you've provided so far. Link to comment Share on other sites More sharing options...
john.doe1991 Posted October 14, 2013 Author Share Posted October 14, 2013 I have almost solved the issue as follows. I put required property to WEB-INF/classes/jasperreports.properties of Jasper Server and then wrote next default expression value for parameter:JRPropertiesUtil.getInstance(DefaultJasperReportsContext.getInstance()).getProperty("my.shared.property")[/code]Seems that this solutions fits. But I get an error when I open a report:java.lang.ClassCastException: java.lang.Object cannot be cast to net.sf.jasperreports.engine.JRParameter[/code]Could you please help me to get rid of this error? 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