private void btnPrintAll_Click(object sender, EventArgs e)
        {
            if (ListPurchasing == null || ListPurchasing.Count == 0)
            {
                this.ShowInformation("Data Purchasing tidak ada");
                return;
            }

            try
            {
                List <RecapPurchasingItemViewModel> reportDataSource = ListPurchasing;

                string supplier = (lookupSupplier.GetSelectedDataRow() as SupplierViewModel).Name;
                RecapPurchasingBySupplierPrintItem report = new RecapPurchasingBySupplierPrintItem(supplier, DateFrom, DateTo);
                report.DataSource = reportDataSource;
                report.FillDataSource();

                using (ReportPrintTool printTool = new ReportPrintTool(report))
                {
                    printTool.PrintDialog();
                }
            }
            catch (Exception ex)
            {
                MethodBase.GetCurrentMethod().Fatal("An error occured while trying to print recap purchasing", ex);
                this.ShowError("Print recap purchasing Gagal! Hubungi Developer.");
            }
        }
        private void btn打印_Click(object sender, EventArgs e)
        {
            ReportPrintTool tool = new ReportPrintTool(report);

            tool.PrintDialog();
            //report.ExportToRtf("1.doc");
        }
Exemplo n.º 3
0
 private void btnPrint_Click(object sender, EventArgs e)
 {
     ReportPrintTool pt = new ReportPrintTool(billReportView);
     pt.PrintingSystem.StartPrint +=
         new PrintDocumentEventHandler(printingSystem_StartPrint);
     pt.PrintDialog();
 }
Exemplo n.º 4
0
        private void LoadDataToReport()
        {
            DataSet        ds      = new DataSet();
            String         connStr = ScaleApp.Common.DataOperation.GetConnectionString(1);
            SqlConnection  conn    = new SqlConnection(connStr);
            SqlDataAdapter SqlDa   = new SqlDataAdapter();
            SqlCommand     sqlcmd  = new SqlCommand("sp_getFullCrushRaw2", conn);

            try
            {
                sqlcmd.CommandType = CommandType.StoredProcedure;
                sqlcmd.Parameters.AddWithValue("@crushRawId", MixID);
                SqlDa.SelectCommand = sqlcmd;
                SqlDa.Fill(ds);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            ScaleApp.Common.DataOperation.disconnect();

            var rptRe = new rptCrushed();

            rptRe.DataSource = ds;
            rptRe.CreateDocument();
            ReportPrintTool printToolCrush = new ReportPrintTool(rptRe);

            printToolCrush.PrintDialog();
            //documentViewer1.DocumentSource = rptRe;
        }
Exemplo n.º 5
0
        private void button1_Click(object sender, EventArgs e)
        {
            XtraReport1 report1 = new XtraReport1();

            XtraReport[] reports = new XtraReport[] { new XtraReport2(), new XtraReport3() };

            ReportPrintTool pt1 = new ReportPrintTool(report1);

            pt1.PrintingSystem.StartPrint += new PrintDocumentEventHandler(PrintingSystem_StartPrint);

            foreach (XtraReport report in reports)
            {
                ReportPrintTool pts = new ReportPrintTool(report);
                pts.PrintingSystem.StartPrint += new PrintDocumentEventHandler(reportsStartPrintEventHandler);
            }

            if (pt1.PrintDialog() == true)
            {
                foreach (XtraReport report in reports)
                {
                    ReportPrintTool pts = new ReportPrintTool(report);
                    pts.Print();
                }
            }
        }
Exemplo n.º 6
0
 private void settingsControl_PrintOptionsClick(object sender, EventArgs e)
 {
     using (var tool = new ReportPrintTool(report)) {
         System.Windows.Forms.Form form = FindForm();
         tool.PrintDialog(FindForm(), LookAndFeel);
     }
 }
        private void button1_Click(object sender, EventArgs e)
        {
            ReportPrintTool pt = new ReportPrintTool(new XtraReport1());

            pt.PrintingSystem.StartPrint +=
                new PrintDocumentEventHandler(printingSystem_StartPrint);
            pt.PrintDialog();
        }
Exemplo n.º 8
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            ReportPrintTool pt = new ReportPrintTool(billReportView);

            pt.PrintingSystem.StartPrint +=
                new PrintDocumentEventHandler(printingSystem_StartPrint);
            pt.PrintDialog();
        }
Exemplo n.º 9
0
        private void SendToPrint()
        {
            var             rpt       = new rptMixing();
            ReportPrintTool printTool = new ReportPrintTool(rpt);

            printTool.PrintDialog();
            // Send the report to the specified printer.
            //printTool.Print("Canon B&W");
        }
Exemplo n.º 10
0
 private void btnPrint_Click(object sender, EventArgs e)
 {
     using (ReportPrintTool printTool = new ReportPrintTool(rpt))
     {
         //printTool.Print();
         printTool.PrintDialog();
         btnClose.PerformClick();
     }
 }
        private void bandedGridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            MonthlyWageLoanItem item = bandedGridView1.GetRow(bandedGridView1.FocusedRowHandle) as MonthlyWageLoanItem;

            if (item != null && e.Column.Caption == "打印")
            {
                WageLoanVoucher report = new WageLoanVoucher(item);
                ReportPrintTool tool   = new ReportPrintTool(report);
                tool.PrintDialog();
            }
        }
        private void Report_Print_Preview(string action)
        {
            XtraReport_EmployeeAttendance Xtra_Report_EmployeeAttendanceList = new XtraReport_EmployeeAttendance();

            DynamicParameters paramSalary = new DynamicParameters();

            paramSalary.Add("@Emp_Code_Processing", txtEmpCode.EditValue);
            paramSalary.Add("@Salary_Month", DtStartDate.EditValue);
            paramSalary.Add("@Deduct_Advance", 1);
            paramSalary.Add("@Deduct_Loan", 1);
            paramSalary.Add("@TeaRate", 0);
            paramSalary.Add("@NoOfCups", 0);


            DynamicParameters param = new DynamicParameters();

            param.Add("@EmpCode", txtEmpCode.EditValue);
            param.Add("@Attendance_Month", DtStartDate.EditValue);

            DynamicParameters paramEmp = new DynamicParameters();

            paramEmp.Add("@EmpCode", txtEmpCode.EditValue);

            ProgramMasterModel programMaster = ProgramMasterData.GetProgramMasterModel(GlobalVariables.ProgCode);



            EmployeeAttendanceDetails_Model employeeAttendanceDetails_Model = new EmployeeAttendanceDetails_Model
            {
                EmpCode                     = txtEmpCode.EditValue + string.Empty,
                AttendanceMonth             = ConvertTo.DateTimeVal(DtStartDate.EditValue),
                EmployeeAttendance_Get_List = EmployeeData.EmployeeAttendance_Get(programMaster.ProgProcName + "_v2", param),
                EmployeesSalaryList         = EmployeeData.GetEmployeesSalaryList("sp_Salary_Process", paramSalary),
                EmployeeMasterDataList      = EmployeeData.GetEmployeeMasterDataList("sp_LoadEmpMstFEditing", paramEmp)
            };

            //EmployeeMasterModel
            attendanceBindingSource.DataSource = employeeAttendanceDetails_Model;

            Xtra_Report_EmployeeAttendanceList.DataSource = attendanceBindingSource;

            //MessageBox.Show(employeeAttendanceDetails_Model.EmployeesSalaryList.Count + "");

            ReportPrintTool tool = new ReportPrintTool(Xtra_Report_EmployeeAttendanceList);

            if (action.Equals("preview"))
            {
                tool.ShowRibbonPreviewDialog();
            }
            if (action.Equals("print"))
            {
                tool.PrintDialog();
            }
        }
