Results 1 to 3 of 3

Thread: [RESOLVED] Record selection in subreport

  1. #1

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Resolved [RESOLVED] Record selection in subreport

    Hello everybody,

    I need to pass record selection formula from my application to subreport but it goes into the main report and the application blows up saying it cannot find the field. How can I specify that this foruma should go in subreport and not in the main report?

    Thanks.

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Record selection in subreport

    Using the Crystal Reports ActiveX Runtime Library (CRAXDRT - depending on your version) you can access and manipulate a Subreport just as you would the Main report. All you need to do is open the Subreport. Something like.

    Code:
    Option Explicit
    
    Private objCrystalApp As CRAXDRT.Application
    
    Private Sub Command1_Click()
        
        Dim objMainReport As CRAXDRT.Report
        Dim objSubReport As CRAXDRT.Report
        
        Set objMainReport = objCrystalApp.OpenReport("C:\report1.rpt")
        objMainReport.RecordSelectionFormula = "{Customers.CustomerID} = 'WOLZA'"
        
        Set objSubReport = objMainReport.OpenSubreport("Orders")
        objSubReport.RecordSelectionFormula = "{Orders.CustomerID} = 'WOLZA'"
        
        objMainReport.PrintOut
        
    End Sub
    
    Private Sub Form_Load()
        Set objCrystalApp = New CRAXDRT.Application
    End Sub
    
    Private Sub Form_Unload(Cancel As Integer)
        Set objCrystalApp = Nothing
    End Sub

  3. #3
    New Member
    Join Date
    Apr 2007
    Posts
    7

    Re: [RESOLVED] Record selection in subreport

    how can we connect database to this report in runtime..to view current details ?

Posting Permissions

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



Click Here to Expand Forum to Full Width