Difficulty: Easy

If you want to select some data from a subreport inside a report with a different query provided by a VB6 code, you need to follow the steps below:

  1. Create a report and insert a subreport.
  2. Use a Crystal OCX component in your VB6 form.
  3. Create a CrystalReport object. (i.e: Dim Crystal1 as CrystalReport)
  4. Assign the property SubReportToChange: with this property you can assign values to the subreport you want. (i.e: Crystal1.SubreportToChange = "MySubreport")
  5. Pass the selection formula to the subreport. (i.e: Crystal1.SelectionFormula = "Your query here")
  6. Show your report: use the Action event to show your report and the subreport. (i.e: Crystal1.Action 1)

 

Victor Falsarella Macedo
Average rating: