本文介绍了在ASP.net网页水晶报表犯规显示器是通过使用VS 2013建立的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用ASP.NET开发一个网站,我想,以显示我的网络表格的报告。我使用水晶报表作为我的报告工具。我使用的Visual Studio 2013作为我的IDE。这是我都试过了。 (我的SAP版本是13.0.9)。

I am developing a website using ASP.NET and I want to display a report in my webform. I am using crystal report as my reporting tool. I am using visual studio 2013 as my IDE. This what I have tried. (My SAP version is to 13.0.9).

private void loadReport()
    {
        ReportDocument rpt = new ReportDocument();
        rpt.Load("D:\\Report_Test.rpt");
        rpt.VerifyDatabase();

        CrystalReportViewer1.ReportSource = rpt;

    }

以上code当我加载页面是空的正常工作与Visual Studio 2010而不是2013年。不扔任何错误。
那么,怎样才能查看使用水晶报表的Visual Studio 2013?

above code works fine with visual studio 2010 but not in 2013. When I load the page it is empty. Not throwing any errors.so, How can view Crystal Report using Visual Studio 2013 ?.

推荐答案

要检查的第一件事是,是否报表查看器客户方的文件都可以,我怀疑这是你的问题(你会发现它静静地抛出一个JavaScript错误!) 。在IIS应该已经创建了一个虚拟目录,如果IIS前preSS,那么你就需要移动手动观众需要的文件,下面应该工作:

The first thing to check,is whether the report viewer clientside files are available, I suspect that's your issue (you may find it's silently throwing a javascript error!). In IIS it should have created a virtual directory, if IIS express, then you'll need to move the files the viewer needs manually, the following should work:

在根目录下创建一个名为crystalreportviewers13文件夹文件夹的应用程序,拷贝文件夹C的内容:\\ Program Files文件(x86)的\\ SAP的BusinessObjects \\水晶报表的.NET Framework 4.0 \\ COMMON \\的Crystal Reports 2011 \\ crystalreportviewers成文件夹(源路径似乎在不同的机器有所不同)。

Create a folder called crystalreportviewers13 folder in the root your application, copy the contents of the folder C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\Crystal Reports 2011\crystalreportviewers into that folder (the source path seems to vary on different machines).

添加到您的web.config的configsections

Add this to the configsections of your web.config

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

然后加入到你的web.config的配置部分

Then add this into the configuration section of your web.config

<businessObjects>
<crystalReports>
  <rptBuildProvider>
    <add embedRptInResource="true" />
  </rptBuildProvider>
  <crystalReportViewer>
    <add key="ResourceUri" value="/crystalreportviewers13" />
   </crystalReportViewer>
</crystalReports>
</businessObjects>

和它应该工作......

And it should work....

我第一次从这里

如果仍然不能显示检查你的web.config是在合适的版本指点。如果你还有问题,再检查文档类型在你的HTML声明 - 我记得它不与HTML5正常工作

If it still doesn't display check your web.config is pointing at the right version. If you've still got problems, then check the doc type in your HTML declaration - as I recall it doesn't work properly with HTML5.

编辑:

在以前版本的Crystal该文件夹我上面提到的将自动复制到C:\\的Inetpub \\ wwwroot的\\的aspnet_client \\ system_web \\ 4_0_30319 - 如果你整个的aspnet_client拷贝到你的应用程序,它解决了问题的根源 - 在以后的水晶的版本我相信,如果你没有运行IIS安装设备时,不会反正创建该文件夹。

In earlier versions of crystal that folder I mentioned above is automatically copied into c:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319 - if you copy the whole aspnet_client into the root of your application that resolved the issue - in the later versions of crystal I believe that if you don't have IIS running when you install it doesn't create that folder anyway.

这篇关于在ASP.net网页水晶报表犯规显示器是通过使用VS 2013建立的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 00:18