Excel Buffer / Createbook

christian
christian Member Posts: 8
Hello,

i made an output of a report with the table 370 (Excel Buffer) into an excel file.
I see there are some properties to modify the cells in excel.

I was wondering if it is possible to set the orientation of the excel file to "landscape" by using the createbook or some other function or property of excelbuffer.

Thanks for your answers ...

Comments

  • Waldo
    Waldo Member Posts: 3,412
    What I always suggest:
    try it out by recording a macro in excel ... and try re-use the code that is generated in your C/AL.

    Hope this helps. :-k

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • Slawek_Guzek
    Slawek_Guzek Member Posts: 1,692
    Hi,

    The easiest and fastest method I know (but somewhat limitet) is:

    If your report has fixed numer of columns and rows, then you can create empty, but preformatted Excel file (or template) in Excel, open it from Navision, put your values into it, and store under different name.

    You can even store this preformatted template in BLOB inside Navision.

    Regards,
    Slawek
    Slawek Guzek - www.yitron.co.uk
    Business Central, MS SQL Server, Wherescape RED;
  • christian
    christian Member Posts: 8
    I tested it a little bit since I've realised that my excel sheet was always created in "landscape".

    Maybe excel buffer automatically made it by the orientation set in the report?

    If i have some time, I'll try it out.

    edit:
    If you look at the C/AL-Code of the Function CreateSheet, you will find the following code:
    XlWrkSht.PageSetup.Orientation := XlLandscape;