简体   繁体   中英

To view Crystal Report in ASP.NET C#

I've Crystal reports store on my file-share, Now i want to read that file using Asp.net(C#) webpage. I want to create an exe file so that when user clicks on crystal report stored on file-share, it should get open in browser using my Asp.net(C#) webpage.

So I tried creating simple Asp.net(C#) app to open report from my local machine, I wrote below mentioned code

using System;
using System.Collections;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 using System.Data.SqlClient;
using System.Data;
using System.Configuration;
using System.Web.Configuration;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using CrystalDecisions.Enterprise;
using CrystalDecisions;
using CrystalDecisions.CrystalReports.Engine;
namespace ReadCrystalReport
{
    public partial class _Default : System.Web.UI.Page
{
  protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            ReportDocument r = new ReportDocument();
            r.Load(Server.MapPath("~/CrystalReportViewer1.rpt"));

            CrystalReportViewer1.ReportSource = r;
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
}

But when i run it , I get blank page in browser no error nothing is shown, Could you please help me. I'm using Visual studio 2013 Crystal report runtime V12...(as my reports are created in same version)

Thanks, Ajit Mishra.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM