The following code is on a .a5w page that is called by a link on a grid. While the report is being emailed, I would like to display something like "Your report is being emailed" while the page is open. It's only open for a few seconds but until it finishes processing, the user is looking at a blank screen. Any ideas?
<%A5
if eval_valid("key_id")
if key_id = ""
goto KeyNotSpecified
end if
' Get email address and server name
dim hr_email as c
dim mail_server as c
hr_email = lookupc("F","01","hremail","sysdef","Dummy_key")
mail_server = lookupc("F","01","mail_server","sysdef","Dummy_key")
dim filter as c
dim order as c
filter = "alltrim(key) = " + quote(alltrim(key_id))
order = ""
dim filename as c
filename = session.session_folder + chr(92) + "tempemail.pdf"
filename = report.saveas("EmployeeAbsenteeForm@[PathAlias.ADB_Path]\employeeabsenceform.ddd","PDF",filter,order,filename,.f.)
if file.exists(filename)
dim pm as P
dim ps as P
if (email_smtp_open(ps, mail_server, 25, "[email protected]", "password")) then
pm.to = hr_email
pm.from = "[email protected]"
pm.subject = "Employee Absentee Form"
pm.message = "See Attachment"
pm.attachments = filename
pm.lRelated = .F.
email_smtp_send(pm, ps)
email_smtp_close(ps)
end if
end if
KeyNotSpecified:
%>
<title>Emails</title></head>
<body class="WinXPPageBODY">
<html>
<head>
<p><font size=5>You did not select a
page to email!</font></p>
</body></html>
<%A5end if%>
<script type="text/javascript" language="javascript">
window.close()
</script>
<%A5
if eval_valid("key_id")
if key_id = ""
goto KeyNotSpecified
end if
' Get email address and server name
dim hr_email as c
dim mail_server as c
hr_email = lookupc("F","01","hremail","sysdef","Dummy_key")
mail_server = lookupc("F","01","mail_server","sysdef","Dummy_key")
dim filter as c
dim order as c
filter = "alltrim(key) = " + quote(alltrim(key_id))
order = ""
dim filename as c
filename = session.session_folder + chr(92) + "tempemail.pdf"
filename = report.saveas("EmployeeAbsenteeForm@[PathAlias.ADB_Path]\employeeabsenceform.ddd","PDF",filter,order,filename,.f.)
if file.exists(filename)
dim pm as P
dim ps as P
if (email_smtp_open(ps, mail_server, 25, "[email protected]", "password")) then
pm.to = hr_email
pm.from = "[email protected]"
pm.subject = "Employee Absentee Form"
pm.message = "See Attachment"
pm.attachments = filename
pm.lRelated = .F.
email_smtp_send(pm, ps)
email_smtp_close(ps)
end if
end if
KeyNotSpecified:
%>
<title>Emails</title></head>
<body class="WinXPPageBODY">
<html>
<head>
<p><font size=5>You did not select a
page to email!</font></p>
</body></html>
<%A5end if%>
<script type="text/javascript" language="javascript">
window.close()
</script>
Comment