Cognos Analytics

Cognos Analytics

Connect, learn, and share with thousands of IBM Cognos Analytics users! 

 View Only
  • 1.  Export To Excel Button - Export Another Page of the Report

    Posted Thu September 02, 2021 10:37 AM

    I have 2 pages in my Cognos Report. 1st page contains Summary data and 2nd page contains Detail data.

    Is it possible to add a button/link on Summary Page(1st Page) called "Export to excel" which will export data of Detail Page(2nd Page) in excel?

    When we run the report from Cognos Connection, the report should run in HTML format and Summary Page(1st Page) should be displayed and Detail Page (2nd Page) should not be displayed.

    And when we click on the Export to Excel button, the Detail Page (2nd Page) should get downloaded in Excel and not the Summary Page(1st Page).

    I am using Cognos 11.1



    ------------------------------
    Ravin Saraiya
    ------------------------------

    #CognosAnalyticswithWatson


  • 2.  RE: Export To Excel Button - Export Another Page of the Report

    Posted Thu September 02, 2021 11:03 AM

    Hi Ravin,

    i'd say that's pretty easy: create a report variable that uses the function "ReportOutput()". You can create a string variable or a boolean variable depending on the number of formats you'd like to cover. We use a string variable with two strings/formats. It's up to you. If you use a boolean variable your expression should be similar like "ReportOutput()='spreadsheetML' " or any other comparison that suits your needs. 

    Then go to "Report" and select "Conditional layouts" in the properties pane:


    Select your newly created variable to be used to define layouts. The style adds an "(Other)" layout by default when you use a string variable otherwise it creates a Yes and No layout:


    The other layout will be used for HTML output. Paste the summary page into the HTML layout and the detailed page into the spreadsheetML layout. Done.

    When you run your report online as HTML only the summary page will be rendered. Run the report as Excel and the detailed page will be used.

    If you want a one click solution on your report you can also add a Drill-through definition where the reports links to itself and define the output format to Excel.




    ------------------------------
    Robert Dostal
    Team Leader BI
    GEMÜ
    Ingelfingen
    ------------------------------



  • 3.  RE: Export To Excel Button - Export Another Page of the Report

    Posted Fri September 03, 2021 02:37 AM
    Hi Ravin,

    You also need to use the RSVP.EXCEL.PAGEGROUP_WSNAME_ITEMVALUE = true, the tabs in Excel 2007 output are dynamically named according to the page breaks that are specified.

    On the Set advanced settings - ReportService page and Batch Report Service page, in the Parameter column, type RSVP.EXCEL.PAGEGROUP_WSNAME_ITEMVALUE.
    In the Value column, type true.

    Dynamically naming worksheet tabs in Excel 2007 reports - IBM Documentation (with 10.2.2)
    Dynamically naming worksheet tabs in Excel 2007 reports - IBM Documentation (with 11.1.x)

    Best regards,

    ------------------------------
    Patrick Neveu
    Consultant
    Positive Thinking Company
    Paris
    ------------------------------