[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: Simplest and efficient method to create excel (.xlsx or .xls) file and export data

  • Thread starter Thread starter avtar.jain
  • Start date Start date
Status
Not open for further replies.
A

avtar.jain

Guest
hi ithrees, it is quite easy if you have MS EXCEL installed on server or on machine which is running 4GL code. Just create a template XLS file with everyting you want like LOGO, colours, heading, footer now replace VALUES with mergemarks like change Total=100$ with Total=%AMT% making sure mergemark name does not conflict with each other create a tiny 4GL to read this template, make a copy and reply mergemarks with datavalues code snippet - CREATE "Excel.Application" chExcelApp. ASSIGN chWorkbook1 = chExcelApp:Workbooks:OPEN(MyXLSTemplate). ASSIGN chWorkSheet1 = chExcelApp:Sheets:ITEM(1). ASSIGN chWorkbook = chExcelApp:Workbooks:ADD. ASSIGN chWorkSheet = chWorkbook:Sheets:ITEM(1). chWorkSheet1:COPY (chWorkSheet). chWorkbook1:CLOSE(NO). ASSIGN chWorkSheet = chWorkbook:Sheets:ITEM(1). ... ... chWorksheet:Range(cRange):VALUE = lcDBValue.

Continue reading...
 
Status
Not open for further replies.
Back
Top