Openxml Libraries

kirsch59

Member
I would like to create MS EXCEL files (.xlsx) from a CGI program and not use MS Office. I've been using
OpenXML Libraries by DocxFactory. It works well when I use a predefined EXCEL template and a buffer handle.

I would like to be able to have two tables setup in the template. Each table would have it's own data source (buffer handle). Is something like this possible?

The item table in the template uses this procedure call:
run xlsx_replaceLongRange( input "stXlsx",
input buffer Item:handle,
input "ItemNum = Item.ItemNum" +
",ItemName = Item.ItemName", +
",Price = Item.Price" +
",OnHand = Item.OnHand" ,
input "",
input "" ).

I would to use a customer table in the same template with a similar procedure call:
run xlsx_replaceLongRange( input "stXlsx",
input buffer Customer:handle,
input "CustNum = Custmer.CustNum" +
",CustName = Customer.CustName",
input "",
input "" ).




 

joey.jeremiah

ProgressTalk Moderator
Staff member
hello,

in the data source parameter instead of passing a single buffer handle, pass a comma separated list of buffer handles (you can also use temp-tables, queries etc.).

for example: input string( buffer item:handle) + "," + string( buffer customer:handle )

btw i see you're using the same table field and excel column names so the mapping will be done automatically.

hth!
 

kirsch59

Member
How do I pass multiple Named range and buffer field mappings?

How would I pass the following as one parameter?

input "ItemNum = Item.ItemNum" +
",ItemName = Item.ItemName", +
",Price = Item.Price" +
",OnHand = Item.OnHand"

input "CustNum = Custmer.CustNum" +
",CustName = Customer.CustName"

The customer buffer has 1 record and the item buffer has 25 records.
 

kirsch59

Member
When I try passing a comma separated list of buffers:

input string( buffer item:handle) + "," + string( buffer customer:handle ),

I get the following errors in the WebSpeed server log file and the spreadsheet is not populated:


[16/07/20@14:15:18.709-0400] P-003804 T-003324 1 WS -- (Procedure: 'replaceLongRange_getParams c:\Program Files\DocxFactory\progress\slibooxml\slibxlsxext.r' Line:23065) ** ttReplaceField already exists with "Sheet1" 4. (132)

[16/07/20@14:15:18.709-0400] P-003804 T-003324 1 WS -- (Procedure: 'replaceLongRange_getParams c:\Program Files\DocxFactory\progress\slibooxml\slibxlsxext.r' Line:23066) ** ttReplaceField already exists with "Sheet1" 4. (132)

[16/07/20@14:15:18.709-0400] P-003804 T-003324 1 WS -- (Procedure: 'replaceLongRange_getParams c:\Program Files\DocxFactory\progress\slibooxml\slibxlsxext.r' Line:23065) ** ttReplaceField already exists with "Sheet1" 2. (132)

[16/07/20@14:15:18.709-0400] P-003804 T-003324 1 WS -- (Procedure: 'replaceLongRange_getParams c:\Program Files\DocxFactory\progress\slibooxml\slibxlsxext.r' Line:23066) ** ttReplaceField already exists with "Sheet1" 2. (132)


Am I incorrectly passing the data or is there a problem in the code?

Thanks
Mark
 
Top