on 2015 Feb 26 10:19 AM
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
protected void Page_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
}
Request clarification before answering.
Hi Omar,
Moved your post to the .NET SDK forum.
Just want to clarify something, You said you moved your code from the Page_Init to the Page_Load but your code shows it's in the Page_Init section?
It should be in Page_Init.
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great...
OK so what you are doing is correct. Try using Fiddler to see what is happening when you hit page 2 and then 3.
Next try a longer report, one with 5 pages, possibly due to how you have your printers set up and configured in your report it may be when viewing you only have 2 pages.
And check your report in the viewer, do you see all of the data? Or is there missing data?
Try a report with saved data also...
Don
Hi Don,
Thanks for the info, If i have a report with more than 2 pages, and try to save it as PDF, all the pages show up.
I've tried Fiddler, but I am not quite sure yet. I attached two images below of the result after clicking next when already on page 2, one when running from the server (still shows current page as page 2). The second when run locally, from visual studio where it works normally
I have no idea why its working locally but not from the server. Any ideas would be very helpful
User | Count |
---|---|
78 | |
29 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.