I 'm generating crystal report its working
my requirement is, only particular data's to be display in the report there i 'm passing sql query
but it displays full dataset, it not short listed according to the given query
for me it should display only particular data and that data alone to be export to pdf
how to complete this task
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = null;
con = new SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ConnectionString);
SqlDataAdapter da = new SqlDataAdapter("select * from test where batch='" + DDL2.SelectedItem.Text + "'and month='" + DDL1.SelectedItem.Text + "'",con);
DataSet ds = new DataSet();
da.Fill(ds);
ReportDocument rptdoc = new ReportDocument();
rptdoc.Load(Server.MapPath("~/crystalreport3.rpt"));
rptdoc.SetDataSource(ds.Tables[0]);
CrystalReportViewer1.ReportSource = rptdoc;
CrystalReportViewer1.DataBind();
CrystalReportViewer1.RefreshReport();
}
SATHIYANARAYANAN