Options

How to autofit with Excel Buffer, without using Openexcel ( Nav 2015 excel buffer version)

DenisRDenisR Member Posts: 1
Hi,

I have a problem with Excel Buffer,I'm working on Nav 2015 and I have to create a report that export data from Purchase Line to Excel. After creating the excel I have this code on PostDataItem :

TempExcelBuffer.CreateBook(Title);
TempExcelBuffer.WriteSheet(Title,COMPANYNAME,USERID);
TempExcelBuffer.CloseBook;

....

Then I send the excel directly from the server via Mail to the target Recipient. The problem is that in the new Excel Buffer, the excel is generated using only XlWrkBkWriter, XlWrkShtWriter and the XlWrkBk or XlWrkSht are not initialized. I don't know how to initialized those variable to make the autofit of column, without using TempExcelBuffer.OpenExcel that download the file to client (I need to have the file modified server side).

Does anyone have any idea?

Thank You

Answers

  • Options
    YuryYury Member Posts: 59
    Hi, Denis
    After Excel file is complited, try to open it "hidden" without GiveUseControl. Make formatting and send by e-mail.
    Regards,
    Yury
Sign In or Register to comment.