I am using vb.net 2005 and have created 2 reports with Crystal. I have the reports showing fine by themselves, but what I want to happen is as follows:
User generates a detail report > user views/prints report > user closes report > summary report opens > user views/prints summary.
I want both reports to use the same CrystalReportViewer/Form, so once the first report is closed, I want the 2nd one to open. Is this possible?
I am not sure how to accomplish this. Any help?Are you pulling directly from a database or are you populating the data programatically?
This is how we do something similar in vb6 so if you use that you can put one in the close event of the form you are loading... As long as you don't allow them to close throug the view and you close on a button on the screen.
Hope this helps..
Rico
'Defines the CRxdrt object as the application
Set mobjApplication = CreateObject("CrystalRuntime.Application.11")
'Opens the defined report
Set mobjReport = mobjApplication.OpenReport(mcReportName, iOPEN_MULTIUSE)
'Sets the datasource of the report
mobjReport.Database.Tables(1).SetDataSource mrsReportData, 3
'Sets the crview object to the report we just opened
crptViewer.ReportSource = mobjReport
'Makes it viewable on the screen
crptViewer.ViewReport|||Is this the right close event?
Private Sub frmDetailSumm_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
'my code to load 2nd report
End Sub
No comments:
Post a Comment