COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: ATL on 12 Jul 2012 08:39:56 AM

Title: Export raw data into excel
Post by: ATL on 12 Jul 2012 08:39:56 AM
All,

I know the export topic has been discussed in depth in this forum, but I think that my question should be straightforward.

I know that there is an option to export the report in the excel, html, or PDF format that is built into all of the cognos reports, but that's really not what I'm looking for.  What I'd like to do is create an export button on the report that exports the raw data that the report has brought back from the database, including the column names.

I'm guessing that this is not something that can be done using only Cognos tools and that javascript will likely be involved.

Thanks in advance
Title: Re: Export raw data into excel
Post by: Rahul Ganguli on 17 Jul 2012 04:35:22 AM
You can create a query based on SQL and export the data to CSV.
Title: Re: Export raw data into excel
Post by: tjohnson3050 on 22 Aug 2012 12:27:06 AM
This is a common report requirement that I see.  What I usually do in this case is create a variable based on the report output using the report function reportoutput().  Then I create separate formatted report pages and data dump pages. 

The data dump page has no headers, footers, grouping or summaries.

Each page is conditionally rendered based on the report output.  The formatted page only renders when PDF or HTML format is selected and the data dump page is only rendered when the format is something else.

With this design, no separate button is needed, when the user chooses excel, they get the data dump, when they choose pdf or html, they get a formatted report.
Title: Re: Export raw data into excel
Post by: Lynn on 22 Aug 2012 06:37:36 AM
Maybe the attached technique is something you can expand upon for your requirement. It uses a drill through back to itself so you can specify the desired output format. The "button" is just a text item that has a drill through definition defined. When I wrote this up (ages ago) I'm pretty sure I tried using the button objects but they didn't have a property allowing a drill through definition, so I settled for a text item.

I also do just what TJ describes by conditionally rendering different pages based on the output format whether I need to include prompting for output format or not. It ensures a clean result that is best suited for the various output formats.
Title: Re: Export raw data into excel
Post by: chrysilis on 30 Apr 2013 09:09:32 PM
Quote from: Lynn on 22 Aug 2012 06:37:36 AM
Maybe the attached technique is something you can expand upon for your requirement. It uses a drill through back to itself so you can specify the desired output format. The "button" is just a text item that has a drill through definition defined. When I wrote this up (ages ago) I'm pretty sure I tried using the button objects but they didn't have a property allowing a drill through definition, so I settled for a text item.

I also do just what TJ describes by conditionally rendering different pages based on the output format whether I need to include prompting for output format or not. It ensures a clean result that is best suited for the various output formats.

Thank you Lynn for this solution!

We were using Javascript from http://www.cognoise.com/community/index.php?topic=12546.0 to meet this requirement in Cognos 8 and have recently found it does not work in our Cognos 10 environment (after going live of course...) but your solution worked perfectly and we've implemented it in all of 5 minutes! If you're ever in Adelaide, Australia and want a beer/other beverage let me know.
Title: Re: Export raw data into excel
Post by: Lynn on 01 May 2013 11:38:55 AM
Glad to hear it worked out for you!!

I would love to visit Australia one day and also love beer. If I manage a trip I'll let you know. I live very near to New York City so let me know if you ever find yourself in that neck of the woods.
Title: Re: Export raw data into excel
Post by: karanluniya on 05 Jun 2014 03:25:16 PM
Hi Lynn ,
I am generating a dashboard in reporting studio . On the dashboard there are multiple tables . I would like to export a specific table into an excel sheet using a button . Thanks in advance. It would be great help.
Title: Re: Export raw data into excel
Post by: Lynn on 05 Jun 2014 03:43:45 PM
You can use the same technique and just pass an extra item in the drill through definition to conditionally render only the desired item.