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 SubCompanyId = ddlSubCompany.SelectedValue.ToInt();


            rptfrmCompanyIncome frm = new rptfrmCompanyIncome();



            frm.ReportHeading = "Company Income Report for Date Range :" + string.Format("{0:dd/MM/yyyy HH:mm}", fromDate) + " to " + string.Format("{0:dd/MM/yyyy HH:mm}", tillDate);
            frm.DataSource    = GetDataSource(fromDate, tillDate, companyId, SubCompanyId);

            frm.GenerateReport();

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

            if (doc != null)
            {
                doc.Close();
            }
            UI.MainMenuForm.MainMenuFrm.ShowForm(frm);
        }
        private void btnSendEmail_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 SubCompanyId = ddlSubCompany.SelectedValue.ToInt();

            rptfrmCompanyIncome frm = new rptfrmCompanyIncome();


            frm.ReportHeading = "Company Income Report for Date Range :" + string.Format("{0:dd/MM/yyyy HH:mm}", fromDate) + " to " + string.Format("{0:dd/MM/yyyy HH:mm}", tillDate);
            frm.DataSource    = GetDataSource(fromDate, tillDate, companyId, SubCompanyId);


            frm.GenerateReport();

            frm.SendEmail();
        }