Set objCRReport = objCRApp.OpenReport(App.Path & "\ReportMain.rpt", 1)
'加载主报表字段定义文件 Set props = objCRReport.Database.Tables(1).ConnectionProperties For Each prop In props If InStr(prop.Name, "Field Definition File") > 0 Then prop.Value = App.Path & "\Students.ttx" Exit For End If Next Set props = Nothing '给主报表赋值 objCRReport.DiscardSavedData objCRReport.Database.Tables(1).SetDataSource rst1参考这段代码,循环赋值看看
按老兄的办法,我要定义props为什么呀? dim props as new ????? 我的记录源不是表,是一个查询,你上面那段代码我要怎么改呀?
'加载主报表字段定义文件
Set props = objCRReport.Database.Tables(1).ConnectionProperties
For Each prop In props
If InStr(prop.Name, "Field Definition File") > 0 Then
prop.Value = App.Path & "\Students.ttx"
Exit For
End If
Next
Set props = Nothing
'给主报表赋值
objCRReport.DiscardSavedData
objCRReport.Database.Tables(1).SetDataSource rst1参考这段代码,循环赋值看看
dim props as new ?????
我的记录源不是表,是一个查询,你上面那段代码我要怎么改呀?