Skip to Content
0
Former Member
Jun 19, 2007 at 09:29 AM

How to show view tab Main Report and all of Sub Report in one action through Visual FoxPro

25 Views

How to show all view tab (Main Report and all of Sub Report) in one action.

I already know how to show Main Report with this code sample:

oRptRun=createobject("CrystalRuntime.Application")

oRptView=this.Parent.oleRptViewer

oRptOpen=oRptRun.OpenReport('MyReport.rpt')

oRptView.ReportSource=oRptOpen

oRptView.ViewReport

Inside the 'MyReport.rpt' it has 2 subreports:

1. MySubReport_1

2. MySubReport_2

I try to show MySubReport_1 and MySubReport_2 together with their own Main Report with this code sample:

oRptRun=createobject("CrystalRuntime.Application")

oRptView=this.Parent.oleRptViewer

oRptOpen=oRptRun.OpenReport('MyReport.rpt')

oRptSub1=oRptOpen.OpenSubreport('MySubReport_1')

oRptSub2=oRptOpen.OpenSubreport('MySubReport_2')

oRptView.ReportSource=oRptOpen

oRptView.ViewReport

Did I miss something because there was only view tab 'Preview' (Main Report) shown without view tab MySubReport_1 and MySubReport_2.

Thank you.