Exemplo n.º 13
0
        private void btnGunlukSatisCikti_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            SatisRapor report = new SatisRapor();

            report.DataSource = new SatisRepo().SatisRaporu();

            using (ReportPrintTool printTool = new ReportPrintTool(report))
            {
                printTool.PrintDialog();
            }
        }
Exemplo n.º 14
0
        public void PrintDialog()
        {
            RequestParameters = false;

            CreateDocument();

            using (var printTool = new ReportPrintTool(this))
            {
                printTool.PrintDialog();
            }
        }
Exemplo n.º 15
0
        private void button5_Click(object sender, RoutedEventArgs e)
        {
            ReportAfleverEtiket report = new ReportAfleverEtiket();

            report.CreateDocument();
            //   report.PrinterName = LocalPrintServer.GetDefaultPrintQueue().Name;

            using (ReportPrintTool printTool = new ReportPrintTool(report))
            {
                printTool.PrintDialog();
            }
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            FIFOSparepartStockCardPrintItem report = new FIFOSparepartStockCardPrintItem(DateFromFilter, DateToFilter, SelectedSparepart.Name);

            report.DataSource = ListStockCard;
            report.FillDataSource();

            using (ReportPrintTool printTool = new ReportPrintTool(report))
            {
                printTool.PrintDialog();
            }
        }
        private void bgwSave_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
        {
            try
            {
                _presenter.SaveChanges();
                if (this.IsNeedApproval)
                {
                    _presenter.SendApproval();
                }
                else
                {
                    List <SPKViewModel> _dataSource = new List <SPKViewModel>();
                    _dataSource.Add(SelectedSPK);

                    if (isContractWork)
                    {
                        SPKContractPrintItem report = new SPKContractPrintItem();
                        report.DataSource = _dataSource;
                        report.FillDataSource();
                        if (!this.IsSPKSales)
                        {
                            _presenter.Print();
                            using (ReportPrintTool printTool = new ReportPrintTool(report))
                            {
                                // Invoke the Print dialog.
                                printTool.PrintDialog();
                            }
                        }
                    }
                    else
                    {
                        SPKPrintItem report = new SPKPrintItem();
                        report.DataSource = _dataSource;
                        report.FillDataSource();
                        if (!this.IsSPKSales)
                        {
                            _presenter.Print();
                            using (ReportPrintTool printTool = new ReportPrintTool(report))
                            {
                                // Invoke the Print dialog.
                                printTool.PrintDialog();
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MethodBase.GetCurrentMethod().Fatal("An error occured while trying to save spk with vehicleID: '" + this.VehicleId + "'", ex);
                e.Result = ex;
            }
        }
Exemplo n.º 18
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            BalanceJournalPrintItem report = new BalanceJournalPrintItem(SelectedYear, SelectedMonth);

            report.DataSource = BalanceJournalDetailList;
            report.FillDataSource();

            using (ReportPrintTool printTool = new ReportPrintTool(report))
            {
                // Invoke the Print dialog.
                printTool.PrintDialog();
            }
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            ProfitLossPrintItem report = new ProfitLossPrintItem(SelectedYear, SelectedMonth);

            report.DataSource = ProfitLossList;
            report.FillDataSource();

            using (ReportPrintTool printTool = new ReportPrintTool(report))
            {
                // Invoke the Print dialog.
                printTool.PrintDialog();
            }
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            BalanceHelperPrintItem report = new BalanceHelperPrintItem(SelectedYear, SelectedMonth, (lookUpFilterJournal.GetSelectedDataRow() as JournalMasterViewModel).Name);

            report.DataSource = ListHelper;
            report.FillDataSource();

            using (ReportPrintTool printTool = new ReportPrintTool(report))
            {
                // Invoke the Print dialog.
                printTool.PrintDialog();
            }
        }
Exemplo n.º 21
0
 private void btn打印_Click(object sender, EventArgs e)
 {
     if (ccb银行.Text == "中信银行")
     {
         ReportPrintTool tool = new ReportPrintTool(zx_report);
         tool.PrintDialog();
     }
     else
     {
         ReportPrintTool tool = new ReportPrintTool(report);
         tool.PrintDialog();
     }
 }
Exemplo n.º 22
0
        private void button1_Click(object sender, EventArgs e)
        {
            // Create a report instance, assigned to a Print Tool.
            ReportPrintTool pt = new ReportPrintTool(new XtraReport1());

            // Invoke the Print dialog.
            pt.PrintDialog();

            // Send the report to the default printer.
            pt.Print();

            // Send the report to the specified printer.
            pt.Print("myPrinter");
        }
        private void cmsPrintReturn_Click(object sender, EventArgs e)
        {
            SalesReturnPrintItem2       report      = new SalesReturnPrintItem2();
            List <SalesReturnViewModel> _dataSource = new List <SalesReturnViewModel>();

            _dataSource.Add(SelectedSalesReturn);
            report.DataSource = _dataSource;
            report.FillDataSource();

            using (ReportPrintTool printTool = new ReportPrintTool(report))
            {
                // Invoke the Print dialog.
                printTool.PrintDialog();
            }
        }
        private void cmsPrint_Click(object sender, EventArgs e)
        {
            PurchasingPrintItem        report      = new PurchasingPrintItem();
            List <PurchasingViewModel> _dataSource = new List <PurchasingViewModel>();

            _dataSource.Add(SelectedPurchasing);
            report.DataSource = _dataSource;
            report.FillDataSource();

            using (ReportPrintTool printTool = new ReportPrintTool(report))
            {
                // Invoke the Print dialog.
                printTool.PrintDialog();
            }
        }
Exemplo n.º 25
0
        private void barButtonItem5_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Class_stat_Report report = new Class_stat_Report();

            report.DataSource = dt_cs;

            report.Parameters[0].Value = s_begin;
            report.Parameters[1].Value = s_end;
            report.RequestParameters   = false;              //禁止显示参数确认窗口

            using (ReportPrintTool printTool = new ReportPrintTool(report))
            {
                printTool.PrintDialog();
            }
        }
Exemplo n.º 26
0
 private void frmViewBillReport_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.F2)
     {
         ReportPrintTool pt = new ReportPrintTool(billReportView);
         pt.PrintingSystem.StartPrint +=
             new PrintDocumentEventHandler(printingSystem_StartPrint);
         pt.PrintDialog();
     }
     else
     {
         if (e.KeyCode == Keys.Escape)
         {
             this.Close();
         }
     }
 }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            InvoicePrintItem        report      = new InvoicePrintItem();
            List <InvoiceViewModel> _dataSource = new List <InvoiceViewModel>();

            _dataSource.Add(SelectedInvoice);
            report.DataSource = _dataSource;
            report.FillDataSource();

            using (ReportPrintTool printTool = new ReportPrintTool(report))
            {
                // Invoke the Print dialog.
                printTool.PrintDialog();
            }
            _presenter.Print();
            this.Close();
        }
