Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

JvCoach23

VB.Net newbie

MS Sql Vet

Posted (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 by jvcoach23

JvCoach23

VB.Net newbie

MS Sql Vet

Posted

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

JvCoach23

VB.Net newbie

MS Sql Vet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...