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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

asking subreport

Status
Not open for further replies.

kohl

Technical User
Oct 28, 2003
1
US
hi dear!!

how to search the subreport name in the report. i've use crepeAuto in my vb programme
 
kohl: You could loop through the ReportObjects collection by item index number and return the name property e.g.
the following code is from the Developer Help under SubReportObject


Class SubreportObject
Dim crystalreport As CRPEAuto.Report
Dim sectsVar As CRPEAuto.Sections
Dim sectVar As CRPEAuto.Section
Dim objs As CRPEAuto.ReportObjects
Dim subObj As CRPEAuto.SubreportObject
Dim test As Integer
Dim crwApplication As CRPEAuto.Application

Private Sub Command1_Click()
'returns the subreport name

test = 1
Set crwApplication = CreateObject("Crystal.CRPE.Application")
Set crystalreport = crwApplication.OpenReport _
("c:\crw\reports\xtreme\wwsales.rpt")
Set sectsVar = crystalreport.Sections
Set sectVar = sectsVar.Item("RF")
Set objs = sectVar.ReportObjects
sortFlds.Add crDescending, "{Customer.Region}"
Set subObj = objs.Item(1)
MsgBox "Name of subreport(autonum.rpt): " & subObj.Name

End Sub David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top