PB export data Excel format dw2xls
Use the dw2xls Control
Syntax
Uf_save_dw_as_excel (DW, filename)
Parameters
DW a reference to the datawindow object
Filename a string whose value is the name of the file you want to create. If filename is not on the operating system's search path, you must enter the fully qualified name.
Return Value
Integer. Returns 1 if it succeeds and-1 if an error occurs.
Example
integer li_retli_ret = uf_save_dw_as_excel(dw_1, 'c:\doc\report.xls')if li_ret = 1 then //success //...else //fail //...end if
My actual example
First, migrate dw2xls
Interface
Related code
Export result
What's more
Uf_save_dw_as_excel_parm () function
Converts datawindow into Excel file. Allows to specify some options for process of converting.
Syntax
Uf_save_dw_as_excel_parm (DW, filename, parm)
Parameters
DW a reference to the datawindow object
Filename a string whose value is the name of the file you want to create. If filename is not on the operating system's search path, you must enter the fully qualified name
Parm a reference to the n_dwr_service_parm object which contain a set of parameters for process of converting
Return Value
Integer. Returns 1 if it succeeds and-1 if an error occurs.
Example
// Export using parametersinteger condition = create condition = false // skip header band has no header line lnvo_parm.ib_summary = false // skip summary band lnvo_parm.ib_footer = false // skip footer band Limit = false/ /skip all group headers lnvo_parm.ib_group_trailer = false // skip all group trailers li_ret = uf_save_dw_as_excel_parm (dw_1, 'C: \ doc \ report.xls ', lnvo_parm) If li_ret = 1 then // success //... else // fail //... end if
The test is not successful. The version may be incorrect.
Is_header_text does not have this method
// adding a header to generated XLSinteger li_retn_dwr_service_parm lnvo_parmlnvo_parm = create n_dwr_service_parmlnvo_parm.is_header_text = "Report"lnvo_parm.ib_header_font_underline = Trueli_ret = uf_save_dw_as_excel_parm(dw_1, 'c:\doc\report.xls', lnvo_parm)if li_ret = 1 then //success //...else //fail //...end if