I need to output some records to an excel file from Progress - character. I know how to do this to .csv as I can produce a comma delimited file but do not know how to output to an .xls file directly. Any help would be appreciated.
If the Excel document is going to get bigger then a few lines, then I would first make a csv file like you always do and then convert that to Excel and format it the way you like. You can do this by using somthing like:
Code:
IF lp_savexls THEN h-ws:saveAs(REPLACE(cp_file,'csv','xls'),-4143,,,,,,). /* -4143 = xlWorkbookNormal */
NO-RETURN-VALUE h-xl:VISIBLE = NO.
h-ws is the comhandle to the active worksheet....
This way of making Excel will proof to be much an dmuch faster then writing each cell in Excel directly.
Can you create COM handles from a P4GL character client? I was assuming he was looking for one of those utilities (which are a dime a dozen in the Java/C# world) that let you create .XLS's without having access to the Excel runtime.
Can you create COM handles from a P4GL character client? I was assuming he was looking for one of those utilities (which are a dime a dozen in the Java/C# world) that let you create .XLS's without having access to the Excel runtime.
If this is GUI, then you already know the basis (Outputting to CSV).
Output a stream to WhatEverFileName.xls
Let Windows do the hard work for you.
You are only interested in thde data extracted from the database.
Give that data to Windows and let that sort out the formatting.
Its that simple.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.