Friday, 23 January 2009

Custom Export to CSV (again)

If you ever had to deal with exporting data different from the data you display, you probably visited this blog posting:

http://spendolini.blogspot.com/2006/04/custom-export-to-csv.html

which shows how that can be done. The purpose of the post is a bit different - it shows how to adjust the format of the exported file. Just recently I had a requirement to display some reports created using analytic functions with some groupings and counts. At the same time, there was a requirement to export the data without the results of the analytics. I could have used Scott's posting but I was too lazy. Instead of that I used the following (simple) approach. Basically, you would create two reports - on in which you display your data and one (never displayed) for exporting. The only thing you need to do then is to modify the link label.



3 comments:

  1. Denes,

    Is there a way to do this for FLOW_XMLP_OUTPUT_R in Print Attributes for BI Publisher?

    Thanks,

    Mike

    ReplyDelete
  2. Hi Denes,

    I just stumbled about a problem with creating a CSV export via an extra button. With your nice solution it wasn't any problem to fix that. :D

    Regards,

    Tobias

    ReplyDelete
  3. Greetings Denes,

    I have given you example on Export to xml files straight from Reports.

    I am glad to say that with a few changes it also works on Interactive reports.

    However i am trying to implement something different.
    I wish to have the same feature but within an ajax request, i don't want to submit the page.

    I already know how to fill in all the variables required.
    the only problem is on how to return the file to download.
    In your method as soon as the page submits you present the file to download.
    I want to be able to do that but after an ajax request and not after a submit.
    I am quite sure the problem is about http/header mime types.

    I can return the whole xml into the javascript. I can even see it in an alert() or in the page with document.write(); but i haven found a way on how to make it as a file download automatically.


    Think you can give us some help?

    thanks Igor Carrasco, Pedro Mendez (from oracle forum)

    ReplyDelete