예제 #1
0
        private void windowsUIView1_QueryControl(object sender, DevExpress.XtraBars.Docking2010.Views.QueryControlEventArgs e)
        {
            switch ((int)e.Document.Tag)
            {
            case 0:
                e.Control = new DocumentViewerUserControl()
                {
                    Report = new ManagementReport()
                };
                break;

            case 1:
                e.Control = new DocumentViewerUserControl()
                {
                    Report = new EmployeeReport()
                };
                break;

            case 2:
                EmployeeReport report = new EmployeeReport();
                report.Parameters["paramEmpName"].Value   = string.Empty;
                report.Parameters["paramEmpName"].Visible = false;
                e.Control = new DocumentViewerUserControl()
                {
                    Report = report
                };
                break;

            case 3:
                e.Control = new OptionsUserControl();
                break;
            }
        }
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            EmployeeReport empReport = new EmployeeReport();

            ReportPrintTool printTool = new ReportPrintTool(empReport);

            printTool.ShowPreviewDialog();
        }
        private void EmployeeReport_ParametersRequestSubmit(object sender, DevExpress.XtraReports.Parameters.ParametersRequestEventArgs e)
        {
            EmployeeReport report = sender as EmployeeReport;
            int            year   = Convert.ToInt32(report.Parameters["paramYear"].Value);
            int            month  = Convert.ToInt32(report.Parameters["paramMonth"].Value);

            report.Parameters["paramPaymentDate"].Value = new DateTime(year, month, 1);
        }