在网络外部提供网页时,Crystal Reports不会呈现 [英] Crystal Reports not rendering when webpage is served outside of network

查看:54
本文介绍了在网络外部提供网页时,Crystal Reports不会呈现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是场景:



Windows Server 2003 SP2



是的,我安装了Crystal Reports Runtime Engine for .NET Framework 4(32位)



我可以看到当我在本地访问Web应用程序时(http://localhost/myApp.aspx),我的所有水晶报表都可以正常呈现,但是当我从网络外部访问应用程序时,我的水晶报告查看器不会渲染水晶报告。我没有得到异常,它只是不渲染。我已经将这个完全相同的Web应用程序部署到其他服务器(包括Windows Server 2003),没有任何障碍。我在绳子的尽头,没有想法。我已经在阳光下尝试了关于虚拟目录的权限,卸载并重新安装CR运行时等等。当然,我已经在网上搜索过了,也许还没有找到合适的石头,你知道这次演习。



帮帮我,codeproject朋友,你是我唯一的希望...



更新:11 / 22/2011:当我从IIS中浏览应用程序时,我收到以下错误:



'Sys.Application'为null或不是对象



URL http://localhost/aspnet_client/system_web/4_0_30319/crystalreportviewers13/crviewer/crv.js

Here's the scenario:

Windows Server 2003 SP2
Hosting ASP.NET web application Framework 4.0 that uses Crystal reports Viewer to render Crystal Reports Version=13.0.2000.0

Yes, I have installed Crystal Reports Runtime Engine for .NET Framework 4 (32-bit)

I can see that all of my crystal reports render just fine when accessing the web application locally (http://localhost/myApp.aspx), but when I access the application from outside of the network, my crystal report viewer will not render the crystal reports. I do not get an exception, it just doesn't render. I have deployed this exact same web application to other servers (including Windows Server 2003) without a hitch. I am at the end of my rope and out of ideas. I have tried everything under the sun regarding permissions to the virtual directory, uninstalling and reinstalling CR Runtime, etc). Of course, I've scoured the web, maybe left the right stone unturned, you know the drill.

Help me, codeproject friends, you're my only hope...

Update: 11/22/2011: When I browse the application from within IIS, I get the following error:

'Sys.Application' is null or not an object

URL http://localhost/aspnet_client/system_web/4_0_30319/crystalreportviewers13/crviewer/crv.js

推荐答案

仍然如果您对此问题有疑问:



1.打开空报告从浏览器呈现的页面。使用dev查找控制台错误。浏览器的工具(f12)



2.你会看到一些与水晶报告有关的脚本和css在正确的文件夹下不存在。



例如:水晶报告寻找v4.XX81,但你手头有v4.xx79。比克隆该文件夹并重命名v4.XX81
Still If you have a problem with this issue:

1. Open the the page that the empty report renders from your browser. Find console errors using dev. tool of your browser (f12)

2. You will see that some of the scripts and css related with crystal reports does not exists under the correct folders.

For example: crystal reports looking for v4.XX81 but you have v4.xx79 on hand. Than make clone of that folder and rename v4.XX81


经过很多麻烦后,我能够解决这个问题。这就是我所做的以及如何解决问题。







我安装了这个。另一个Windows 2008 Small Business上的.NET Web应用程序。不过,这次我做的有点不同了。我不得不使用IIS中的默认网站来创建虚拟目录,而是使用IIS中的创建网站向导来生成新数据库。我选择了框架4集成应用程序池,顺便说一句。我浏览了应用程序,再一次,水晶报表查看器无法正常工作。







其他一些论坛帖子建议更改你的web.config并告诉程序集在哪里找到crystalreportviewer13运行时引擎支持文件。这就是让我了解到底发生了什么。水晶报表查看器不知道如何使用这些脚本文件,css文件等进行渲染。如果找不到这些文件的路径,则无法渲染水晶报表查看器。我的理解是水晶报表查看器依赖于.NET Framework 4的运行时引擎安装文件(32位和64位安装)。这些程序集文件不包含在.NET项目中。我认为这是Visual Studio的巨大疏忽---为什么不包括运行对象所需的所有文件!?!?抱歉,无论如何,这就是我所做的一切:







1)转到C\inetpub任何具有/或水晶报告运行时引擎安装的计算机上的\ http://wwwroot文件夹。为了我的目的,我只是去了我正在安装的2008服务器上的那个。



2)复制wwwroot目录中的aspnet_client文件夹。



3)将此文件夹粘贴到网站目录文件夹中。我假设这适用于从虚拟目录创建的Web应用程序,只需将其粘贴到虚拟目录中。







您可以通过创建所有必需的文件夹和子文件夹,然后将每个文件复制到开发计算机上的Web应用程序项目中来避免这种情况,以便将它们包含在已发布的文件中,遵守网络应用程序。如果这令人困惑,只需在部署环境中执行上述步骤。



这是我在SAP上的论坛帖子:

After a lot of headaches, I was able to resolve this issue. This is what I did and how I got the issue resolved.



I installed this same .NET web application on another Windows 2008 Small Business. I did it a little differently this time, though. Instead of using the default web site in IIS for the creation of a virtual directory, I had to use the Create Web Site Wizard in IIS to generate a new database. I chose framework 4 integrated application pool, btw. I browsed to the application and once again, the crystal report viewer would not work.



Some other forum threads suggested changing your web.config and essentially telling the assembly where to find the crystalreportviewer13 runtime engine support files. This is what clued me into what exactly is going on. The crystal report viewer doesn't know how to render with out these script files, css files, etc. If it can't find the path to these files, it can't render the crystal report viewer. How I understand it is the crystal report viewer is dependent upon the runtime engine installation files for .NET Framework 4 (32 & 64 bit installs). These assembly files don't get included in your .NET project. I think that is a HUGE oversight by Visual Studio --- why not include ALL files required to run your object!?!? Sorry, anyway, here's all I did:



1) Go to the C\inetpub\wwwroot folder on any machine that has either/or crystal report runtime engine installations. For my purposes, I just went to the one on the 2008 server I'm installing on.

2) Copy the aspnet_client folder in the wwwroot directory.

3) Paste this folder in the website directory folder. I assume this would work with a web application that was created from a virtual directory as well, just paste it into the virtual directory.



You may be able to avoid this by creating all of the necessary folders and sub folders, then copying over each file into your web application project on your development machine, in order to include them in your published, complied web application. If this is confusing, just perform the steps above in the deployment environment.

Here's my forum post on SAP:


当您向网站添加Ajax Toolkit组件时,如DLL和实际控件及其编译好,但是当你渲染页面时,你没有动作和javascript错误。要解决此问题,您需要在web.config的httpHandlers部分添加引用。

When you are adding Ajax Toolkit components to your website, like DLLs and the actual controls and it compiles ok but when you render the page you get no action and a javascript error. To resolve it, you need to add references at httpHandlers section in web.config.
<httpHandlers>
 <remove verb="*" path="*.asmx"/>
 <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
 <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>
<httpModules>
 <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</httpModules>


这篇关于在网络外部提供网页时,Crystal Reports不会呈现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