我用水晶报表自带的应用程序做了一个报表,上面添加了些文本(但是空值,我想留带程序运行时再负值)。然后保存成文件OwnershipOfHouse.rpt。这些工作做完后我用VB做了个窗体想用水晶报表的应用对象(Application)直接打开报表,因为我们有限制,就是不准在VB里使用报表设计器。现在遇到的问题是,Report对象不能对后加的文本进行识别,请高手指教。代码如下:
Option Explicit
Private Report As CRAXDRT.Report
Private Sub Form_Load()
Dim AppReport As New CRAXDRT.Application
Dim ReportPath As String
'On Error GoTo ErrorHandle
ReportPath = App.Path + "\OwnershipOfHouse.rpt"
Set Report = AppReport.OpenReport(ReportPath)
'**************设置初值***********************
With Report
    'FirstPage
出错位置:(错误提示:对象不支持该属性或方法)
文本名字:txtCity,它在子报表中。
    .Subreport5_txtCity.SetText "沈"
    .Subreport5_txtSection.SetText "市铁西"
    .Subreport5_txtNumber.SetText "10546"
                 .
                 .
                 .
End With
'************显示报表*************
CRViewer91.ReportSource = Report
CRViewer91.ViewReport
End Sub