Crystal Report Samsya??

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
 
I

Ignacio Machin \( .NET/ C# MVP \)

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top