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(); } }
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(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)