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 rptRolePermission2 : Form { DataTable data1 = null; string sDate = ""; public rptRolePermission2() { InitializeComponent(); } public void ShowDlg(DataTable dt1, string sDate1) { sDate = sDate1; data1 = dt1.Copy(); this.ShowDialog(); } private void rptRolePermission2_Load(object sender, EventArgs e) { Payroll.Report.PayrollDataSet.PayrollDataSet.dtRolePermission2DataTable dt1 = new Payroll.Report.PayrollDataSet.PayrollDataSet.dtRolePermission2DataTable(); List dataSource = new List(); string embeddedResource = "Payroll.Report.RDLC.rptRolePermission2.rdlc"; string caption = "Role Permission"; dataSource.Add(new ReportDataSource("PayrollDataSet_dtRolePermission2", data1)); Cursor.Current = Cursors.WaitCursor; fReportViewer fViewer = new fReportViewer(); //sDate = "User bad login attempt report for month :" + sDate; fViewer.PreviewReport2(dataSource, embeddedResource, caption, sDate); this.Close(); } } }