Friday, April 27, 2012

Save To Excel using HTMLTable!

When saving datawindow to Excel using the Excel! datawindow will just save all the columns to the file and the format you wanted (Headers, Groups..etc ).

You can use HTMLTable! to make it look like excel file.

string        ls_filename, ls_path, ls_describe
long ll_retval

ll_retval = GetFileSaveName ( "Select File", ls_path, ls_filename, "Excel", "Excel (*.xls),*.xls")

if ll_retval <> 1 then return

if UPPER(right(trim(ls_filename),3)) = 'XLS' then
  //Use HTMLTable! instead of Excel but rename the file with an xls extension 
  dw_1.of_saveas("Filename.xls",ls_path, HTMLTable!,TRUE)
end if

No comments:

Post a Comment