Mohammad Imran

Mohammad Imran

  • 1.9k
  • 76
  • 6.1k

Report in winform

Sep 5 2014 6:07 AM
I want to generate report in winform.
 
I have reportviewer.
I call the report by this function
public void getReportFrmServer(string report, string[] param)
{
try
{
this.reportViewer1.ServerReport.ReportPath = "/Report From_Iris_New/" + report;
this.reportViewer1.ServerReport.Timeout = 3600000;
ReportParameter[] parameter = new ReportParameter[5];
parameter[0] = new ReportParameter("startDate", param[0]);
parameter[1] = new ReportParameter("endDate", param[1]);
parameter[2] = new ReportParameter("contractorName", param[2]);
parameter[3] = new ReportParameter("siteName", param[3]);
parameter[4] = new ReportParameter("FuncName", param[4]);
this.reportViewer1.ServerReport.SetParameters(parameter);
this.reportViewer1.RefreshReport();
}
catch (Exception exception)
{
MessageBox.Show(exception.Message);
}
 
in sql 
 SELECT * FROM BillingReport(@startDate,@endDate,@siteName)
 
 
 It runs fine when I passed short date range like 25/07/2014 to 30/07/2014.
But when I passed date range  like 25/07/2014 to 26/08/2014.
It gives en error 
An error occured during report processing.
Cannot read the next data row for the data set Dataset1.
A severe error occured on the current command. The results, if any, should be discarded.
 
while I run query from Microsoft sql server Management studio report is generated
please suggest me!
 
 
 
 
 

Answers (1)