Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
4 replies Latest Post - ‏2013-06-25T18:18:48Z by DanielWagemann
TheBrenda
TheBrenda
61 Posts
ACCEPTED ANSWER

Pinned topic Run Report to Excel - how to set Fit Sheet to One Page

‏2013-06-25T13:32:52Z |

Run Report to Excel - how to set Fit Sheet to One Page.

I have an Report Studio report that I want to Run and open in Excel and allow the client to Print without having to manipulate. On some reports I may want to Fit Sheet to one Page, others I might want to Fit all Columns on One page, etc. I want to be able to control the print settings of the worksheet. BTW - There might be multiple worksheets in each workbook (that is my next question). How can I control the Excel print settings?

Thanks

 

  • OpherB
    OpherB
    677 Posts
    ACCEPTED ANSWER

    Re: Run Report to Excel - how to set Fit Sheet to One Page

    ‏2013-06-25T17:35:11Z  in response to TheBrenda

    You're asking "How can IBM Cognos BI Report Studio control what Microsoft Excel does?"

    I think it's pretty obvious that it cannot.

    Regards,
    Opher

     

    • TheBrenda
      TheBrenda
      61 Posts
      ACCEPTED ANSWER

      Re: Run Report to Excel - how to set Fit Sheet to One Page

      ‏2013-06-25T17:39:57Z  in response to OpherB

      I am asking if anyone has any experience doing this. It might be in Cognos, it might be some other way. I cannot be the only person that has needed to get this done. Looking for ideas.

      • OpherB
        OpherB
        677 Posts
        ACCEPTED ANSWER

        Re: Run Report to Excel - how to set Fit Sheet to One Page

        ‏2013-06-25T17:54:45Z  in response to TheBrenda

        You might be able to set some kind of Excel trigger to run a macro. If  you use the SDK you might be able to capture the output and run an Excel macro against it. I have heard of many people wanting to do this, but never a satisfactory result.

        Good luck,
        Opher

         

      • DanielWagemann
        DanielWagemann
        850 Posts
        ACCEPTED ANSWER

        Re: Run Report to Excel - how to set Fit Sheet to One Page

        ‏2013-06-25T18:18:48Z  in response to TheBrenda

        The following is in theory as I have not tested it.  Provided that an excel macro can be run for each format option you want to perform. (Adjust Columns, Fit to Page) and the macro can be executed within excel on open.

        You could try something like:  Create a prompt that populates a certain cell in the spreadsheet with a value the represents the action.

        On excel open the macro checks this cell and then fires the correct function to do the desired task.