예제 #1
0
        public override void ExecutePrint(object obj)
        {

            GlobalClass.ReportName = "Goods Received Detail";
            GlobalClass.ReportParams = string.Format("From Date : {0} To {1}", FDate.ToString("MM/dd/yyyy"), TDate.ToString("MM/dd/yyyy"));

            Report.PrintSettings.PrintPageMargin = new Thickness(30);
            Report.PrintSettings.AllowColumnWidthFitToPrintPage = false;
            Report.PrintSettings.PrintPageOrientation = PrintOrientation.Landscape;
            Report.Print();
        }
예제 #2
0
        public override void ExecuteExport(object obj)
        {
            GlobalClass.ReportName = "Goods Received Detail";

            GlobalClass.ReportParams = string.Format("From Date : {0} To {1}", FDate.ToString("MM/dd/yyyy"), TDate.ToString("MM/dd/yyyy"));

            wExportFormat ef = new wExportFormat(Report);
            ef.ShowDialog();
        }
        private void LoadReport(object param)
        {
            string strSql = string.Empty;

            try
            {
                if (ReportFlag == 0)
                {
                    strSql = string.Format(@"SELECT SETTLEMENT_ID REPRINTNO, U.UserName PRINTED_BY, CS.TRNDATE BILL_DATE, CS.TRNTIME PRINTED_TIME, CS.AMOUNT, CS.CollectionAmount TAXABLE_AMOUNT, CS.AMOUNT - CS.CollectionAmount TAX_AMOUNT
                        FROM CashSettlement CS 
                        JOIN TERMINALS T ON CS.TERMINAL_CODE = T.TERMINAL_CODE
                        JOIN USERS U ON U.UID = CS.SETTLED_UID WHERE CS.TRNDATE BETWEEN '{0}' AND '{1}'{2}", FDate.ToString("MM/dd/yyyy"), TDate.ToString("MM/dd/yyyy"),
                                           ((SelectedUser > 0) ? " AND CS.SETTLED_UID = " + SelectedUser : string.Empty));
                }



                LoadColumns();
                var data = GetDataTable(strSql);
                if (data != null && data.Count() == 0)
                {
                    MessageBox.Show("NoData");
                }
                else
                {
                    ReportSource = new ObservableCollection <ReportModel>(data);
                }
                GlobalClass.SetUserActivityLog(GetReportName(), "View", string.Empty, string.Empty, string.Empty);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, this.MessageBoxCaption, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
        private void ExecutePrint(object obj)
        {
            GlobalClass.ReportName   = GetReportName();
            GlobalClass.ReportParams = string.Format("From Date : {0} To {1}", FDate.ToString("MM/dd/yyyy"), TDate.ToString("MM/dd/yyyy"));

            Report.PrintSettings.PrintPageMargin = new Thickness(30);
            Report.PrintSettings.AllowColumnWidthFitToPrintPage = false;
            Report.Print();
        }
        private void ExecuteExport(object obj)
        {
            GlobalClass.ReportName = GetReportName();

            GlobalClass.ReportParams = string.Format("From Date : {0} To {1}", FDate.ToString("MM/dd/yyyy"), TDate.ToString("MM/dd/yyyy"));

            wExportFormat ef = new wExportFormat(Report);

            ef.ShowDialog();
        }
        private void LoadReport(object param)
        {
            string strSql = string.Empty;

            try
            {
                //VOUCHER DISCOUNT REPORT - DETAILS
                if (ReportFlag == 0)
                {
                    strSql = string.Format(@"SELECT VSD.BillNo BILL_NO, CAST(CONVERT(VARCHAR(10),PV.ScannedTime, 101) AS DATETIME) BILL_DATE, RIGHT( CONVERT(VARCHAR, ScannedTime, 0),7) PRINTED_TIME, VSD.VoucherNo REF_NO, PV.VoucherName REMARKS, VSD.DiscountAmount DISCOUNT, PSV.BillTo CUSTOMER_NAME, U.UserName PRINTED_BY 
                                            FROM VoucherDiscountDetail VSD 
                                            JOIN ParkingVouchers PV ON VSD.VoucherNo = PV.VoucherNo --AND PV.FYID = VSD.FYID
                                            LEFT JOIN ParkingSales PSV ON PV.BillNo = PSV.BillNo AND PSV.FYID = PV.FYID 
                                            JOIN USERS U ON U.UID = VSD.UID WHERE ScannedTime BETWEEN '{0}' AND '{1}'{2}", FDate.ToString("MM/dd/yyyy"), TDate.ToString("MM/dd/yyyy") + " 23:59:59", (SelectedVoucher == 0)?string.Empty:" AND PV.VoucherId = " + SelectedVoucher);
                }
                //VOUCHER DISCOUNT REPORT - SUMMARY
                else if (ReportFlag == 1)
                {
                    strSql = string.Format(@"SELECT BILL_DATE, {0}, COUNT(*) REPRINTNO, SUM(DISCOUNT) DISCOUNT FROM
                                                (
                                                SELECT CAST(CONVERT(VARCHAR(10),PV.ScannedTime, 101) AS DATETIME) BILL_DATE, PV.VoucherName REMARKS, VSD.DiscountAmount DISCOUNT, PSV.BillTo CUSTOMER_NAME, U.UserName PRINTED_BY 
                                                FROM VoucherDiscountDetail VSD 
                                                JOIN ParkingVouchers PV ON VSD.VoucherNo = PV.VoucherNo -- AND PV.FYID = VSD.FYID
                                                LEFT JOIN ParkingSales PSV ON PV.BillNo = PSV.BillNo AND PSV.FYID = PV.FYID 
                                                JOIN USERS U ON U.UID = VSD.UID WHERE ScannedTime BETWEEN '{1}' AND '{2}'{3}
                                                ) a GROUP BY BILL_DATE, {0} ORDER BY BILL_DATE", SummaryType, FDate.ToString("MM/dd/yyyy"), TDate.ToString("MM/dd/yyyy") + " 23:59:59", (SelectedVoucher == 0) ? string.Empty : " AND PV.VoucherId = " + SelectedVoucher);
                }


                LoadColumns();
                var data = GetDataTable(strSql);
                if (data != null && data.Count() == 0)
                {
                    MessageBox.Show("NoData");
                }
                else
                {
                    ReportSource = new ObservableCollection <ReportModel>(data);
                }
                GlobalClass.SetUserActivityLog(GetReportName(), "View", string.Empty, string.Empty, string.Empty);
            }
            catch (Exception Ex)
            {
                MessageBox.Show(Ex.Message, MessageBoxCaption, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }