Orientation when exporting to Excel

NormajmNormajm Member Posts: 82
Hello,

I would like to be able to change the export to Excel report orientation.

After reviewing the forums, I believe the code should be:
xlSheet.PageSetup.Orientation := 2; //1:Portrait, 2:Landscape

But where does that bit of code go? I'm using the Excel Buffer. I tried adding it to the CreateExcelbook function, but it is not right. Do I need to set up xlsheet as a variable, if so, what type of variable?
CreateExcelbook()
ExcelBuf.CreateBook;
ExcelBuf.CreateSheet('Items','Unit Sales Report',COMPANYNAME,USERID);
ExcelBuf.xlSheet.PageSetup.Orientation := 2;
ExcelBuf.GiveUserControl;
ERROR('');

Thank you.

JNM

Comments

  • Faithie_RobertsonFaithie_Robertson Member Posts: 24
    The Excel Buffer "CreateSheet" function sets the orientation as Landscape. You could add another parm to the function and pass either "Landscape" or "Portrait". :D

    Be aware that this is part of the pagesetup class. That means if a client does not have a default printer the function can bomb. You can google Microsoft Support for more information on that.
    So You Want to be NAV Developer?
    http://www.archerpoint.com/blog/faithie-robertson
    A blog by Faithie Robertson
  • NormajmNormajm Member Posts: 82
    Thank you for the help. Would I be able to access table 370 functions if we do not have a developer's license? Right now, I can only see how to add fields to that table.
Sign In or Register to comment.