Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Open Crystal Report Print Dialog in ASP.NET

Status
Not open for further replies.

pbbgso

Programmer
Mar 7, 2006
1
US
I was trying to figure out how to get the ActiveX Print Control for Crystal
Reports 10 to open when the report is generated in an ASP.NET web form.
Business Objects tech support couldn't even come up with this solution. I'm
using VB.NET in my ASP.NET app. In the Page Load event in my code behind for
the page that has the report viewer control, I put this code:

If Not IsPostBack Then
Dim sJava As String
sJava = "javascript:__doPostBack('CRViewer:_ctl2:_ctl2','');"
RegisterClientScriptBlock("printreport", "<script language=javascript>" +
sJava + "</script>")
End If

This will trigger the ActiveX print control when the page is initially
loaded. After you print the report you can decide what action the page takes
in your code behind. "CRViewer" is the id of the report viewer control on my
page.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top