简体   繁体   English

发布到服务器Visual Studio 2010时,Crystal报表查看器无法显示

[英]Crystal report viewer is not able to display when publish to server visual studio 2010

i need to ask some question about crystal report. 我需要问一些关于水晶报告的问题。 I have successfully run crystal report locally with visual studio 2010, But when i deploy to the server. 我已经使用Visual Studio 2010在本地成功运行了Crystal Report,但是当我部署到服务器时。 It causes me an error. 它给我一个错误。

The crystal report viewer is no able to display report .It only give me an blank page.By the way I am using window server 2003 and IIS 6. Crystal报表查看器无法显示报表,只能给我一个空白页面,通过使用Window Server 2003和IIS 6。

I also has installed the crystal report run-time on my server. 我还在服务器上安装了Crystal Report运行时。 Did i miss any step for configure? 我错过任何配置步骤了吗? Please guide me with some ideas. 请引导我一些想法。 Thanks 谢谢

Here is my code 这是我的代码

 protected void Page_Load(object sender, EventArgs e)
    {

        CrystalReportViewer1.ReportSource = Server.MapPath("~/Module/Report/CrystalReport1.rpt");
    }

There are a couple of issues that need to be handled: 有几个问题需要处理:

You need to run "Verify Database" on the report again on the server if you are using SQL Server Native Client. 如果您使用的是SQL Server Native Client,则需要在服务器上的报表上再次运行“验证数据库”。

These links may help further: 这些链接可能会进一步帮助:

Crystal reports in ASP.NET ASP.NET中的Crystal报表

Crystal report error (Load report failed) in asp.net asp.net中的水晶报表错误(加载报表失败)

** Edited ** Report not running via IIS but runs well through VS2005 **编辑** 报表无法通过IIS运行,但在VS2005中运行良好

I also remember that I solved the issue after configuring Crystal Reports to run as Local Service instead of Network Service in IIS and also by using Integrated Security = True in connection string. 我还记得在将Crystal Reports配置为在IIS中作为本地服务而不是网络服务运行并且在连接字符串中使用Integrated Security = True之后,我解决了该问题。

I know this is an old post. 我知道这是旧帖子。 but For anyone still looking for the answer: 但对于仍在寻找答案的任何人:

You need to register crystal reports in page markup 您需要在页面标记中注册水晶报表

<% @ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
    Namespace="CrystalDecisions.Web" TagPrefix="CR" %>

Set the property ' Copy to Output Directory' of the report to 'Copy always' 将报表的属性“ 复制到输出目录”设置为“始终复制”

the path of the file in the crystalreportsource will be ~/bin/YOURFOLDER/YOURFILE crystalreportsource中文件的路径将为〜/ bin / YOURFOLDER / YOURFILE

<CR: CrystalReportSource ID ="CrystalReportSource1" runat ="server">
            <Report FileName="~/bin/oilmovement/rptOMDayEnd.rpt">
            </Report>
        </CR: CrystalReportSource>

Now the report should work 现在该报告应该起作用了

There is a workaround. 有一种解决方法。 If you just copy the RPT files from your development machine and replace the published RPT files at server. 如果仅从开发计算机复制RPT文件并替换服务器上已发布的RPT文件。 That will solve the issue. 那将解决问题。

of-course you also need to install the run-time (v13.0 for VS2010, and 13.0.5 for VS2012) 当然,您还需要安装运行时(对于VS2010为v13.0,对于VS2012为13.0.5)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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