Crystal Report Samsya??

  • Thread starter Thread starter Vivek
  • Start date Start date
V

Vivek

Hi all,
I am working on windows base CSharp application.
I want to use Crystal reports and viewer in my project it works fine through
wizard but after deploying the application database path get changed as I am
using access...

How to set parameters of crystal report dynamically...?

Thanx In Advance
Vivek Kumbhojkar
 
Hi,

Try the code below, it works from a web app using a SQL server, also take a
look at the ConnectionInfo class.



ConnectionInfo crConnectionInfo = new ConnectionInfo();
crConnectionInfo.ServerName = "127.0.0.1";
crConnectionInfo.DatabaseName = "CTP";
crConnectionInfo.UserID = "CTPWeb";
crConnectionInfo.Password = "CTPApp";
foreach (CrystalDecisions.CrystalReports.Engine.Table table in
reportDocument1.Database.Tables)
{
TableLogOnInfo crTableLogonInfo = new TableLogOnInfo();
crTableLogonInfo.TableName = table.Name;
crTableLogonInfo.ConnectionInfo = crConnectionInfo;
crTableLogonInfos.Add( crTableLogonInfo);
table.ApplyLogOnInfo( crTableLogonInfo);

}


Cheers,
 
Back
Top