Here’s my code
ReportDocument rptReport = new ReportDocument();
rptReport.Load(Server.MapPath("reports/requestform.rpt"));
clsFunction.strSQL = "SELECT...WHERE reportid='R00069'";
cnDBConnection.ConnectionString = clsFunction.strConnection;
cnDBConnection.Open();
cmReport.Connection = cnDBConnection;
cmReport.CommandText = clsFunction.strSQL;
daReport.SelectCommand = cmReport;
daReport.Fill(dsReport, "requestform");
rptReport.SetDataSource(dsReport);
rptReport.Refresh();
crViewer.RefreshReport();
crViewer.ReportSource = rptReport;
dsReport.Tables["requestform"].Clear();
dsReport.Tables["requestform"].Dispose();
cmReport.Connection.Close();
cnDBConnection.Close();
My query is working properly and the report load successfully. However, in my report it loads all the rows in my tables whereas I specify in my query that it will load a specific report. Can anyone help me please.