Hi Friends
I have one doubut how to Changing the Datasource at runtime using Crystal Report . and MSAccess connection using the oledb connection please sent me the coding .i want to get the details of data from database to crystalreport and call the crystal report from c#.
Loading

Mukesh Kumar TiwariPosted Dec 20, 2013, 1:56 AM
Conn = new SqlConnection(ConnString);
if (Conn.State == ConnectionState.Closed)
{
Conn.Open();
}
Cmd = new SqlCommand("[OAF_Final_Print_cristal_Report]", Conn);
Cmd.CommandType = CommandType.StoredProcedure;
Cmd.Parameters.AddWithValue("@cust_id", cmb_customer.SelectedValue);
Cmd.Parameters.AddWithValue("@order_no", txt_order_no.Text);
Adp = new SqlDataAdapter(Cmd);
DataSet ds = new DataSet();
DataTable dt = new DataTable();
Adp.Fill(ds);
dt = ds.Tables[0];
Conn.Close();
rpt.SetDataSource(dt);
crystalReportViewer1.ReportSource = rpt;
crystalReportViewer1.Refresh();