CEL_Payroll/Payroll.Report/Attendence/UI/fAttendanceReportViewer.cs

45 lines
1.2 KiB
C#
Raw Permalink Normal View History

2024-09-17 14:30:13 +06:00
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.Attendence.UI
{
public partial class fAttendanceReportViewer : Form
{
public fAttendanceReportViewer()
{
InitializeComponent();
}
public void ShowReport(string reportDataSourceName, DataTable dataSourceValue, string rdlcPath, List<ReportParameter> parameters)
{
attnReportViewer.Refresh();
attnReportViewer.LocalReport.DataSources.Clear();
try
{
attnReportViewer.LocalReport.DataSources.Add(new ReportDataSource(reportDataSourceName, dataSourceValue));
attnReportViewer.LocalReport.ReportEmbeddedResource = rdlcPath;
attnReportViewer.LocalReport.SetParameters(parameters);
this.attnReportViewer.RefreshReport();
this.Show();
//this.Focus();
}
catch (Exception ex)
{
throw new Exception(ex.Message, ex);
}
}
}
}