Hi All,
Can anyone direct me to any resource or show me, using code in the "afterdialogvalidate", on how to create a button + code that will "export" data from a Free-Form Layout to Excel or Word please?
Note that i am not using a Layout-table type report.
Thanks much!
The code i am using below works in V11 by prompting the user to save the excel (xls) or word (rtf) but in V12 it is not doing that.
Can anyone direct me to any resource or show me, using code in the "afterdialogvalidate", on how to create a button + code that will "export" data from a Free-Form Layout to Excel or Word please?
Note that i am not using a Layout-table type report.
Thanks much!
The code i am using below works in V11 by prompting the user to save the excel (xls) or word (rtf) but in V12 it is not doing that.
Code:
if e.dataSubmitted.ReportType="0" 'PDF filename = a5w_report_saveAs(reportname,"pdf","","",filename,global_variables(),"",null_value(),null_value()) if file.exists(filename) session.SaveDataAsFile(filetitle+".pdf",file.to_blob(filename)) e.url = session.FormatFileDataURL(filetitle+".pdf") + "?" + time("hms3") end if end if if e.dataSubmitted.ReportType="1" 'EXCEL filename = a5w_report_saveAs(reportname,"xls","","",filename,global_variables(),"",null_value(),null_value()) if file.exists(filename) session.SaveDataAsFile(filetitle+".xls",file.to_blob(filename)) e.url = session.FormatFileDataURL(filetitle+".xls") + "?" + time("hms3") end if end if if e.dataSubmitted.ReportType="2" 'WORD filename = a5w_report_saveAs(reportname,"rtf","","",filename,global_variables(),"",null_value(),null_value()) if file.exists(filename) session.SaveDataAsFile(filetitle+".rtf",file.to_blob(filename)) e.url = session.FormatFileDataURL(filetitle+".rtf") + "?" + time("hms3") end if end if
Comment