Click here to Skip to main content
15,918,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted

Check this[^] out.
 
Share this answer
 
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. :)

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900