Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Update / Add records to a csv report
ranjeetkgupta
<p>HI</p><p> </p><p>Just started with BIRTframework. The requirement is quite simple . Have to generate csv reports from a Java standalone program which would produce data (java objects) at regular intervals in a single execution/jvm.</p><p>I am using BIRT java api using the csv emitter plugin to do so using a scripted datasource that points to the class and method that generates data.</p><p> </p><p>The problem is after the first set of data is generated and a csv report is created , the second execution of the report generating program <span class='bbc_underline'><strong>overwrites </strong></span>the existing csv file and not append further data. How can I avoid that ?</p><p>Additional records should be added to the existing csv file everytime the report program is fired.</p><p> </p><p> </p><p>Seems no property is there in CSVRenderOption . Attaching relevant files. Report.executeReport() will be fired every-time, there is some data to report.</p><p> </p><p>Thanks </p><p> </p><p>Ranjeet K Gupta</p><p> </p><p> </p><p> </p><p> </p>
Find more posts tagged with
Comments
kclark
<p>After a quick glance at your code in Report.java you could check to see if csvTest.csv exists. If it does read the contents into a string. Then render, add the two and save the new csv.</p>
ranjeetkgupta
<p>Thanks Kristopher ..however i am using BIRT reporting as part of batch processing which would run in several iterations(greater than 1000). Each iteration would contribute to 500 records. So solving the problem in this fashion would be an overhead during the last iterations as I would need to read lakhs of records and then add 500 records and then save it back to a new file.</p><p> </p><p>Is there any other optimal way of doing this ?</p><p> </p><p>Regards</p><p> </p><p>Ranjeet K Gupta</p>