急! 在VB中怎样为水晶报表9.2赋值!

han5725 2009-05-29 01:13:45
我在报表Report1.rpt的报表页眉Sections(1)中插入文本对象text14,想在报表时text14显示"维修报表"
用下面语句报错“错误的参数号或无效的属性赋值”
如何给文本对象赋值。

Dim oApp As New CRAXDRT.Application
Dim oRpt As CRAXDRT.Report
Dim reportName As String

If RSA.State = adStateOpen Then RSA.Close
RSA.Open "SELECT * From Repair , dba, adOpenStatic, adLockOptimistic
If RSA.EOF = False And RSA.BOF = False Then
reportName = "\Report1.rpt" '定义要引用的rpt文件
Set oRpt = oApp.OpenReport(App.Path & reportName, 1)
oRpt.Database.SetDataSource RSA, 3, 1 '连接水晶报表和数据源

oRpt.Sections(1).ReportObjects(4).Text = "维修报表"

Viewer91.ReportSource = oRpt '启用水晶报表的预览功能


CRViewer91.ViewReport

End If
...全文
199 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
han5725 2009-05-31
  • 打赏
  • 举报
回复
谢谢,但是水晶报表中没有Label控件。
xzz1008 2009-05-29
  • 打赏
  • 举报
回复
放个 Label1
Me.Sections.Item("Section1").Controls("Label1").Caption = "维修报表"

1,065

社区成员

发帖
与我相关
我的任务
社区描述
VB 资源
社区管理员
  • 资源
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