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 { public partial class rptUserRole : Form { DataTable data1 = null; string sDate = ""; public rptUserRole() { InitializeComponent(); } public void ShowDlg(DataTable dt1, string sDate1) { data1 = dt1.Copy(); sDate = sDate1; this.ShowDialog(); } private void rptUserRole_Load(object sender, EventArgs e) { Payroll.Report.PayrollDataSet.PayrollDataSet.dtUserRoleDataTable dt1 = new Payroll.Report.PayrollDataSet.PayrollDataSet.dtUserRoleDataTable(); List dataSource = new List(); string embeddedResource = "Payroll.Report.RDLC.rUserRole.rdlc"; string caption = "User Role History"; dataSource.Add(new ReportDataSource("PayrollDataSet_dtUserRole",data1)); Cursor.Current = Cursors.WaitCursor; fReportViewer fViewer = new fReportViewer(); sDate = "User role report for month :" + sDate; fViewer.PreviewReport2(dataSource, embeddedResource, caption, sDate); this.Close(); } public void ShowDlgforAudit(DataTable dt1, string param) { Payroll.Report.PayrollDataSet.PayrollDataSet.dtRoleAuditDataTable dtAudit = new Payroll.Report.PayrollDataSet.PayrollDataSet.dtRoleAuditDataTable(); List dataSource = new List(); string embeddedResource = "Payroll.Report.RDLC.rptUserRoleAudit.rdlc"; string caption = "User Role Audit"; dataSource.Add(new ReportDataSource("PayrollDataSet_dtRoleAudit", dt1)); Cursor.Current = Cursors.WaitCursor; fReportViewer fViewer = new fReportViewer(); fViewer.PreviewReport2(dataSource, embeddedResource, caption, param); this.Close(); } } }