-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathReportNotActiveIssue.aspx.cs
38 lines (37 loc) · 1.39 KB
/
ReportNotActiveIssue.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using CrystalDecisions.CrystalReports.Engine;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class ReportNotActiveIssue : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
databaseaccesslayer dataobj = new databaseaccesslayer();
if (!IsPostBack)
{
try
{
string sql1 = @"select * from Application_Setting where User_Id=" + Session["Id"] + " and Appl_Id=12 and IsVaild=1";
DataTable dt1 = dataobj.Selectdatatable(sql1);
if (dt1.Rows.Count != 1)
{
Response.Redirect("MainPage.aspx");
}
string sql = @"ReportNotActiveIssue";
ReportDocument reportdocument = new ReportDocument();
reportdocument.Load(Server.MapPath("Reports/ReAllNotActiveIssue.rpt"));
reportdocument.DataSourceConnections[0].SetConnection(".", "Lawer", true);
reportdocument.SetDataSource(dataobj.Selectdatatable(sql));
CrystalReportViewer1.ReportSource = reportdocument;
}
catch (Exception)
{
Response.Redirect("MainPage.aspx");
}
}
}
}