I have created multiple sheets based on locations from NAV using the Excel buffer functionality. Now, i need to copy the rows and columns from one sheet to another similar to copysheet. Is this possible?
Add this function to the 370 table:
AddNewSheet(SheetName : Text[250])
XlWrkShtWriter := XlWrkBkWriter.AddWorksheet(SheetName);
IF SheetName <> '' THEN BEGIN
XlWrkShtWriter.Name := SheetName;
ActiveSheetName := SheetName;
END;
CurrentRow:=0;
CurrentCol:=0;
Hi,
Thanks for the response. This is like we manually insert the data into each sheet through addcolumn. I need something like copying Sheet 1 data to Sheet 2 and so on.
It should be like copysheet(Sheet1,Sheet2). Can we do Something like this in navision using the excel buffer?
Answers
AddNewSheet(SheetName : Text[250])
XlWrkShtWriter := XlWrkBkWriter.AddWorksheet(SheetName);
IF SheetName <> '' THEN BEGIN
XlWrkShtWriter.Name := SheetName;
ActiveSheetName := SheetName;
END;
CurrentRow:=0;
CurrentCol:=0;
The program flow should be like:
ExcelBuffer.DELETEALL;
CLEAR(ExcelBuffer);
FilenameServer:='';
ExcelBuffer.CreateBook(FilenameServer,'asdf');
ExcelBuffer.AddColumn('qwer',FALSE,'',FALSE,FALSE,FALSE,'',ExcelBuffer."Cell Type"::Text);
ExcelBuffer.AddColumn('zxcv'),FALSE,'',FALSE,FALSE,FALSE,'',ExcelBuffer."Cell Type"::Text);
ExcelBuffer.NewRow;
ExcelBuffer.WriteSheet('sheet1',COMPANYNAME,USERID);
ExcelBuffer.DELETEALL;
ExcelBuffer.AddNewSheet('sheet2');
ExcelBuffer.AddColumn('p',FALSE,'',FALSE,FALSE,FALSE,'',ExcelBuffer."Cell Type"::Text);
ExcelBuffer.AddColumn('o',FALSE,'',FALSE,FALSE,FALSE,'',ExcelBuffer."Cell Type"::Text);
ExcelBuffer.NewRow;
ExcelBuffer.WriteSheet('Pedidos',COMPANYNAME,USERID);
ExcelBuffer.DELETEALL;
ExcelBuffer.AddNewSheet('sheet3');
.
.
.
.
.
.
.
.
Thanks for the response. This is like we manually insert the data into each sheet through addcolumn. I need something like copying Sheet 1 data to Sheet 2 and so on.
It should be like copysheet(Sheet1,Sheet2). Can we do Something like this in navision using the excel buffer?
Thanks in advance
Excel buffer has his limits xd…
I wish u lucky