on 2014 May 02 8:31 PM
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?
Request clarification before answering.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
See if placing the report in session will help:
- Ludek
User | Count |
---|---|
68 | |
33 | |
8 | |
8 | |
7 | |
7 | |
7 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.