i have crated a dynamic SP & the results of which i need to bind to rdlc report
usig wizard i tried to create a dataset for binding to rdlc but in that though dataset is created it does not have the field names
how do i create a dataset from code behind & bind to rdlc
the cod ethat i have is
public DataTable GetData()
{
SqlCommand cmd = new SqlCommand("usp_report", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@pYear", drpyrsal.SelectedValue);
cmd.Parameters.AddWithValue("@pMonth", drpmonth.SelectedValue);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
return ds.Tables[0];
}
ReportViewer1.LocalReport.ReportPath = Server.MapPath("reports/PR.rdlc");
ReportDataSource rdS = new ReportDataSource("ds", GetData());
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.LocalReport.DataSources.Add(rdS);