Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 为什么';我的CrystalReportViewer是否显示结果?_Asp.net_C# 4.0_Visual Studio 2012_Crystal Reports_Webpage Rendering - Fatal编程技术网

Asp.net 为什么';我的CrystalReportViewer是否显示结果?

Asp.net 为什么';我的CrystalReportViewer是否显示结果?,asp.net,c#-4.0,visual-studio-2012,crystal-reports,webpage-rendering,Asp.net,C# 4.0,Visual Studio 2012,Crystal Reports,Webpage Rendering,我正试图在ASP.net和C#中开发一个简单的水晶报表。我正在使用CrystalReportViewer加载我的报告。 这是C代码: 问题是我的,CrystalReportViewer没有在浏览器上呈现我的报告,它是一个空白页。虽然没有错误,但可能有什么问题?以下是解决问题的步骤 下载并安装Visual Studio 2010 Crystal Reports 13的运行时。(如果您之前已经执行了此步骤,并且您的应用程序正在本地运行,则可能希望跳过此步骤) 一旦安装了运行时。Crystal Rep

我正试图在
ASP.net
C#
中开发一个简单的水晶报表。我正在使用
CrystalReportViewer
加载我的报告。 这是C代码:


问题是我的,
CrystalReportViewer
没有
在浏览器上呈现
我的报告,它是一个
空白页
。虽然没有错误,但可能有什么问题?

以下是解决问题的步骤

  • 下载并安装Visual Studio 2010 Crystal Reports 13的运行时。(如果您之前已经执行了此步骤,并且您的应用程序正在本地运行,则可能希望跳过此步骤)

  • 一旦安装了运行时。Crystal Reports将在本地计算机的位置安装所需的支持文件: C:\inetpub\wwwroot\aspnet\u client\system\u web\4\u 0\u 30319\crystalreportviewers13

  • 将整个Crystal Report Support文件夹C:\inetpub\wwwroot\aspnet\u client\system\u web\4\u 0\u 30319\Crystal ReportViewers 13复制到网站的SITE\u ROOT\aspnet\u client\system\u web\4\u 0\u 30319文件夹

  • 4) 如果您的网站根目录中没有\aspnet\u client\system\u web\4\u 0\u 30319文件夹。请手动创建它们,然后将crystalreportviewers13复制到其中


    请参阅上文Sain Pradeep所述步骤的本附录

    在Web.Config文件(.Net 4.0及更高版本)中添加以下内容

    
    
    是否已将aspnet\u客户端文件夹放入IIS根目录(C:\inetpub\wwwroot)这是由Visual Studio自动添加到my Web.config中的:)网站项目会自动将其添加到Web.config文件中,但不会添加到Web应用程序项目中
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlConnection con;
        string connString = null;
        connString = "Data Source=.;initial catalog=InvoiceSystem;user id=sa;password=rfm";
        con = new SqlConnection(connString);
        con.Open();
    
        string query = null;
        query = "Select * from tblInvoice";
        SqlDataAdapter da = new SqlDataAdapter(query, con);
        con.Close();
        DataSetInv ds = new DataSetInv();
        da.Fill(ds, "tblInvoice");
        ReportDocument rpt = new ReportDocument();
        rpt.Load(Server.MapPath("~/CrystalReportInv.rpt"));
        rpt.SetDataSource(ds);
        CrystalReportViewer1.ReportSource = rpt;
    }
    
    <configSections>
      <sectionGroup name="businessObjects">
        <sectionGroup name="crystalReports">
          <section name="rptBuildProvider" type="CrystalDecisions.Shared.RptBuildProviderHandler, CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, Custom=null" />
          <section name="crystalReportViewer" type="System.Configuration.NameValueSectionHandler" />
        </sectionGroup>
    
      </sectionGroup>
    </configSections>
    
    <businessObjects>
      <crystalReports>
        <rptBuildProvider>
          <add embedRptInResource="true" />
        </rptBuildProvider>
        <crystalReportViewer>
          <add key="ResourceUri" value="/crystalreportviewers13" />
        </crystalReportViewer>
      </crystalReports>
    </businessObjects>