Click here to Skip to main content
15,918,333 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
C#
protected void Page_Load(object sender, EventArgs e)
   {
   
           Session["GetYear"] = null;

           if (Session["UserName"] == null)
           {
               Response.Redirect("users.aspx");
           }

           else
           {
               lbluser.Text = Session["UserName"].ToString();
               report();
           }
   }

=====================================================
C#
private void report()
    {
        if (!string.IsNullOrEmpty(Request.QueryString["pId"]) && int.TryParse(Request.QueryString["pId"], out checkInt))
        {
            a.UserPrint(lbluser.Text, checkInt);
            a.Updateprint(checkInt);

            DataTable all = a.GetRequestById(checkInt);

            if (all.Rows.Count > 0)
            {
                CrystalDecisions.CrystalReports.Engine.ReportClass rd = new CrystalDecisions.CrystalReports.Engine.ReportClass();

               
                rd.FileName = Server.MapPath("~/Reports/CrystalReport.rpt");

                rd.RecordSelectionFormula = "{Maintenance.Id_Number} = " + checkInt;

                CrystalReportViewer2.ReportSource = rd;
                CrystalReportViewer2.RefreshReport();
            }

        }
    }
Posted
Updated 19-Mar-15 1:50am
v3
Comments
phil.o 19-Mar-15 7:50am    
Not a question, just an unformatted code dump without any explanation.
What is the problem? Where are you stuck?
CHill60 19-Mar-15 7:50am    
What is your question?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900