crystal report

How can we dynamically bind dataset in crystal report at run time plz help.



3 Replies

PJ Poornima Joy Balan Syncfusion Team October 8, 2007 05:52 AM UTC

Hello,

Here's the code snippet to dynamically bind dataset in crystal report at run time.

String connString = @"Provider=SQLOLEDB.1;User ID=yourid;Password=yourpassword;Persist Security Info=True;Network Address=yourIP;Initial Catalog=databasename";
OleDbConnection conn = new OleDbConnection(connString);
conn.Open();
string query = "SELECT * from table";
OleDbDataAdapter myDataAdapter = new OleDbDataAdapter(query, conn);
DataSet dataReport = new DataSet();
myDataAdapter.Fill(dataReport);


CrystalReport1 rep = new CrystalReport1();
rep.SetDataSource(dataReport);
crystalReportViewer1.ReportSource = rep;

Let me know, any further queries.

Regards,
Poornima




AD Administrator Syncfusion Team February 4, 2009 05:37 PM UTC



hai attaching dataset to report ok but in report i dint added any table i wil not get data .i should add same tables which i specified in select statment and should i drag feilds which i want?
i want clarity what ur saying plz tell



AD Administrator Syncfusion Team February 4, 2009 05:38 PM UTC



hai attaching dataset to report ok but in report i dint added any table i wil not get data .i should add same tables which i specified in select statment and should i drag feilds which i want?
i want clarity what ur saying plz tell


Loader.
Up arrow icon