COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: sundet on 23 Sep 2014 01:40:24 PM

Title: Export Table to Excel
Post by: sundet on 23 Sep 2014 01:40:24 PM
Good afternoon,

I want to export tables into Excel.  I found a way to do this via the HTML tool.  However, the result is that there are extra row(s) (blank) at the top of the Excel Sheet.  Here is the code I put into the HTML tool: "<input type='Button' value="Export"  onclick="javascript:gCognosViewer.getRV().viewReport('spreadsheetML')">."  I can choose CSV instead of spreadsheetML and not get the extra blank rows at the top but the formatting from Cognos will not show in Excel.  Is there an easy way to export a table to Excel and get the formatting from Cognos into the Excel sheet? 
Title: Re: Export Table to Excel
Post by: Lynn on 30 Sep 2014 05:13:18 AM
Quote from: sundet on 23 Sep 2014 01:40:24 PM
Good afternoon,

I want to export tables into Excel.  I found a way to do this via the HTML tool.  However, the result is that there are extra row(s) (blank) at the top of the Excel Sheet.  Here is the code I put into the HTML tool: "<input type='Button' value="Export"  onclick="javascript:gCognosViewer.getRV().viewReport('spreadsheetML')">."  I can choose CSV instead of spreadsheetML and not get the extra blank rows at the top but the formatting from Cognos will not show in Excel.  Is there an easy way to export a table to Excel and get the formatting from Cognos into the Excel sheet? 

Why don't you just run to excel instead of using Java script?
Title: Re: Export Table to Excel
Post by: sundet on 01 Oct 2014 08:55:38 AM
I don't know the answer to that question.  The Javascript can export to Excel but there are empty rows at the top of the sheet.  I have levels of drill through.  I want to be able to export to Excel at each level.  Which function or method are you referring to?
Title: Re: Export Table to Excel
Post by: MFGF on 01 Oct 2014 10:33:31 AM
I think Lynn is referring to the capabilities of Cognos 10 BI to render to various different types of output, including flavours of Excel:

(https://image.ibb.co/cNGW7v/Render_Types_zps8c12db61.png)

MF.
Title: Re: Export Table to Excel
Post by: sundet on 03 Oct 2014 08:10:45 AM
Good morning,

I am working in Report Studio 10.1.1 in a hosted environment.  My guess is that I have fewer options than most users.  I don't think that I have the ability to create reports that appear in Excel nor do I think the end users would like this because controls would show in Excel with the data. 

I can export to Excel when using a drill through.  However, I also want to be able to go to the target page of the drill through. 

Do you have any other suggestions?
Title: Re: Export Table to Excel
Post by: MFGF on 09 Oct 2014 07:49:02 AM
Quote from: sundet on 03 Oct 2014 08:10:45 AM
Good morning,

I am working in Report Studio 10.1.1 in a hosted environment.  My guess is that I have fewer options than most users.  I don't think that I have the ability to create reports that appear in Excel nor do I think the end users would like this because controls would show in Excel with the data. 

I can export to Excel when using a drill through.  However, I also want to be able to go to the target page of the drill through. 

Do you have any other suggestions?

This functionality is available in all versions of Cognos - unless your provider has explicitly removed it, in which case it's something I assume you shouldn't be doing?

Find a report in Cognos Connection. Press the "run with options" button to the right. You should be able to select the rendering type from there.

Cheers!

MF.
Title: Re: Export Table to Excel
Post by: sundet on 16 Oct 2014 03:00:50 PM
I researched what Cognos Connection is.  Neither I nor the end user have access to it.  Maybe I should discuss the matter with the vendor.  Please let me know if you can think of any other solution outside of getting the data directly from a database.  My knowledge of JavaScript isn't great yet.
Title: Re: Export Table to Excel
Post by: MFGF on 17 Oct 2014 09:46:54 AM
Quote from: sundet on 16 Oct 2014 03:00:50 PM
I researched what Cognos Connection is.  Neither I nor the end user have access to it.  Maybe I should discuss the matter with the vendor.  Please let me know if you can think of any other solution outside of getting the data directly from a database.  My knowledge of JavaScript isn't great yet.

Hi,

If you don't have Cognos Connection, what mechanism is being offered to allow you (or any other user) to run existing reports?

MF.
Title: Re: Export Table to Excel
Post by: sundet on 17 Oct 2014 12:16:59 PM
I don't know.  I could be wrong about not having Cognos Connection.  The research I did indicated that I don't have it.  The initial page the end user sees doesn't look similar to the pictures of Cognos Connection I have seen on the Web.  This might be because the vendor of the software has set up Cognos Connection in a particular way.  I'm not going to investigate the problem further in the near future.  Maybe I will look into the matter again after my JavaScript skills have improved.