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.
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.