LOAD REPORT FAIL
-
hello i face a error when i view report, some time this code is working fine bt some time give me error "LOAD REPORT FAIL" i use blow code please check my code and give me suggestion,
private void BtnGenrate_Click(object sender, EventArgs e) { NomanInternational.Reports.PartyStatementRpt psrpt = new NomanInternational.Reports.PartyStatementRpt(); DateTime start = Convert.ToDateTime(txtdateto.Text); DateTime end = Convert.ToDateTime(txtdatefrom.Text); crystalReportViewer1.ReportSource = psrpt; crystalReportViewer1.SelectionFormula = "{OB.heads}='" + Heads.Text + "' and {Recive.trans_date}>=#" + start.ToShortDateString() + "# and {Recive.trans_date}<=#" + end.ToShortDateString() + "# "; CrystalDecisions.CrystalReports.Engine.TextObject to = (CrystalDecisions.CrystalReports.Engine.TextObject)psrpt.ReportDefinition.Sections["Section1"].ReportObjects["Text12"]; to.Text = txtdateto.Text; }
-
hello i face a error when i view report, some time this code is working fine bt some time give me error "LOAD REPORT FAIL" i use blow code please check my code and give me suggestion,
private void BtnGenrate_Click(object sender, EventArgs e) { NomanInternational.Reports.PartyStatementRpt psrpt = new NomanInternational.Reports.PartyStatementRpt(); DateTime start = Convert.ToDateTime(txtdateto.Text); DateTime end = Convert.ToDateTime(txtdatefrom.Text); crystalReportViewer1.ReportSource = psrpt; crystalReportViewer1.SelectionFormula = "{OB.heads}='" + Heads.Text + "' and {Recive.trans_date}>=#" + start.ToShortDateString() + "# and {Recive.trans_date}<=#" + end.ToShortDateString() + "# "; CrystalDecisions.CrystalReports.Engine.TextObject to = (CrystalDecisions.CrystalReports.Engine.TextObject)psrpt.ReportDefinition.Sections["Section1"].ReportObjects["Text12"]; to.Text = txtdateto.Text; }
-
hello i face a error when i view report, some time this code is working fine bt some time give me error "LOAD REPORT FAIL" i use blow code please check my code and give me suggestion,
private void BtnGenrate_Click(object sender, EventArgs e) { NomanInternational.Reports.PartyStatementRpt psrpt = new NomanInternational.Reports.PartyStatementRpt(); DateTime start = Convert.ToDateTime(txtdateto.Text); DateTime end = Convert.ToDateTime(txtdatefrom.Text); crystalReportViewer1.ReportSource = psrpt; crystalReportViewer1.SelectionFormula = "{OB.heads}='" + Heads.Text + "' and {Recive.trans_date}>=#" + start.ToShortDateString() + "# and {Recive.trans_date}<=#" + end.ToShortDateString() + "# "; CrystalDecisions.CrystalReports.Engine.TextObject to = (CrystalDecisions.CrystalReports.Engine.TextObject)psrpt.ReportDefinition.Sections["Section1"].ReportObjects["Text12"]; to.Text = txtdateto.Text; }
where is the report file name in your code? looks like you didn't assigned the report file to report viewer. So you have missed the below line in your code.
psrpt.Load(@"C:\reportname.rpt");
And also other reasons 1. Ensure the RPT file name is correct. Filename must be a fully qualified valid path name (such as C:\MyApp\MyReport.rpt). 2. The ASPNET account has permissions to open the file. Make sure the folder containing the file and the file itself has the same permissions as your application folder. For more....[^]
thatraja
**My Tip/Tricks
My Dad had a Heart Attack on this day so don't...
** -
where is the report file name in your code? looks like you didn't assigned the report file to report viewer. So you have missed the below line in your code.
psrpt.Load(@"C:\reportname.rpt");
And also other reasons 1. Ensure the RPT file name is correct. Filename must be a fully qualified valid path name (such as C:\MyApp\MyReport.rpt). 2. The ASPNET account has permissions to open the file. Make sure the folder containing the file and the file itself has the same permissions as your application folder. For more....[^]
thatraja
**My Tip/Tricks
My Dad had a Heart Attack on this day so don't...
**My this Code Working Fine
NomanInternational.Reports.PartyStatementRpt psrpt = new NomanInternational.Reports.PartyStatementRpt(); DateTime start = Convert.ToDateTime(txtdateto.Text); DateTime end = Convert.ToDateTime(txtdatefrom.Text); crystalReportViewer1.ReportSource = psrpt; crystalReportViewer1.SelectionFormula = "{OB.heads}='" + Heads.Text + "' and {Recive.trans_date}>=#" + start.ToShortDateString() + "# and {Recive.trans_date}<=#" + end.ToShortDateString() + "# ";
but when i insert this lineCrystalDecisions.CrystalReports.Engine.TextObject to = (CrystalDecisions.CrystalReports.Engine.TextObject)psrpt.ReportDefinition.Sections["GroupHeaderSection1"].ReportObjects["Text13"]; to.Text = Obcr.Text;
Reports show error "Load Report Failed" Please Help Me -
My this Code Working Fine
NomanInternational.Reports.PartyStatementRpt psrpt = new NomanInternational.Reports.PartyStatementRpt(); DateTime start = Convert.ToDateTime(txtdateto.Text); DateTime end = Convert.ToDateTime(txtdatefrom.Text); crystalReportViewer1.ReportSource = psrpt; crystalReportViewer1.SelectionFormula = "{OB.heads}='" + Heads.Text + "' and {Recive.trans_date}>=#" + start.ToShortDateString() + "# and {Recive.trans_date}<=#" + end.ToShortDateString() + "# ";
but when i insert this lineCrystalDecisions.CrystalReports.Engine.TextObject to = (CrystalDecisions.CrystalReports.Engine.TextObject)psrpt.ReportDefinition.Sections["GroupHeaderSection1"].ReportObjects["Text13"]; to.Text = Obcr.Text;
Reports show error "Load Report Failed" Please Help Me