jvcoach23 Posted March 3, 2005 Posted March 3, 2005 I have report and a subreport. I need to use dataset1 for the report.. and dataset2 for the subreport. the data is not linked. how do I code that. I've used 1 dataset before doing this Dim myReport as new CrystalReport1 myReport.SetDataSource(ds) CrystalReportViewer1.REportSource=myReport but how do you do these for two datasets Thanks Shannon Quote JvCoach23 VB.Net newbie MS Sql Vet
pendragon Posted March 3, 2005 Posted March 3, 2005 crReportDocument.OpenSubreport("Report Name").Database.Tables[0].SetDataSource(dataset2); [/Code] Quote
jvcoach23 Posted March 3, 2005 Author Posted March 3, 2005 great.. thanks.. I'll give it a go Quote JvCoach23 VB.Net newbie MS Sql Vet
jvcoach23 Posted March 3, 2005 Author Posted March 3, 2005 (edited) crReportDocument.OpenSubreport("Report Name").Database.Tables[0].SetDataSource(dataset2); [/Code] I'll keep working on it.. but here is what I have and I'm getting an error. Unhandled Exception: CrystalDecisions.CrystalReports.Engine.LoadSaveReportException: Load report failed. at �.�I(String ��, EngineExceptionErrorID ��) at �.�E(String ��, Int32 ��) [code=visualbasic] Dim myReport As New crJobListSingle myReport.SetDataSource(dsAccountListSingle) myReport.OpenSubreport("crJobListingleSubJob").Database.Tables(0).SetDataSource(dsJobSingleJob) I've also tried this. and still no go Dim myReport As New crJobListSingle Dim mySubReport As CrystalDecisions.CrystalReports.Engine.ReportDocument Try mySubReport = myReport.OpenSubreport("crJobListingSubJob") mySubReport.SetDataSource(dsJobSingleJob) 'myReport.OpenSubreport("crJobListingleSubJob").SetDataSource(dsJobSingleJob) myReport.SetDataSource(dsAccountListSingle) Me.CrystalReportViewer1.ReportSource = myReport Catch ex As CrystalDecisions.CrystalReports.Engine.EngineException Throw ex End Try I am getting the error on trying to open the sub report. Please advise. thanks shannon Me.CrystalReportViewer1.ReportSource = myReport Edited March 3, 2005 by jvcoach23 Quote JvCoach23 VB.Net newbie MS Sql Vet
jvcoach23 Posted March 3, 2005 Author Posted March 3, 2005 got it.. did a copy and paste of the subreport name and I think that did it. Dim myReport As New crJobListSingle Dim mySubReport As CrystalDecisions.CrystalReports.Engine.ReportDocument Try mySubReport = myReport.OpenSubreport("crJobListsSingleSubJob") mySubReport.SetDataSource(dsJobSingleJob) 'myReport.OpenSubreport("crJobListingleSubJob").SetDataSource(dsJobSingleJob) myReport.SetDataSource(dsAccountListSingle) Me.CrystalReportViewer1.ReportSource = myReport Catch ex As CrystalDecisions.CrystalReports.Engine.EngineException Throw ex End Try Quote JvCoach23 VB.Net newbie MS Sql Vet
pendragon Posted March 4, 2005 Posted March 4, 2005 It would be nice if Crystal reports came back with a better error ie Sub report not Found :rolleyes: O'Well can't have everything Glad to be of help Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.