水晶报表连接 [英] Crystal Report Connection
本文介绍了水晶报表连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的所有人,
我已作了一份准确的报告,请指导我.这样我建立了连接并也使用了一些数据集并运行了报告..
现在我的问题是,如果我将此程序安装在任何其他位置,则需要每次或以其他任何方式以单个命令调整所有数据集和连接的路径的方式来调整路径.
谢谢.
Dear All,
Kindly guide me as I have make a crystal report. In that I made a connection & use some dataset also and run report ok..
Now my question is if I install this progam at any other location we need to adjust the path every time or any other way to adjust the path of all dataset and connection as a single command.
Thanks.
推荐答案
检查
Check this[^] out.
我是Tarun Mangukiya,我在2010年5月遇到了同样的问题.
所以.我如下解决了.
使用此代码
将此行添加到 Class Form1
上方
Hi I am Tarun Mangukiya And I had a same problem in May, 2010.
So. I Solved it as below.
Use This Code
Add this line above the Class Form1
<br />
Imports CrystalDecisions.CrystalReports.Engine<br />
Imports CrystalDecisions.Shared<br />
然后将此行添加到您的报告加载代码中
Then Add this line to your Report On load code
<br />
Dim report As New ReportDocument()<br />
Dim connection As IConnectionInfo<br />
Dim server As String = Application.StartupPath & "\Data.mdb"<br />
report.Load(Application.StartupPath & "\MYReport.rpt")<br />
CrystalReportViewer1.ReportSource = report<br />
For Each connection In report.DataSourceConnections<br />
report.DataSourceConnections(connection.ServerName, connection.DatabaseName).SetConnection(server, "", "", "")<br />
Next<br />
您的问题将得到解决.
谢谢你. :)
And Your Problem will be solved.
Thank you. :)
这篇关于水晶报表连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文