Click here to Skip to main content
15,896,496 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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;
Posted
Comments
OriginalGriff 12-Mar-16 3:38am    
Stop reposting the same question just because you haven't had an answer instantly. Particularly if they are just a copy'n'paste of this one.
I have deleted the spare.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900