Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Selective datarow export to pdf/xls/html
rbirt
<div>Hi,</div><div> I have an unusal requirement that I am working on ....</div><div> </div><div>I am exploring a solution for a requirement where in user selects using check box in front of the row of data from the generated list report and on clicking a button or something in the report we export only the selected datarows to a PDF/XLS/HTML format.</div><div>I have attached the illustrative images with this post.</div><div> </div><div>I was thinking of re-rendering the report output as the selection will be a subset of the existing data.</div><div>But i am unable to figure out the selective export of datarows.</div><div> </div><div>Any inputs on this will be highly helpful.</div><div>Thanks in advance !</div><div> </div><div>-Rohit</div>
Find more posts tagged with
Comments
kclark
<p>One way to do this would be to use a parameter query. When the user clicks some button you could use some JavaScript to get the values of what items have been selected then construct a URL passing these values back to the report and use the __format parameter in the URL. When you use window.location with the new URL using the __format parameter an open/save dialog should appear.</p>
rbirt
<p>Thank you for the quick response.</p><p> Do excuse me if my questions sound silly as I am a novice BIRT developer.</p><p> </p><p>Do you mean we use the Drill through ?</p><p> </p><p>I did understand the later part where we construct the URL with _format=pdf or any other output format.</p><p> </p><p> Will we be able to toggle the visibility property for the row based on the check box?</p><p> </p><p>Thanks,</p><p> Rohit</p>
kclark
<p>Take a look at the example I've attached. I used some JavaScript in a text item in the footer to do this.</p>
rbirt
<p>Thanks Kristopher for the example - it was very helpful !</p><p> Is there a way where we can avoid fetching the data again after the selection is made?</p><p>also if we have to make a multi page selection would we need to make any more changes?</p>
kclark
<p>The current example only works per page and if you choose the auto layout with a page break of 0 on the table then you can export anything from the report. To allow this to work across multiple pages there are a few different ways to do this. The easiest might be to take the data from your data set and build the HTML tables in a text item.</p><p> </p><p>If you're not wanting to rerun the data set when exporting the first thought that comes to mind would be a POJO as a data source. Then recreate the same report as your master report. Then when you link off to the subreport using a POJO then you'd need to pass the values from the ArrayList to this.</p><p> </p><p>If you don't want to build a POJO then one workaround would be storing the select values in some temp csv value for the second report to read from. Depending on how much data is being "exported" this may not be a good solution.</p>