Hi Sathish,
For more info,
I have created my crystal report by using the command in Database expert of crystal report and created my parameters there. I'm not talking parameters from code behind, even it throws error.
My code is,
public partial class Reports_MyCrystalReport: System.Web.UI.Page
{
SqlConnection sqlCon = new SqlConnection(ConfigurationManager.AppSettings["MYAPP"]);
ReportDocument objCrystalReport = new ReportDocument();
string Username = ConfigurationManager.AppSettings["RptUserName"];
string Password = ConfigurationManager.AppSettings["RptPassword"];
protected void Page_Init(object sender, EventArgs e)
{
objCrystalReport.Load(Server.MapPath("MyCrystalReport.rpt"));
objCrystalReport.SetDatabaseLogon(Username, Password, @"DATABASE
SERVER NAME", "DATABASE NAME");
CrystalReportViewer1.ReportSource = objCrystalReport ;
CrystalReportViewer1.DisplayToolbar = true;
CrystalReportViewer1.HasPrintButton = true;
CrystalReportViewer1.HasCrystalLogo = false;
}
protected void Page_Unload(object sender, EventArgs e)
{
objCrystalReport.Close();
objCrystalReport.Dispose();
}
}
I'm a beginner working with crystal report, I'm not pretty sure whether the method i followed is right to create the crystal report, if i had made any wrong please help me on this. And suggest me the best way to achieve it..
Expecting your kind reply,
Thanks in advance,