Quantcast
Channel: NAV Three Tier — mibuso.com
Viewing all articles
Browse latest Browse all 10032

Update existing Excel file through Excel buffer?

$
0
0
Hi guys. I have excel file and I want to fill excell buffer temp. through processing only report and then to fill my excel table from there.
This is what I have done.
I created ProcessingOnly report where I created this function:


LOCAL EnterCell(RowNo : Integer;ColumnNo : Integer;CellValue : Text[250];Bold : Boolean;Italic : Boolean;UnderLine : Boolean;Format : Text[30];CellType : Option)
ExcelBuffer.INIT;
ExcelBuffer.VALIDATE("Row No.",RowNo);
ExcelBuffer.VALIDATE("Column No.",ColumnNo);
ExcelBuffer."Cell Value as Text" := CellValue;
ExcelBuffer.Formula := '';
ExcelBuffer.Bold := Bold;
ExcelBuffer.Italic := Italic;
ExcelBuffer.Underline := UnderLine;
ExcelBuffer.NumberFormat := Format;
ExcelBuffer."Cell Type" := CellType;
ExcelBuffer.INSERT;

Then in OnAfterGetRecord I placed this


Travel Order - OnAfterGetRecord()
FileName := 'D:\Putni nalog.xlsx';
SheetName := 'Sheet1';
ExcelBuffer.OpenBook(FileName,SheetName);
EnterCell(2,2,'TravelOrder',FALSE,FALSE,FALSE,'',ExcelBuffer."Cell Type"::Text);
//ExcelBuffer.CreateBookAndOpenExcel('Sheet1','Report',COMPANYNAME,USERID);
//ExcelBuffer.OverwriteAndOpenExistingExcel(FileName);

I want to write on my file Putni nalog.xlsx using
EnterCell(2,2...);
EnterCell(2,5...); etc, depending what I need and in which field in my file do I want to write it.
But when I try using OverwriteAndOpenExistingExcel it gives me error 'The file does not exist'.
What should I use to write on my existing file?
And how can I write some value from my table "Travel Order" since
EnterCell(2,2,TravelOrder."No",FALSE,FALSE,FALSE,'',ExcelBuffer."Cell Type"::Text); for example, simply does not work?

THANK YOU!

Viewing all articles
Browse latest Browse all 10032

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>