Menu

outputXML

kurt

Purpose: Generate XML-based Excel Spreadsheet quickly from OpenEdge temp-table records using OpenEdge datasets. This procedure is not required to be run on a Microsoft Windows-based OS and correctly produces spreadsheets from Unix ans Linux-base operating systems.

procedure outputXML:
   define input parameter pfile_name as character no-undo.
   define input parameter pxls_no    as integer no-undo.
   define output parameter ptrans_ok as logical initial false no-undo.
   define output parameter perr_msg  as character initial "" no-undo.
end procedure.

Where:
pfile_name is an input parameter as a string value for the absolute or relative pathed Excel Spreadsheet to generate.
pxls_no is an input parameter as an integer value for the specific spreadsheet to export. Multiple spreadsheets can be represented in the temp-tables by using different values of xls_no. outputXML() can then be called for each xls_no to batch the creation of the spreadsheets.
ptrans_ok is an output parameter as a logical value for the success or failure of the procedure.
perr_msg is an output parameter as a character for any error messages when the procedure failes.

Example:

{xls.i}
createSheetWithProperties(1,1,"ExampleSheet","LANDSCAPE=TRUE|FITTOPAGE=1").
createCell(1,1,1,1,"Hello World","BOLD=TRUE|TEXT=TRUE").

run outputXML(input "C:\workspace\example.xml",
             input 1,
             output wtrans_ok,
             output werr_msg).
if not xtrans_ok then do:
   message werr_msg view-as alert-box.error.
   return.
end.

Related

Wiki: Home