ASP.Net页面中的CrystalReport Viewer [英] CrystalReport Viewer in ASP.Net pages

查看:85
本文介绍了ASP.Net页面中的CrystalReport Viewer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在ASP.Net页面中使用CrystalReportsViewer控件时遇到阻止程序问题.

我的应用程序ASP.Net网站(使用3.5框架).我们正在使用CrystalReport 2008(内部版本号12.3.0.601.要求是客户将创作他们的报告并上传到我的应用程序.单击执行报告时,我需要生成报告并显示在ASP.Net页面中.

与Crystal Report X1 R2客户端集成时,该页面运行良好.但是,当我们开始使用Crystal Reports 2008 SP3时,我们会体验到您在地球上可以找到的所有问题.我们的应用程序可以部署在IIS6 + WIN2K3和II7 + WIN2K8R2上.两种情况下的结果相同.

现在是实际问题:
当我们执行报告时,我收到错误bobj未定义.我已经在aspx文件中手动添加了对crv.js文件的引用,然后我只能看到工具栏而不是报告数据.但是当我导出报告时,我会获取所有数据.

以下是我的代码:

Hi,

I have a blocker issue while using CrystalReportsViewer control in ASP.Net page.

My application ASP.Net Web Site (using 3.5 Framework). We are using CrystalReport 2008 (Build number 12.3.0.601. Requirement is Customer would get their reports authored and upload to my application. When they click to execute a report I need to generate a report and show in a ASP.Net page.

The page was working perfectly when integrated with Crystal Report X1 R2 client. But when we started using Crystal Reports 2008 SP3, we are experience all the issues that you can find on the Earth. Our application can be deployed on both IIS6 + WIN2K3 and II7 + WIN2K8R2. Result in both the cases is same.

Now the actual problem:
When we executed the report i am getting error bobj undefined. I have manually added reference to crv.js file in my aspx file, then I could see only tool bar not the report data. But when I export the report i am getting all the data.

below is my code:

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

<CR:CrystalReportViewer ID="CrystalReportViewer1"  runat="server" AutoDataBind="true"

                                            BorderColor="#404040" BorderWidth="1px" EnableDatabaseLogonPrompt="False"

                                            EnableParameterPrompt="False" HasCrystalLogo="False" HasDrillUpButton="False"

                                            HasSearchButton="true" HasExportButton="false" EnableDrillDown="False"

                                            HasToggleGroupTreeButton="true" HasPrintButton="false" HasZoomFactorList="true"></CR:CrystalReportViewer>



背后的代码:



Code behind:

ConnectionInfo connInfo = new ConnectionInfo();
connInfo.ServerName = ReportSettings.GetServerName().ToString();
connInfo.DatabaseName = ReportSettings.SYS_RPT_GetDBName().ToString();
connInfo.UserID = ReportSettings.SYS_RPT_GetUserName().ToString();
connInfo.Password = ReportSettings.SYS_RPT_GetPassword().ToString();

rptDoc = new ReportDocument();
rptDoc.Load(strFilePath);

foreach (CrystalDecisions.CrystalReports.Engine.Table tbl in rptDoc.Database.Tables)
{
	TableLogOnInfo repTblLogonInfo = tbl.LogOnInfo;
	repTblLogonInfo.ConnectionInfo = connInfo;
	tbl.ApplyLogOnInfo(repTblLogonInfo);
}

this.CrystalReportViewer1.ReportSource = rptDoc;
CrystalReportViewer1.DataBind();



我可以在测试应用程序中使用相同的代码来生成报告.

以下是我的观察:

-当页面在我的应用程序中呈现时,页面响应中没有引用CRV.JS文件的脚本标签.

-CRViewer呈现的文本添加了js函数调用bobj.crv.writeWidget.仅使用一个参数来传递此函数.因此,即使我手动添加了CRV.JS文件引用,我也只能看到工具栏而不看到实际的报告数据.

请帮忙.

问候,
Shanmukh.



I am able to produce the reports using the same code in a test application.

Following are my observation:

- when the page is rendered in my application, there is no script tag refering CRV.JS file in the page response.

- the CRViewer rendered text adding the js function call bobj.crv.writeWidget. This function is being passed with only one parameter. Hence even i add the CRV.JS file reference manually, i am able see only tool bar not the actual report data.

Please help.

Regards,
Shanmukh.

推荐答案

问题已解决.在页面级别,EnableViewState设置为false.将此页面打开可以解决该问题.
The problem solved. EnableViewState was set to false at the page level. Turning it on for this page resolved the issue.


这篇关于ASP.Net页面中的CrystalReport Viewer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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