|
-
May 24th, 2009, 06:53 AM
#1
Thread Starter
New Member
How to invoke subreport in Crystal Report using ttx
Hi.. Am Creating Crystal Report using Field Definitions Only (ttx)..
When Executing these to invoke main report , there is no issues.. I want to call a sub report
When executing these code there is an shows as Invalid subreport name
Pls help me to solve this error
Dim RptApp As New CRPEAuto.Application
Dim RptFile As CRPEAuto.report
Dim RptSubFile As CRPEAuto.report
Dim mysubreport As SubreportObject
Dim RptFileDB As CRPEAuto.Database
Dim RptTables As DatabaseTables
Dim RptTable As DatabaseTable
Dim RptView As CRPEAuto.View
Dim RptPrntInst As CRPEAuto.PrintWindowOptions
Dim RptSubFileDB As CRPEAuto.Database
Dim RptSubTables As DatabaseTables
Dim RptSubTable As DatabaseTable
Set RptFile = RptApp.OpenReport(STATEMENT_PATH & "\MOVITEXPackingList.Rpt")
''' To invoke Main Report
Set RptFileDB = RptFile.Database
Set RptTables = RptFileDB.Tables
Set RptTable = RptTables.Item(1)
RptTable.SetPrivateData 3, rsPrint ''' Main Report RecordSet
''' To invoke sub report
Set RptSubFile = RptFile.OpenSubreport(STATEMENT_PATH & "\MOVITEXsubPackingList.Rpt")
Set RptSubFileDB = RptSubFile.Database
Set RptSubTables = RptSubFileDB.Tables
Set RptSubTable = RptSubTables.Item(1)
RptSubTable.SetPrivateData 3, rssubPrint '''' Sub Report RecordSet
RptFile.ParameterFields("sBuyerOtherConsignee").SetCurrentValue (sBuyerOtherConsignee)
Set RptPrntInst = RptFile.PrintWindowOptions
RptPrntInst.HasPrintSetupButton = True
Set RptView = RptFile.Preview("MOVITEXPackingList", 0, 0, 800, 600, RptStyle)
RptView.ZoomPreviewWindow (90)
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
|