1

I have a crystal report which i call on a button click. The code is as below:

    protected void btnGenerateReport_Click(object sender, EventArgs e)
    {
        List<TBL_InOutLogs> lstOfDetails = (List<TBL_InOutLogs>)Session["InOutlst"];
        DataSet ds = GeneralController.ToDataSet<TBL_InOutLogs>(lstOfDetails);
        string path = Server.MapPath("~/Reports/ReportName.rpt");
        //ds.WriteXmlSchema(path);

        ReportName rpt = new ReportName();
        rpt.Load(path);
        rpt.SetDataSource(ds);

        CrystalReportViewer1.ReportSource = rpt;
        CrystalReportViewer1.Visible = true;
    }

and I store report credentials in session to get report data across post back.

protected void Page_Init(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            if (Session["InOutlst"] != null)
            {
                DataSet ds = GeneralController.ToDataSet<TBL_InOutLogs>((List<TBL_InOutLogs>)Session["InOutlst"]);
                string path = Server.MapPath("~/Reports/ReportName.rpt");

                ReportName.rpt rpt = new ReportName.rpt();
                rpt.Load(path);
                rpt.SetDataSource(ds);
                CrystalReportViewer1.ReportSource = rpt;
                CrystalReportViewer1.Visible = true;
            }
        }
    }

Now when I generate report, every thing works great but if I export this report to pdf or some other format, sessionID gets refreshed. I dont want it to get refreshed. I am using IE 11 and can't check it on any other browser due to my project's limitation. Any solution guys?

Meta-Coder
  • 331
  • 1
  • 3
  • 12
  • 1
    please refer this http://stackoverflow.com/a/2874174/795683 – Sain Pradeep Dec 17 '15 at 05:26
  • This is not my problem. My sessionID remains the same between different request. SessionID gets changed only when Export crystal report. Rest of the requests have same session ID. – Meta-Coder Dec 17 '15 at 05:55

0 Answers0