I have a C# project that uses Crystal reports. When running locally, I can navigate normally for reports with more than 2 pages. When running from the web server, it navigates to page 2, but after that, clicking next reloads page 2.
I tried the solutions posted online, moving the code from page_init to page_load, this fixed it on local platform, but not on IIS web server. So I am guessing there is something missing with the Crystal Reports set up on the server.
Saving the report as PDF shows all 3 pages, navigation doesnt show errors or anything, just reloads page 2 again
This is my page_init
protectedvoidPage_Init(object sender,EventArgs e)
{
if(IsPostBack)
{
// RefreshRaportData();
if(Session[REPORT_SESSION]!=null)
{
int exportFormatFlags =(int)(CrystalDecisions.Shared.ViewerExportFormats.PdfFormat|
CrystalDecisions.Shared.ViewerExportFormats.WordFormat|
CrystalDecisions.Shared.ViewerExportFormats.ExcelFormat|
CrystalDecisions.Shared.ViewerExportFormats.RtfFormat);
CrystalReportViewer1.AllowedExportFormats= exportFormatFlags;
CrystalReportViewer1.ReportSource=(ReportDocument)Session[REPORT_SESSION];
CrystalReportViewer1.RefreshReport();
}
return;
}
// set these params only after Server.Transfer
var entry =(ItnMena)PreviousPage;
if(entry !=null)
{
#region set values from previous page
PNROfficeId.Value= entry.PNROfficeIdText;
SignIn.Value= entry.SignInText;
RecLoc.Value= entry.RecLocText;
LastSaveTime.Value= entry.LastSaveTime.ToString("yyyyMMdd HHmm");
FirstPerson.Value= entry.PaxLastNameText;
UserOfficeId.Value= entry.UserOfficeId;
//if (ViewState[FLIGHT_BAGGAGE_ASSOICATION] != null)
//{
// FlightBaggageAssociation[] flightBaggageArray = (FlightBaggageAssociation[])ViewState[FLIGHT_BAGGAGE_ASSOICATION];
// flightBaggageList = new List<FlightBaggageAssociation>(flightBaggageArray);
//}
#endregion
#region reset session values
ClearSession();
#endregion
}