Dear Friends,
I designed the crystal reports with dynamic parameter. Crystal report preview report output comes well. but i call from asp .net c#, it makes the following error;
System.Runtime.InteropServices.COMException: The parameter is incorrect.
What I have tried:
DataTable dt;
String SQL = "SELECT DISTINCT [AcYear], [Class], [Section], [RollNo], [StudentName], [FeesCode], [FeesType], [Fees], Sum(PaidFees) as PaidFees, [Fees]-Sum(PaidFees) as [ToBePaid],[InstName],[IAddress],[ICity],[IPin],[IContact],[IEmail] FROM [VwFeesReceiptPrint] WHERE 1=1 and Deleted=0 GROUP BY [AcYear], [Class], [Section], [RollNo], [StudentName], [FeesCode], [FeesType], [Fees],[InstName],[IAddress],[ICity],[IPin],[IContact],[IEmail] ORDER BY FeesCode ASC";
string sConstr = ConfigurationManager.ConnectionStrings["conString"].ConnectionString;
using (SqlConnection conn = new SqlConnection(sConstr))
{
using (SqlCommand comm = new SqlCommand(SQL, conn))
{
conn.Open();
using (SqlDataAdapter da = new SqlDataAdapter(comm))
{
dt = new DataTable("tbl");
da.Fill(dt);
}
}
}
ReportDocument _rdEmp = new ReportDocument();
string reportPath = Server.MapPath("~/Reports/FeesReceiptRpt.rpt");
_rdEmp.Load(reportPath);
_rdEmp.SetDataSource(dt);
FeesReceipt.ReportSource = _rdEmp;