using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Microsoft.Reporting.WinForms; namespace Payroll.Report.UI { public partial class rptUsers : Form { DataTable data1 = null; string sDate = ""; public rptUsers() { InitializeComponent(); } public void ShowDlg(DataTable dt1, string sDate1) { sDate = sDate1; data1 = dt1.Copy(); this.ShowDialog(); } private void rptUsers_Load(object sender, EventArgs e) { Payroll.Report.PayrollDataSet.PayrollDataSet.dtUsersDataTable dt1 = new Payroll.Report.PayrollDataSet.PayrollDataSet.dtUsersDataTable(); List dataSource = new List(); string embeddedResource = "Payroll.Report.RDLC.rUsers.rdlc"; string caption = "User History"; dataSource.Add(new ReportDataSource("PayrollDataSet_dtUsers", data1)); Cursor.Current = Cursors.WaitCursor; fReportViewer fViewer = new fReportViewer(); sDate = "User creation report for month :" + sDate; fViewer.PreviewReport2(dataSource, embeddedResource, caption,sDate); this.Close(); } public void ActiveInactiveUsers(DataTable dt1) { data1 = dt1.Copy(); Payroll.Report.PayrollDataSet.PayrollDataSet.activeInactiveUserListDataTable dt3 = new Payroll.Report.PayrollDataSet.PayrollDataSet.activeInactiveUserListDataTable(); List dataSource = new List(); string embeddedResource = "Payroll.Report.RDLC.rActiveUsers.rdlc"; string caption = "User History"; dataSource.Add(new ReportDataSource("PayrollDataSet_activeInactiveUserList", data1)); Cursor.Current = Cursors.WaitCursor; fReportViewer fViewer = new fReportViewer(); sDate = "Active/Inactive User's List "; fViewer.PreviewReport2(dataSource, embeddedResource, caption, sDate); this.Close(); } public void ShowDlgCreation(DataTable dt1, string param) { Payroll.Report.PayrollDataSet.PayrollDataSet.dtUsersDataTable dtAudit = new Payroll.Report.PayrollDataSet.PayrollDataSet.dtUsersDataTable(); List dataSource = new List(); string embeddedResource = "Payroll.Report.RDLC.rUsers.rdlc"; string caption = "User Role Audit"; dataSource.Add(new ReportDataSource("PayrollDataSet_dtUsers", dt1)); Cursor.Current = Cursors.WaitCursor; fReportViewer fViewer = new fReportViewer(); fViewer.PreviewReport2(dataSource, embeddedResource, caption, param); this.Close(); } } }