|
There are three steps to automatically printing a document in ASP.NET from the ActiveX Viewer Control.
- Placing the ActiveX Control on the page as an object. Setting the version to -1,-1,-1,-1 forces Internet Explorer to check for updates each time the page is rendered. Here's the code that goes in the ASPX page:
<OBJECT id=arv codeBase=bin/arview2.cab#version=-1,-1,-1,-1
height=0
width=0
classid=CLSID:8569d715-ff88-44ba-8d1d-ad3e59543dde>
- Loading the data into the report. Set the DataPath of the viewer object. This can be anything from a byte array to a hard coded path:
[DISABLEDSCRIPT]
sub window_onload()
arv.datapath = "temp.rdf"
end sub
- Printing the report. This is done by syncing the LoadCompleted event of the viewer. Inside a call is made to the Viewer's PrintReport method:
sub arv_loadcompleted()
arv.PrintReport False
end sub
[/DISABLEDSCRIPT]
Applies To: ActiveReports for .NET 1.0
|