Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. LOAD REPORT FAIL

LOAD REPORT FAIL

Scheduled Pinned Locked Moved C#
help
5 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mjawadkhatri
    wrote on last edited by
    #1

    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; }

    R T 2 Replies Last reply
    0
    • M mjawadkhatri

      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; }

      R Offline
      R Offline
      Ravi Sant
      wrote on last edited by
      #2

      Please check this, if it makes sense.

      1 Reply Last reply
      0
      • M mjawadkhatri

        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; }

        T Offline
        T Offline
        thatraja
        wrote on last edited by
        #3

        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...
        **

        M 1 Reply Last reply
        0
        • T thatraja

          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...
          **

          M Offline
          M Offline
          mjawadkhatri
          wrote on last edited by
          #4

          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 line CrystalDecisions.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

          T 1 Reply Last reply
          0
          • M mjawadkhatri

            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 line CrystalDecisions.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

            T Offline
            T Offline
            thatraja
            wrote on last edited by
            #5

            :doh: May be try to verify database in report. Confirm the name of the text object. Then try again & let us know.

            thatraja


            **My Tip/Tricks
            My Dad had a Heart Attack on this day so don't...
            **

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups