-
November 27th, 2000, 10:52 AM
#1
Crystal Reports - Subreport SQL
I have a Crystal Report that I access from a VB program and I send an SQL statement to the main report, but I also want to send the subreport a different SQL statement to execute.
Do I need to pass it a parameter? Or how would I code it in VB to execute inside the subreport?
Please help! Thanks!
-
November 27th, 2000, 11:02 AM
#2
Re: Crystal Reports - Subreport SQL
Use the SubreportToChange property of the crystal OCX.
Pass it the name of your subreport and then pass your new selection formula.
If you creeated the subreport from within a crystal report then when passing the name leave off the ".rpt". If on the other hand your subreport was an existing crystal report then give it its full extension
-
November 29th, 2000, 03:55 PM
#3
Re: Crystal Reports - Subreport SQL
Do you have an example of how to pass the new SQL to the Subreport?
-
November 30th, 2000, 02:59 AM
#4
Re: Crystal Reports - Subreport SQL
That depends.
I use crystal reports 7 and I use build my reports from an SQL Query.
I use the Selectionformula propety of the Crystal OCX to pass criteria to my reports.
With Crystal1
.ReportFileName = Trim$(GReportLocation) & "config6.RPT"
.SelectionFormula = "{Query.acrft_unique_identifier}=" & Val(cmbUniqueID)
.Destination = 0
.WindowState = crptMaximized
.Connect = "DSN=CMS;uid=sa"
.SubreportToChange = "MyFirstSubReport"
.SelectionFormula ="Whatever"
.SubreportToChange = "mySecondSubreport"
.SelectionFormula ="WHATEVER"
.action=1
End With
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
|