紧急求助,vb6中如何调用水晶报表9.0

jzd1997 2003-02-25 08:32:27
水晶报表9.0没有象4.6或者8.0那样的crystal reporter control控件,只有crystal viewer control,我就不知道如何调用做好的报表了,请各位指教.
...全文
122 11 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
vicon 2003-03-02
  • 打赏
  • 举报
回复
蹭点分.
hxy2003 2003-02-28
  • 打赏
  • 举报
回复
我也有同样的问题的,被我问啦,哈哈
chenyu5188 2003-02-28
  • 打赏
  • 举报
回复
我来也,不要忘了我。UP
liuxum 2003-02-28
  • 打赏
  • 举报
回复
结贴!哈哈
jzd1997 2003-02-27
  • 打赏
  • 举报
回复
自立更生,搞定了,我的代码如下
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset

Set CrReport = Appl.OpenReport(App.Path & "\rpt_FB0020.rpt") 'Open the Events.rpt report file.
With cnn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Open "D:\work\医師\source\wmdb\KAIINMDB.mdb"
End With
Call rst.Open("FB0020", cnn, adOpenDynamic, adLockReadOnly, adCmdTable)
CrReport.ParameterFields(1).AddCurrentValue "abd"
CrReport.Database.SetDataSource rst
CRViewer91.ReportSource = CrReport 'Sets the Report source of the CrViewer to the Report object we created.


CRViewer91.ViewReport 'View the Report.

jzd1997 2003-02-27
  • 打赏
  • 举报
回复
我用如下方式想动态的设置报表的数据库连接,但是不成功,回答这个问题后我一定给分,谢谢
Private Sub Form_Load()
Dim Pw_MdbFname As String
Dim Pw_AppPath As String
Dim Pw_Ret As String

Pw_AppPath = App.Path
Pw_AppPath = IIf(Right(Pw_AppPath, 1) = "\", Pw_AppPath, Pw_AppPath & "\")
Set CrReport = Appl.OpenReport(Pw_AppPath & "rpt_FB0020.rpt") 'Open the Events.rpt report file.

If Not Gf_Get_Inifile("Path", "KAIINMDB", Pw_Ret) Then GoTo L_FormLoad
Pw_MdbFname = Replace(Pw_Ret, "\MDB", "\WMDB")
Pw_MdbFname = "E:\医師会管理システム\source\FB0020\mdb\KAIIN.MDB"
CrReport.DiscardSavedData
CrReport.Database.SetDataSource (Pw_MdbFname)
CrReport.Database.Verify
CrReport.ParameterFields(1).AddCurrentValue Format(Now, "yy/mm/dd hh:mm:ss")

CRViewer91.ReportSource = CrReport 'Sets the Report source of the CrViewer to the Report object we created.


CRViewer91.ViewReport 'View the Report.
Exit Sub
L_FormLoad:
End Sub
lovepeacer 2003-02-26
  • 打赏
  • 举报
回复
你把报表名附给他
jzd1997 2003-02-26
  • 打赏
  • 举报
回复
难道这个问题真的这么难?とても残念だね
liuxum 2003-02-26
  • 打赏
  • 举报
回复
快给分阿!嘻嘻!
jzd1997 2003-02-26
  • 打赏
  • 举报
回复
谢谢楼上的兄弟了!
liuxum 2003-02-26
  • 打赏
  • 举报
回复
Dim moxReport As CRAXDRT.Report
Dim moxAplication As CRAXDRT.Application

Dim moxData As CRAXDRT.DatabaseTable

Set moxAplication = New CRAXDRT.Application
Set moxReport = moxAplication.OpenReport("E:\jyc040e.rpt")

Call moxReport.DiscardSavedData


For Each moxData In moxReport.Database.Tables
Call moxData.SetLogOnInfo("aplite2", "", "ct00", "nec")
Next
'SQL
moxReport.SQLQueryString = "select * from V_JYC040E WHERE ZYUCHUYMD>='20011101' AND ZYUCHUYMD<'20011201'"
CRViewer1.ReportSource = moxReport
CRViewer1.ViewReport
CRViewer1.Zoom (100)
Set moxAplication = Nothing

808

社区成员

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

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