tanvirtonu Posted April 9, 2008 Share Posted April 9, 2008 I have a report which I want to populate with data given from my application not database.I have created and compiled the report with empty data source in Ireport.But, now I cant run that report from my application.Previously,I could run any .jasper file (with active connection)from the following code Code:JasperPrint jasperPrint = JasperFillManager.fillReport(reportFileName, map, jdbcConnection); JasperViewer.viewReport(jasperPrint,false); Now,what code should I write to run compiled jasper file which has empty data source.One more thing,if I pass a Map object from my application into report,how can I get the key and value of that map in Ireport/expression editor.Please help me. Link to comment Share on other sites More sharing options...
Pedja Posted April 9, 2008 Share Posted April 9, 2008 Put "new JREmptyDatasource()" instead of your connection object, and in your report design you have to define all the parameters that you want to use. Then, in your code, you can put something likeparameterMap.put("MY_PARAM", paramValue);and use the $P{MY_PARAM} to get the value from the map. 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