示例#1
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            try
            {
                DateTime?fromDate = dtpFromDate.Value.ToDateTimeorNull();
                DateTime?toDate   = dtpTillDate.Value.ToDateTimeorNull();


                rptfrmCallHistoryReport frm = new rptfrmCallHistoryReport();

                //972, 531
                frm.Height        = 800;
                frm.Width         = 1000;
                frm.ReportHeading = "Period: " + string.Format("{0:dd/MM/yyyy HH:mm}", fromDate) + " to " + string.Format("{0:dd/MM/yyyy HH:mm}", toDate);
                frm.DataSource    = FillDataSource();
                // frm.TemplateValue = templateNo + "_rptJobsList.rdlc";
                frm.LoadReport();
                frm.ShowDialog();

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

                //if (doc != null)
                //{
                //    doc.Close();
                //}
                //UI.MainMenuForm.MainMenuFrm.ShowForm(frm);
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
示例#2
0
        private void btnExport_Click(object sender, EventArgs e)
        {
            try
            {
                DateTime?fromDate = dtpFromDate.Value.ToDateTimeorNull();
                DateTime?toDate   = dtpTillDate.Value.ToDateTimeorNull();


                rptfrmCallHistoryReport frm = new rptfrmCallHistoryReport();

                frm.ReportHeading = "Period: " + string.Format("{0:dd/MM/yyyy HH:mm}", fromDate) + " to " + string.Format("{0:dd/MM/yyyy HH:mm}", toDate);
                frm.DataSource    = FillDataSource();
                // frm.TemplateValue = templateNo + "_rptJobsList.rdlc";
                frm.LoadReport();
                frm.ExportReport();
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }