Пример #1
0
        public override void Print()
        {
            DateTime?fromDate = (dtpFromDate.Value.ToDate() + dtpFromTime.Value.Value.TimeOfDay).ToDateTime();
            DateTime?tillDate = (dtpTillDate.Value.ToDate() + dtptilltime.Value.Value.TimeOfDay).ToDateTime();

            string error = string.Empty;


            if (fromDate == null)
            {
                if (string.IsNullOrEmpty(error))
                {
                    error += Environment.NewLine;
                }

                error += "Required : From Date";
            }

            if (tillDate == null)
            {
                if (string.IsNullOrEmpty(error))
                {
                    error += Environment.NewLine;
                }

                error += "Required : To Date";
            }

            if (!string.IsNullOrEmpty(error))
            {
                ENUtils.ShowMessage(error);
                return;
            }

            int companyId = ddlCompany.SelectedValue.ToInt();
            int driverId  = ddlDriver.SelectedValue.ToInt();

            int FleetMasterId             = ddlCompanyVehicle.SelectedValue.ToInt();
            rptfrmIncomeSummaryReport frm = new rptfrmIncomeSummaryReport();

            frm.Period     = "Income Summary Report for Date Range" + Environment.NewLine + string.Format("{0:dd/MM/yyyy}", fromDate) + " to " + string.Format("{0:dd/MM/yyyy}", tillDate);
            frm.DataSource = GetDataSource(fromDate, tillDate, companyId, driverId, FleetMasterId);

            frm.LoadReport();

            DockWindow doc = UI.MainMenuForm.MainMenuFrm.GetDockByName("rptfrmIncomeSummaryReport1");

            if (doc != null)
            {
                doc.Close();
            }
            UI.MainMenuForm.MainMenuFrm.ShowForm(frm);
        }
Пример #2
0
        private void btnExportPDF_Click(object sender, EventArgs e)
        {
            DateTime?fromDate = (dtpFromDate.Value.ToDate() + dtpFromTime.Value.Value.TimeOfDay).ToDateTime();
            DateTime?tillDate = (dtpTillDate.Value.ToDate() + dtptilltime.Value.Value.TimeOfDay).ToDateTime();

            string error = string.Empty;


            if (fromDate == null)
            {
                if (string.IsNullOrEmpty(error))
                {
                    error += Environment.NewLine;
                }

                error += "Required : From Date";
            }

            if (tillDate == null)
            {
                if (string.IsNullOrEmpty(error))
                {
                    error += Environment.NewLine;
                }

                error += "Required : To Date";
            }

            if (!string.IsNullOrEmpty(error))
            {
                ENUtils.ShowMessage(error);
                return;
            }


            int companyId = ddlCompany.SelectedValue.ToInt();
            int driverId  = ddlDriver.SelectedValue.ToInt();

            int FleetMasterId             = ddlCompanyVehicle.SelectedValue.ToInt();
            rptfrmIncomeSummaryReport frm = new rptfrmIncomeSummaryReport();

            frm.Period     = "Income Summary Report for Date Range" + Environment.NewLine + string.Format("{0:dd/MM/yyyy}", fromDate) + " to " + string.Format("{0:dd/MM/yyyy}", tillDate);
            frm.DataSource = GetDataSource(fromDate, tillDate, companyId, driverId, FleetMasterId);


            frm.LoadReport();

            frm.ExportReport();
        }