n00b Posted September 4, 2009 Share Posted September 4, 2009 Hello,I am using jasper reports for some time and it has been a smooth experience so far with charts and tables.Now, My current situation is like this:my report (lets call it experiment report) contains the following things: a bar chart (barchart.csv) a timeline chart (timechart.csv) a table (table.csv)I have multiple csv files which i use as a data source for each of the above elements.Now, my current requirement is that i create multiple instances of the same report above mentioned. i.e. There will be a master report which will contain the above experiment report as a subreport and there can be N number of experiments.So, the final report should have the following things: Experiment1 a bar chart (barchart-e1.csv) a timeline chart (timechart-e1.csv) a table (table-e1.csv) Experiment2 a bar chart (barchart-e2.csv) a timeline chart (timechart-e2.csv) a table (table-e2.csv) And there can be N number of experiments. (it will be decided on run time)I will have different set of csv files for each elements. but my question is how do i include multiple subreports at runtime because the template (jrxml file) is created only once.Is it possible through jasper report APIs? or any other way?-n00b Link to comment Share on other sites More sharing options...
pawel_r Posted September 4, 2009 Share Posted September 4, 2009 Well, I am not an expert in this matter, but I am afraid it is not possible with jasperreports API.The solution should be possible to obtain with some external XML templating tool, like Velocity.There is a great article (accessible from jasperreports Docs) about that:http://www.ibm.com/developerworks/websphere/library/techarticles/0505_olivieri/0505_olivieri.html BTW: How are planing on generating multiple cascade styles for your report (just curiosity :) )Post Edited by pawel_r at 09/04/2009 11:21 Link to comment Share on other sites More sharing options...
n00b Posted September 4, 2009 Author Share Posted September 4, 2009 Hi,Thanks for the article, it seems my problem would be resolved using velocity engine.I will try it with a simple report first of all and will let everyone know whether it worked or not. -n00b Link to comment Share on other sites More sharing options...
sergeleo Posted September 4, 2009 Share Posted September 4, 2009 I'm using Velocity for my report. Hint! I noticed that Velocity engine mistranslates Jasper's parameters while processing template. My workaround is to set Velocity variable and pass value to Jasper Parameter/Variable. Link to comment Share on other sites More sharing options...
n00b Posted September 7, 2009 Author Share Posted September 7, 2009 Yes, i tried it with a simple report and it seems to be working with Velocity! Thanks everyone. :) 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