|
-
Nov 27th, 2007, 10:47 AM
#1
Thread Starter
Frenzied Member
[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.
-
Nov 27th, 2007, 03:48 PM
#2
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
-
Jan 11th, 2008, 04:44 AM
#3
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|