Click here to Skip to main content
15,902,634 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
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:
ASP.NET
<%@ 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:

C#
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();


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

1 solution

The problem solved. EnableViewState was set to false at the page level. Turning it on for this page resolved the issue.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900