Here is some code to create an export file. How do I get it to display or get a dialog to download the newly created file?
<html>
<head>
<%a5
export_filename = session.session_folder + "c1099.txt"
a_tbl = table.open("c1099")
ON ERROR GOTO ERROR02062009111624437
DIM a5_operation_filter as C
query.filter = ".t."
DIM a5_operation_order as C
query.order = ""
query.options = "I"
query.description = "Temporary Query"
query.Description = "Temporary Query"
i_indx = a_tbl.query_create()
export.type = 1
export.names = .F.
export.file = export_filename
export.options = ""
export.field_sep = ""
export.record_sep = "<CR><LF>"
export.fields = 20
export.field1 = "recordtype"
export.field2 = "numberpayees"
export.field3 = "blank1"
export.field4 = "total1"
export.field5 = "total2"
export.field6 = "total3"
export.field7 = "total4"
export.field8 = "total5"
export.field9 = "total6"
export.field10 = "total7"
export.field11 = "total8"
export.field12 = "total9"
export.field13 = "totala"
export.field14 = "totalb"
export.field15 = "totalc"
export.field16 = "totald"
export.field17 = "totale"
export.field18 = "blank2"
export.field19 = "recordseq"
export.field20 = "blank3"
a_tbl.export()
GOTO CONTINUE02062009111624437
ERROR02062009111624437:
ON ERROR GOTO 0
'ui_msg_box("Error","Error running Export Operation"+crlf()+error_text_get())
END
CONTINUE02062009111624437:
a_tbl.close()
if file.exists(export_filename)
? export_filename + "<br>"
? "here is where I am stuck...how do i get the report to view in browser or get dialog to save on users hard drive?"
end if
%>
<meta name="generator" content="Alpha Five HTML Editor Version 9 Build 2095-3264">
<title></title>
</head>
<body>
<p> </p>
</body></html>
<html>
<head>
<%a5
export_filename = session.session_folder + "c1099.txt"
a_tbl = table.open("c1099")
ON ERROR GOTO ERROR02062009111624437
DIM a5_operation_filter as C
query.filter = ".t."
DIM a5_operation_order as C
query.order = ""
query.options = "I"
query.description = "Temporary Query"
query.Description = "Temporary Query"
i_indx = a_tbl.query_create()
export.type = 1
export.names = .F.
export.file = export_filename
export.options = ""
export.field_sep = ""
export.record_sep = "<CR><LF>"
export.fields = 20
export.field1 = "recordtype"
export.field2 = "numberpayees"
export.field3 = "blank1"
export.field4 = "total1"
export.field5 = "total2"
export.field6 = "total3"
export.field7 = "total4"
export.field8 = "total5"
export.field9 = "total6"
export.field10 = "total7"
export.field11 = "total8"
export.field12 = "total9"
export.field13 = "totala"
export.field14 = "totalb"
export.field15 = "totalc"
export.field16 = "totald"
export.field17 = "totale"
export.field18 = "blank2"
export.field19 = "recordseq"
export.field20 = "blank3"
a_tbl.export()
GOTO CONTINUE02062009111624437
ERROR02062009111624437:
ON ERROR GOTO 0
'ui_msg_box("Error","Error running Export Operation"+crlf()+error_text_get())
END
CONTINUE02062009111624437:
a_tbl.close()
if file.exists(export_filename)
? export_filename + "<br>"
? "here is where I am stuck...how do i get the report to view in browser or get dialog to save on users hard drive?"
end if
%>
<meta name="generator" content="Alpha Five HTML Editor Version 9 Build 2095-3264">
<title></title>
</head>
<body>
<p> </p>
</body></html>
Comment