Esempio n. 1
0
        private void DisplayReport(DataTable dt)
        {
            string periode;

            periode = String.Format("{0} s/d {1}", ((DateTime)rangePeriode.FromDate).ToString("dd/MM/yyyy"), ((DateTime)rangePeriode.ToDate).ToString("dd/MM/yyyy"));

            string reportType = string.Empty;

            reportType = chkLaporan.Checked == true ? "Penjualan.rptLaporanGoodInTransitAuditVersion.rdlc" : "Penjualan.rptLaporanGoodInTransit.rdlc";

            //construct parameter
            List <ReportParameter> rptParams = new List <ReportParameter>();

            rptParams.Add(new ReportParameter("UserID", SecurityManager.UserID));
            rptParams.Add(new ReportParameter("Periode", periode));

            //call report viewer
            frmReportViewer ifrmReport = new frmReportViewer(reportType, rptParams, dt, "dsToko_Data2");

            ifrmReport.ExportToExcelAndSend("Laporan GIT", "Laporan GIT_" + rangePeriode.FromDate.Value.Month.ToString() + "-" + rangePeriode.FromDate.Value.Year.ToString());
            ifrmReport.Show();
        }