Exemplo n.º 28
0
 private void frmViewBillReport_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.F2)
     {
         ReportPrintTool pt = new ReportPrintTool(billReportView);
         pt.PrintingSystem.StartPrint +=
             new PrintDocumentEventHandler(printingSystem_StartPrint);
         pt.PrintDialog();
     }
     else
     {
         if (e.KeyCode == Keys.Escape)
         {
             this.Close();
         }
     }
 }
Exemplo n.º 29
0
        public void Print()
        {
            RequestParameters = false;

            CreateDocument();

            using (var printTool = new ReportPrintTool(this))
            {
                if (string.IsNullOrEmpty(BaseControl.PrinterSetting.InkJet))
                {
                    printTool.PrintDialog();
                }
                else
                {
                    printTool.Print(BaseControl.PrinterSetting.InkJet);
                }
            }
        }
Exemplo n.º 30
0
        private void Report_Print_Preview(string action)
        {
            //XtraReport_EmployeesSalaryList Xtra_report_employeesSalaryList = new XtraReport_EmployeesSalaryList();
            XtraReport_Salary Xtra_report_employeesSalaryList = new XtraReport_Salary();

            DynamicParameters param = new DynamicParameters();

            param.Add("@Emp_Code_Processing", string.Empty);
            param.Add("@Salary_Month", DtStartDate.EditValue);
            param.Add("@Deduct_Advance", 1);
            param.Add("@Deduct_Loan", 1);
            param.Add("@TeaRate", txtteatrate.Text);
            param.Add("@NoOfCups", 0);



            //List<EmployeeSalary> EmployeesSalaryList = EmployeeData.GetEmployeesSalaryList("sp_Salary_Process", param);

            MonthlySalaryDetails_Model monthlySalaryDetails_Model = new MonthlySalaryDetails_Model
            {
                SalaryMonth         = ConvertTo.DateTimeVal(DtStartDate.EditValue),
                EmployeesSalaryList = EmployeeData.GetEmployeesSalaryList("sp_Salary_Process", param)
            };


            //MessageBox.Show(EmployeesSalaryList.Count + "");

            //salaryBindingSource.DataSource = EmployeesSalaryList;
            salaryBindingSource.DataSource = monthlySalaryDetails_Model;

            Xtra_report_employeesSalaryList.DataSource = salaryBindingSource;


            ReportPrintTool tool = new ReportPrintTool(Xtra_report_employeesSalaryList);

            if (action.Equals("preview"))
            {
                tool.ShowRibbonPreviewDialog();
            }
            if (action.Equals("print"))
            {
                tool.PrintDialog();
            }
        }
