Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    5

    Unanswered: Passing mulitple recordsets from VB to Crystal Reports

    I have a main report that is working fine. Within this call I need to pass another recordset for the subreport. I am at a loss

    Trayc

  2. #2
    Join Date
    Mar 2004
    Posts
    5

    Re: Passing mulitple recordsets from VB to Crystal Reports

    I should have added....

    Using VB 6.0 to Crystal 8.5

  3. #3
    Join Date
    Mar 2004
    Location
    Pakistan
    Posts
    31
    'Declartion Variables
    Dim CRXSections As CRAXDDRT.Sections
    Dim CRXSection As CRAXDDRT.Section
    Dim subReportObj As CRAXDDRT.SubreportObject

    Dim CRXReportObjects As CRAXDDRT.ReportObjects
    Dim CRXReportObject As Object

    Dim subReport As CRAXDDRT.Report

    Set CRXSections = m_Report.Sections

    For Each CRXSection In CRXSections

    Set CRXReportObjects = CRXSection.ReportObjects

    For Each CRXReportObject In CRXReportObjects

    If CRXReportObject.Kind = crSubreportObject Then
    Set subReportObj = CRXReportObject
    Set subReport = subReportObj.OpenSubreport
    subReport.DiscardSavedData
    'Passing Record set to sub Report
    subReport.Database.SetDataSource rsSubReport
    End If
    'If you are using multiple sub reports in Report then apply anothre check for after

    'CRXReportObject.kind=CrSubreportObject
    'if CRXReportObject.Name="subReport1","subReport2" etc
    Next CRXReportObject

    Next CRXSection
    'This sample is tested in vb6,Crystal Report 9 and code is used of sub Report not Report
    Regards
    Wasim shah

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •