Create one excel sheet by group header section

foronavisionforonavision Member Posts: 79
Hi,

I need to create a sheet for whenever there appears the Group header section report, e.g. if the payment method code of customer changes, the sheet must be change too.
I'm trying with the following code in OnPresection Group Header and in OnPostSection, but it doesn't work fine.

ExcelBuf.CreateBook;
ExcelBuf.AddSheet;
ExcelBuf.CreateSheet(FORMAT ("Payment Method Code"),FORMAT ("Payment Method Code"),COMPANYNAME(),USERID());
ExcelBuf.DELETEALL;


Thanks!!

Comments

  • pranav-joshipranav-joshi Member Posts: 46
    Hi,

    Write this in onpre of dataitem
    ExcelBuf.CreateBook;
    Writer this in onaftergetrecord of data item
    ExcelBuf.DELETEALL;
    ExcelBuf.AddSheet;
    Write this is on on post section of groupheader
    ExcelBuf.CreateSheet(FORMAT ("Payment Method Code"),FORMAT ("Payment Method Code"),COMPANYNAME(),USERID());

    it may work or best way is active the debugger.


    Pranav

    Pranav Joshi
    MS Dynamics NAV Consultant
    SBS Group Desert Mountain (Formerly Silverware Inc.)
  • HanenHanen Member Posts: 281
    Using automation Excel how to do that?
    Regards

    Hanen TALBI
Sign In or Register to comment.