cancel
Showing results for 
Search instead for 
Did you mean: 

Paging problem with Crystal Report Viewer in VS 2013

Former Member
0 Kudos
449

I am attempting to upgrade a VS 2008 project that uses a dozen plus Crystal Reports to display data for our owners.

The problem that i am having is with navigating to other pages of any multiple page report using the paging buttons of the Report Viewer control. The report will load fine and display the first page. If I try and go to page two an overlay covers the screen and a progress graphic displays and will never go away.  I have to stop debugging the project and restart it.  I have been able to get the paging buttons to work if I click on one of the asp.net buttons that I have added to the page that run the .ShowFirstPage(), .ShowNextPage();.ShowPreviousPage(); or .ShowLastPage(); methods of the ReportViewer control.  When in click on one of these buttons an error displays within the ReportViewer control that reads simply "ERROR". From there I can click on one of the asp.net button described above and the report displays and at this time the navigation buttons work as expected.

The parameters are being set via a series of asp controls and then stored in ViewState then passed to the ParameterFieldInfo of the ReportViewer control.

This all works just fine in VS 2008 project but I have not been able to resolve the paging issue since upgrading.

Does anyone have any ideas as two what may be causing this behavior?

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Make sure you are on Service Pack 9 for SAP Crystal Reports, Developer Version for Visual Studio .NET. If your report load is on page load, move it to page init.

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter

Former Member
0 Kudos

Thanks for your reply.

I am on SP 9.

I moved the block assigning the report source of the ReportViewer to the Page_Init method, but that did not change anything.

The reports are loaded when the user clicks on a link button specifying the report that they wish to view.  In the click event of the button a method is called to set the LogOnInfo for each table of the reportsource;

Tables  tables = reportSource.ReportDocument.Database.Tables;

foreach ( CrystalDecisions.CrystalReports.Engine.Table table in tables ) {

var logonInfo = table.LogOnInfo;

logonInfo.ConnectionInfo = connectionInfo;

table.ApplyLogOnInfo( logonInfo );

Then all the parameters are set;

crvReportViewer.Visible = true;

crvReportViewer.ParameterFieldInfo.Clear();

SetDateValuesForParameterFields();

SetEquipClassValuesForParameterFields();

crvReportViewer.ParameterFieldInfo = paramFields;

crvReportViewer.ParameterFieldInfo.AddRange( equipClassParamFields );

Session[ "CurrentReportSource" ] = crvReportViewer.ReportSource;

Then in the Page_Init I assign the ReportSource of the ReportViewer control;

    if (Session["CurrentReportSourceId"] != null)

{

crvReportViewer.ReportSource = Session["CurrentReportSource"];

}

And in Page_Load;

if ( Page.IsPostBack ) {

                ApplicationSettings appSettings = AppConfigSettings.LoadSettings();

connectionInfo.ServerName = appSettings.PrimarySettings.Server;

connectionInfo.DatabaseName = appSettings.PrimarySettings.DataSource;

connectionInfo.UserID = appSettings.PrimarySettings.UserId;

connectionInfo.Password = appSettings.PrimarySettings.Password;

startDate.Name = "StartDate";

endDate.Name = "EndDate";

trailerNumber.Name = "TrailerNumber";

location.Name = "LocationId";

equipClass.Name = "EquipClass";

txtStartDate.Focus();

}


When in run this the reports will populate and display the first page but if I try to navigate to another page I get a error;


Unhandled exception at line 12, column 82761 in http://localhost:63034/aspnet_client/system_web/4_0_30319/crystalreportviewers13/allInOne.js


0x800a138f - Java Script runtime error: Unable to get property 'length' of undefined or null reference


And on the screen there is a wait spinner.


This all works fine in the VS2008 project.

Thanks,

Shannon

former_member183750
Active Contributor

Answers (0)