拜求,关于水晶报表与虚拟表的问题。

wxcjj 2006-03-15 02:34:50
我想要在内存中建一个recordset,然后以这个为水晶报表的数据源,字段是提前定义好的,但就是没有内容显示,请高手指教,万分感谢! 我的代码如下:
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
With rs
.Fields.Append "LotB", adBSTR, 40, , LotB
.Fields.Append "LotA", adBSTR, 40, , LotA
.Fields.Append "OrderID", adBSTR, 40, , OrderID
.Fields.Append "JobOrderID", adBSTR, 40, , JobOrderID
.Fields.Append "Package", adBSTR, 40, , Package
.Fields.Append "DeviceName", adBSTR, 40, , DeviceName
.Fields.Append "CaseID", adBSTR, 40, , CaseID
.Fields.Append "Resin", adBSTR, 40, , Resin
.Fields.Append "OutNumber", adBSTR, 40, , OutNumber
.Fields.Append "Unit", adBSTR, 40, , Unit
.Fields.Append "Number", adBSTR, 40, , Number
.Fields.Append "MoldNumber", adBSTR, 40, , MoldNumber
.Fields.Append "Customer", adBSTR, 40, , Customer
.Fields.Append "OutDate", adBSTR, 40, , OutDate
.Fields.Append "Urgent", adBSTR, 40, , Urgent
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.Open
End With
rs.AddNew
For i = 0 To 14

rs.Fields(i).Value = "dadf"

Next
rs.Update
Report.Database.SetDataSource rs

CRViewer91.ReportSource = Report
CRViewer91.ViewReport
Screen.MousePointer = vbDefault
...全文
49 点赞 收藏 2
写回复
2 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
wxcjj 2006-03-16
试过了,没有用,谢谢

希望有高手可以指教,万分感谢!
回复
xiaoxiaoxuesheng 2006-03-16
可能需要Report.DiscardSavedData,Report.ReadRecords,然后再ViewReport
回复
相关推荐
发帖

1187

社区成员

VB 数据库(包含打印,安装,报表)
申请成为版主
帖子事件
创建了帖子
2006-03-15 02:34
社区公告
暂无公告