Skip to content

Load report failed

kandregula ananth

Asked Apr 4, 2016, 12:30 AM EDT1 answer
Share
LinkedInX
TypeScript
 private void btnsave_Click(object sender, EventArgs e)
        {
             ReportDocument cryRpt = new ReportDocument();
             cryRpt.Load("CrystalReport1.rpt ");
crystalReportViewer1.ReportSource = cryRpt; crystalReportViewer1.Refresh();
            crystalReportViewer1.ReportSource = cryRpt;
            crystalReportViewer1.Refresh();
        }
    }

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    ReportDocument report = new ReportDocument();

    report.Load(Server.MapPath("CrystalReport1.rpt"));
    report.SetDatabaseLogon("dbloginname", "dbpassword", @"servername", "dbname");
    report.SetDataSource(ds);

    CrystalReportViewer1.ReportSource = report;

    Session["ReportSource"] = report;
    ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "window.open('Report.aspx?parameter=Report', '_blank', 'width=2000px,height=900px');", true);
    0