Exemplo n.º 31
0
        private void btnPrintAll_Click(object sender, EventArgs e)
        {
            if (bgwMain.IsBusy || bgwExport.IsBusy)
            {
                return;
            }

            if (InvoiceListData == null || InvoiceListData.Count == 0)
            {
                return;
            }

            if (InvoiceListData.Where(x => x.Status == (int)DbConstant.InvoiceStatus.FeeNotFixed).Count() > 0)
            {
                this.ShowWarning("terdapat data yang belum dilengkapi dengan fee dalam grid, tidak bisa cetak semua");
            }
            else
            {
                if (this.ShowConfirmation("Apakah anda yakin ingin mencetak semua data yang tampil pada daftar?") == DialogResult.Yes)
                {
                    List <InvoiceViewModel> dsReport = InvoiceListData;
                    if (dsReport != null && dsReport.Count > 0)
                    {
                        foreach (var itemReport in dsReport)
                        {
                            itemReport.ListInvoiceSparepart = _presenter.GetSparepartInvoice(itemReport.Id);
                        }
                        InvoicePrintItem report = new InvoicePrintItem();
                        report.DataSource = dsReport;
                        report.FillDataSource();

                        using (ReportPrintTool printTool = new ReportPrintTool(report))
                        {
                            // Invoke the Print dialog.
                            printTool.PrintDialog();
                        }
                        _presenter.PrintAll();

                        btnSearch.PerformClick();
                    }
                }
            }
        }
 private void simpleButton1_Click(object sender, EventArgs e)
 {
     if (currentReport == null)
     {
         return;
     }
     try
     {
         ReportPrintTool printTool = new ReportPrintTool(currentReport);
         // Invoke the Print dialog.
         printTool.PrintDialog();
         // Send the report to the default printer.
         printTool.Print();
         // Send the report to the specified printer.
         printTool.Print("myPrinter");
     } catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
        private void bgwSave_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
        {
            try
            {
                _presenter.SaveChanges();
                if (this.IsNeedApproval)
                {
                    _presenter.SendApproval();
                }
                else
                {
                    List<SPKViewModel> _dataSource = new List<SPKViewModel>();
                    _dataSource.Add(SelectedSPK);

                    if (isContractWork)
                    {
                        SPKContractPrintItem report = new SPKContractPrintItem();
                        report.DataSource = _dataSource;
                        report.FillDataSource();
                        if (!this.IsSPKSales)
                        {
                            _presenter.Print();
                            using (ReportPrintTool printTool = new ReportPrintTool(report))
                            {
                                // Invoke the Print dialog.
                                printTool.PrintDialog();
                            }
                        }
                    }
                    else
                    {
                        SPKPrintItem report = new SPKPrintItem();
                        report.DataSource = _dataSource;
                        report.FillDataSource();
                        if (!this.IsSPKSales)
                        {
                            _presenter.Print();
                            using (ReportPrintTool printTool = new ReportPrintTool(report))
                            {
                                // Invoke the Print dialog.
                                printTool.PrintDialog();
                            }
                        }
                    }

                }
            }
            catch (Exception ex)
            {
                MethodBase.GetCurrentMethod().Fatal("An error occured while trying to save spk with vehicleID: '" + this.VehicleId + "'", ex);
                e.Result = ex;
            }
        }
        private void btnPrintAll_Click(object sender, EventArgs e)
        {
            if (bgwMain.IsBusy || bgwExport.IsBusy) return;

            if (InvoiceListData == null || InvoiceListData.Count == 0) return;

            if (InvoiceListData.Where(x => x.Status == (int)DbConstant.InvoiceStatus.FeeNotFixed).Count() > 0)
            {
                this.ShowWarning("terdapat data yang belum dilengkapi dengan fee dalam grid, tidak bisa cetak semua");
            }
            else
            {
                if (this.ShowConfirmation("Apakah anda yakin ingin mencetak semua data yang tampil pada daftar?") == DialogResult.Yes)
                {
                    List<InvoiceViewModel> dsReport = InvoiceListData;
                    if (dsReport != null && dsReport.Count > 0)
                    {
                        foreach (var itemReport in dsReport)
                        {
                            itemReport.ListInvoiceSparepart = _presenter.GetSparepartInvoice(itemReport.Id);
                        }
                        InvoicePrintItem report = new InvoicePrintItem();
                        report.DataSource = dsReport;
                        report.FillDataSource();

                        using (ReportPrintTool printTool = new ReportPrintTool(report))
                        {
                            // Invoke the Print dialog.
                            printTool.PrintDialog();
                        }
                        _presenter.PrintAll();

                        btnSearch.PerformClick();
                    }
                }
            }
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            SparepartStockCardPrintItem report = new SparepartStockCardPrintItem(DateFromFilter, DateToFilter);
            report.DataSource = ListStockCard;
            report.FillDataSource();

            using (ReportPrintTool printTool = new ReportPrintTool(report))
            {
                printTool.PrintDialog();
            }
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            InvoicePrintItem report = new InvoicePrintItem();
            List<InvoiceViewModel> _dataSource = new List<InvoiceViewModel>();
            _dataSource.Add(SelectedInvoice);
            report.DataSource = _dataSource;
            report.FillDataSource();

            using (ReportPrintTool printTool = new ReportPrintTool(report))
            {
                // Invoke the Print dialog.
                printTool.PrintDialog();
            }
            _presenter.Print();
            this.Close();
        }
Exemplo n.º 37
0
 void settingsControl_PrintOptionsClick(object sender, EventArgs e) {
     using(ReportPrintTool tool = new ReportPrintTool(report))
         tool.PrintDialog(FindForm(), LookAndFeel);
 }
        private void cmsPrintData_Click(object sender, EventArgs e)
        {
            SPKPrintItem report = new SPKPrintItem();
            List<SPKViewModel> _dataSource = new List<SPKViewModel>();
            _dataSource.Add(SelectedSPK);
            report.DataSource = _dataSource;
            report.FillDataSource();

            using (ReportPrintTool printTool = new ReportPrintTool(report))
            {
                // Invoke the Print dialog.
                bool? result = printTool.PrintDialog();
                if (result.HasValue && result.Value)
                {
                    _presenter.PrintSPK();
                }
            }

            btnSearch.PerformClick();
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            ProfitLossPrintItem report = new ProfitLossPrintItem(SelectedYear, SelectedMonth);
            report.DataSource = ProfitLossList;
            report.FillDataSource();

            using (ReportPrintTool printTool = new ReportPrintTool(report))
            {
                // Invoke the Print dialog.
                printTool.PrintDialog();
            }
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            BalanceJournalPrintItem report = new BalanceJournalPrintItem(SelectedYear, SelectedMonth);
            report.DataSource = BalanceJournalDetailList;
            report.FillDataSource();

            using (ReportPrintTool printTool = new ReportPrintTool(report))
            {
                // Invoke the Print dialog.
                printTool.PrintDialog();
            }
        }
        private void btnPrintAll_Click(object sender, EventArgs e)
        {
            if (ListInvoices == null || ListInvoices.Count == 0)
            {
                this.ShowInformation("Data Invoice tidak ada");
                return;
            }

            try
            {
                ReferenceViewModel category = lookupCategory.GetSelectedDataRow() as ReferenceViewModel;
                VehicleGroupViewModel vehicleGroup = lookupVehicleGroup.GetSelectedDataRow() as VehicleGroupViewModel;

                List<RecapInvoiceBySPKItemViewModel> reportDataSource = new List<RecapInvoiceBySPKItemViewModel>();
                foreach (var item in this.ListInvoices)
                {
                    if (item.ItemName == "Gaji Tukang Harian" || item.ItemName == "Gaji Tukang Borongan")
                    {
                        RecapInvoiceBySPKItemViewModel itemWorker = reportDataSource.Where(ds =>
                            ds.Category == category.Name && ds.VehicleGroup == vehicleGroup.Name &&
                            ds.LicenseNumber == item.Invoice.SPK.Vehicle.ActiveLicenseNumber &&
                            (ds.Description == "ONGKOS TUKANG HARIAN" ||
                            ds.Description == "ONGKOS TUKANG BORONGAN")).FirstOrDefault();
                        if (itemWorker != null)
                        {
                            int currentIndex = reportDataSource.IndexOf(itemWorker);
                            if (item.ItemName == "Gaji Tukang Borongan")
                            {
                                decimal commission = item.SubTotalWithoutFee - ((100M / 120M) * item.SubTotalWithoutFee);
                                itemWorker.CommisionNominal = commission;
                                itemWorker.Nominal += (item.SubTotalWithoutFee - commission);
                                itemWorker.Total += item.SubTotalWithFee;
                                itemWorker.Fee += (item.SubTotalWithFee - item.SubTotalWithoutFee);
                            }
                            else
                            {
                                itemWorker.Nominal += item.SubTotalWithoutFee;
                                itemWorker.Total += item.SubTotalWithFee;
                                itemWorker.Fee += (item.SubTotalWithFee - item.SubTotalWithoutFee);
                            }
                            reportDataSource[currentIndex] = itemWorker;
                        }
                        else
                        {
                            itemWorker = new RecapInvoiceBySPKItemViewModel();
                            itemWorker.Category = category.Name;
                            itemWorker.VehicleGroup = vehicleGroup.Name;
                            itemWorker.LicenseNumber = item.Invoice.SPK.Vehicle.ActiveLicenseNumber;
                            itemWorker.Description = item.ItemName == "Gaji Tukang Harian" ?
                                "ONGKOS TUKANG HARIAN" : "ONGKOS TUKANG BORONGAN";
                            if (item.ItemName == "Gaji Tukang Borongan")
                            {
                                decimal commission = item.SubTotalWithoutFee - ((100M / 120M) * item.SubTotalWithoutFee);
                                itemWorker.CommisionNominal = commission;
                                itemWorker.Nominal = item.SubTotalWithoutFee - commission;
                                itemWorker.Total = item.SubTotalWithFee;
                                itemWorker.Fee = (item.SubTotalWithFee - item.SubTotalWithoutFee);
                            }
                            else
                            {
                                itemWorker.Nominal = item.SubTotalWithoutFee;
                                itemWorker.Total = item.SubTotalWithFee;
                                itemWorker.Fee = (item.SubTotalWithFee - item.SubTotalWithoutFee);
                            }
                            reportDataSource.Add(itemWorker);
                        }
                    }
                    else
                    {
                        RecapInvoiceBySPKItemViewModel itemSparepart = reportDataSource.Where(ds =>
                            ds.Category == category.Name && ds.VehicleGroup == vehicleGroup.Name &&
                            ds.LicenseNumber == item.Invoice.SPK.Vehicle.ActiveLicenseNumber &&
                            ds.Description == "ONDERDIL").FirstOrDefault();
                        if (itemSparepart != null)
                        {
                            int currentIndex = reportDataSource.IndexOf(itemSparepart);
                            itemSparepart.Nominal += item.SubTotalWithoutFee;
                            itemSparepart.Total += item.SubTotalWithFee;
                            itemSparepart.Fee += (item.SubTotalWithFee - item.SubTotalWithoutFee);
                            reportDataSource[currentIndex] = itemSparepart;
                        }
                        else
                        {
                            itemSparepart = new RecapInvoiceBySPKItemViewModel();
                            itemSparepart.Category = category.Name;
                            itemSparepart.VehicleGroup = vehicleGroup.Name;
                            itemSparepart.LicenseNumber = item.Invoice.SPK.Vehicle.ActiveLicenseNumber;
                            itemSparepart.Description = "ONDERDIL";
                            itemSparepart.Nominal = item.SubTotalWithoutFee;
                            itemSparepart.Total = item.SubTotalWithFee;
                            itemSparepart.Fee = (item.SubTotalWithFee - item.SubTotalWithoutFee);
                            reportDataSource.Add(itemSparepart);
                        }
                    }
                }

                string customer = (lookupCustomer.GetSelectedDataRow() as CustomerViewModel).CompanyName;
                RecapInvoiceBySPKPrintItem report = new RecapInvoiceBySPKPrintItem(customer, category.Name, DateFrom, DateTo);
                report.DataSource = reportDataSource;
                report.FillDataSource();

                using (ReportPrintTool printTool = new ReportPrintTool(report))
                {
                    printTool.PrintDialog();
                }
            }
            catch (Exception ex)
            {
                MethodBase.GetCurrentMethod().Fatal("An error occured while trying to print invoice", ex);
                this.ShowError("Print Invoice Gagal! Hubungi Developer.");
            }
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            BalanceHelperPrintItem report = new BalanceHelperPrintItem(SelectedYear, SelectedMonth, (lookUpFilterJournal.GetSelectedDataRow() as JournalMasterViewModel).Name);
            report.DataSource = ListHelper;
            report.FillDataSource();

            using (ReportPrintTool printTool = new ReportPrintTool(report))
            {
                // Invoke the Print dialog.
                printTool.PrintDialog();
            }
        }
        private void cmsPrintReturn_Click(object sender, EventArgs e)
        {
            PurchasingReturnPrintItem report = new PurchasingReturnPrintItem();
            List<PurchaseReturnViewModel> _dataSource = new List<PurchaseReturnViewModel>();
            _dataSource.Add(SelectedPurchaseReturn);
            report.DataSource = _dataSource;
            report.FillDataSource();

            using (ReportPrintTool printTool = new ReportPrintTool(report))
            {
                // Invoke the Print dialog.
                printTool.PrintDialog();
            }
        }
Exemplo n.º 44
0
        private void PrintReportFormat()
        {
            var report = GetCurrentReportFormat();

            if (report != null)
            {
                ReportPrintTool printTool = new ReportPrintTool(report);
                printTool.PrintDialog();
            }
            else
            {
                MessageService.ShowError("选中的报表格式为空,无法打印!");
            }
        }