jacktripper
Programmer
Below is some code that I originally used to view a report in the browser with the Active X component. That worked fine.
Now I want to send it straight to the printer without viewing it. To do this, I just added the report.PrintOut function on the bottom (past all the error checking junk). However, nothing prints out.
What am I missing here? I don't get any error messages either....
Any help would be lovely.
-------------------------
<%@ LANGUAGE="VBSCRIPT" %>
<%
reportname = Request("reportName"

MasterID = Request("MasterID"

%>
<%
If Not IsObject (session("oApp"

Set session("oApp"


End If
Path = Request.ServerVariables("PATH_TRANSLATED"

While (Right(Path, 1) <> "\" And Len(Path) <> 0)
iLen = Len(Path) - 1
Path = Left(Path, iLen)
Wend
If IsObject(session("oRpt"

Set session("oRpt"

End if
On error resume next
Set session("oRpt"


If Err.Number <> 0 Then
Response.Write "Error Occurred creating Report Object: " & Err.Description
Set Session("oRpt"

Set Session("oApp"

Session.Abandon
Response.End
End If
session("oRpt"

session("oRpt"

session("oRpt"

Session("oRpt"



On Error Resume Next
session("oRpt"

If Err.Number <> 0 Then
Response.Write "Error Occurred Reading Records: " & Err.Description
Set Session("oRpt"

Set Session("oApp"

Session.Abandon
Response.End
Else
If IsObject(session("oPageEngine"

set session("oPageEngine"

End If
set session("oPageEngine"


End If
'Sub PrintOut([promptUser], [numberOfCopy], [collated], [startPageN], [stopPageN])
'Member of CRAXDRT.Report
'Prints the report to printer.
Session("oRpt"

%>
<html>
<head>
<title>Window open only for some time</title>
<script>
function closeCall()
{
window.close();
}
function autoCall()
{
setTimeout('closeCall()','1');
}
</script>
<body onLoad="autoCall();">
<p><B><H3>Your reports are now printing. Dance a jig. <BR> Click "Yes" to close this window and return to iDeal</p>
</body>
</html>