on 02-17-2015 6:05 AM
I am using VS 2012 Ultimate , SAP Crystal Reports 13_0_13 (latest version). The problem is that when i click on crystal report viewer next Page button it goes on loading and never end, i am using the following code.
Protected void btn_Search_Click(object sender, EventArgs e)
{
Session["ReportDocument"]=null;
loadReport(Param1,Param2,param3,Param4);
}
load Report function
private void loadReport(string Param1, string Param2, string Param3,string Param4)
{
CrystalReportViewer1.Visible = true;
ReportDocument reportDocument = new ReportDocument();
string reportPath = Server.MapPath(@"~/VacantAndFilledReports/rpt_vacantposts_HR.rpt");
reportDocument.Load(reportPath);
reportDocument.SetDatabaseLogon(ID, pass, serverName, databaseName);
reportDocument.SetParameterValue("@Param1", Param1);
reportDocument.SetParameterValue("@Param2", Param2);
reportDocument.SetParameterValue("@Param3", Param3);
reportDocument.SetParameterValue("Param4", Param4);
reportDocument.SetParameterValue("Title", FundName);
CrystalReportViewer1.ReuseParameterValuesOnRefresh = true;
CrystalReportViewer1.AutoDataBind = true;
CrystalReportViewer1.Zoom(88);
CrystalReportViewer1.ReportSource = reportDocument;
Session["ReportDocument"] = reportDocument;
}
I have also put the code in Page_Init
protected void Page_Init(object sender, EventArgs e)
{
if (Session["ReportDocument"] != null)
{
//Response.Write("Hello");
ReportDocument doc = (ReportDocument)Session["ReportDocument"];
CrystalReportViewer1.ReportSource = doc;
}
}
I have searched a lot regarding Page Next Button of crystal report viewer but all there was to put code inside Page_Init, i tried as above but did't get the solution and still it is on Page 1 and does not go to Page 2.
Please tell me where i am doing wrong?
See this KBA:
- 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.
Add Session code to keep the report in session and a postback method to tell the report it is in an active session.
Search, there are sample available.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.