Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need help with a sub report please

Status
Not open for further replies.

mdctsg

MIS
May 26, 2002
102
0
0
US
Hello

I have a main report with a sub report inside. When I am in Crystal Reports I can view the main and the sub reports. When I either compile or try to us VB to view the reports all I can see is the main report. The link is there but I am unable to access the sub

I have fields in the main

Name,state,packages,and cost

In the sub I have

Name,state,deliveredby,packages,cost

I am linking the sub name field to the name field in the main report.

Am I doing this wrong?

Bob
 
You need to set the location of the subreport from VB, as well as the main report. I see you are not having problems with the main report, so here is a blurb about the subreport part...
Set CrystalSections = CrystalReport.Sections

For Each CrystalSection In CrystalSections
Set CrystalReportObjects = CrystalSection.ReportObjects
ObjCount = CrystalReportObjects.Count
For ObjLoopCounter = 1 To ObjCount
If CrystalReportObjects.Item(ObjLoopCounter).Kind = crSubreportObject Then
Set CrystalSubReportObject = CrystalReportObjects.Item(ObjLoopCounter)
Set CrystalSubReport = CrystalSubReportObject.OpenSubreport
End If
Next ObjLoopCounter
Next CrystalSection

Crystal documents this slightly different, but I wouldn't recommend following their dev. help on this, as you'll get an error. The references an object I've yet to find a way to dimension...Also, note this code is from some code I've already updated for version 9 Crystal runtime files, but I think you shouldn't have any trouble with it, as it may be the same in this aspect, but in case you do, let me know, and I'll dig up some 8.5 stuff. LilAmyRae
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top