Ejemplo n.º 1
0
        private static void AssertAddSummaryFieldCommandWorks(Type dataSourceType, string dataMember, bool ribbonForm)
        {
            var dataSource = new BindingSource {
                DataSource = dataSourceType
            };

            using (var tool = new ReportDesignTool(new XtraReport {
                DataSource = dataSource
            }))
            {
                var form = ribbonForm ? tool.DesignRibbonForm : tool.DesignForm;
                SummaryFieldsFeature.Apply(form.DesignMdiController, form.DesignDockManager);
                form.OpenReport(tool.Report);

                var fieldListPanel = (FieldListDockPanel)form.DesignDockManager[DesignDockPanelType.FieldList];
                var fieldList      = (XRDesignFieldList)fieldListPanel.DesignControl;
                fieldList.SelectDataMemberNode(dataSource, dataMember);
                fieldList.Selection.Set(new[] { fieldList.FocusedNode });

                var menuCommandService = form.DesignMdiController.ActiveDesignPanel.GetService <IXRMenuCommandService>();
                menuCommandService.GlobalInvoke(SummaryFieldsFeature.AddSummaryFieldCommand, new object[] { fieldList.FocusedNode });
                Assert.That(tool.Report.CalculatedFields.Count, Is.EqualTo(1));
            }
        }
Ejemplo n.º 2
0
        private void barBtnXuatBaoCao_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (Object.Equals(NhanVienPTs, null))
            {
                XtraMessageBox.Show("Chưa có nhân viên phụ trách", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (NhanVienPTs.Count > 0)
            {
                try
                {
                    DevExpress.XtraSplashScreen.SplashScreenManager splashScreenManager_Report = new DevExpress.XtraSplashScreen.SplashScreenManager(this, typeof(global::PTB_GUI.WaitForm1), true, true, DevExpress.XtraSplashScreen.ParentType.UserControl);
                    splashScreenManager_Report.ShowWaitForm();
                    splashScreenManager_Report.SetWaitFormCaption("Đang tạo report");
                    splashScreenManager_Report.SetWaitFormDescription("Vui lòng chờ trong giây lát...");

                    XtraReport_Template _XtraReport_Template = new XtraReport_Template(SHARED.Libraries.ReportHelper.FillDatasetFromGrid(gridViewNhanVien), gridViewNhanVien, barCheckItemLandscape.Checked, false);
                    _XtraReport_Template.SetTitleText("Danh Sách Nhân Viên Phụ Trách");
                    if (barCheckItemThietKe.Checked)
                    {
                        ReportDesignTool designTool = new ReportDesignTool(_XtraReport_Template);
                        splashScreenManager_Report.CloseWaitForm();
                        designTool.ShowDesignerDialog();

                        ReportPrintTool printTool = new ReportPrintTool(designTool.Report);
                        printTool.ShowPreviewDialog();
                    }
                    else
                    {
                        ReportPrintTool printTool = new ReportPrintTool(_XtraReport_Template);
                        splashScreenManager_Report.CloseWaitForm();
                        printTool.ShowPreviewDialog();
                    }
                }
                catch
                {
                    XtraMessageBox.Show("Đã xảy ra lỗi!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                XtraMessageBox.Show("Chưa có nhân viên phụ trách", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 3
0
        public void ShowDesigner()
        {
            ReportDesignTool dt = new ReportDesignTool(this);

            dt.ShowDesigner();
        }
Ejemplo n.º 4
0
 private void btnRaporDizayn_Click(object sender, EventArgs e)
 {
     ReportDesignTool rd1 = new ReportDesignTool(InitReport(InitData()));
       rd1.ShowDesigner();
 }
 private void showDesignerBarItem_ItemClick(object sender, XtraBars.ItemClickEventArgs e)
 {
     using (var tool = new ReportDesignTool(ViewModel.Report)) {
         tool.ShowRibbonDesignerDialog();
     }
 }
Ejemplo n.º 6
0
        private void simpleButton_Xuat_Click(object sender, EventArgs e)
        {
            switch (comboBoxEdit_LoaiBaoCao.SelectedIndex)
            {
                #region Báo cáo tăng giảm tài sản cố định

                case 0:
                    if (dateEdit_TuNgay.DateTime.Date > DateTime.Today.Date)
                    {
                        XtraMessageBox.Show("Ngày từ không được lớn hơn ngày hiện tại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        dateEdit_TuNgay.Focus();
                        return;
                    }
                    if (dateEdit_DenNgay.DateTime.Date > DateTime.Today.Date)
                    {
                        XtraMessageBox.Show("Ngày đến không được lớn hơn ngày hiện tại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        dateEdit_DenNgay.Focus();
                        return;
                    }
                    if (dateEdit_TuNgay.DateTime.Date > dateEdit_DenNgay.DateTime.Date)
                    {
                        XtraMessageBox.Show("Ngày từ không được lớn hơn ngày đến", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        dateEdit_TuNgay.Focus();
                        return;
                    }
                    if (checkEdit_XuatBaoCao.Checked)
                    {
                        IsDesign = false;
                    }
                    else if (checkEdit_ThietKe.Checked)
                    {
                        IsDesign = true;
                    }

                    ShowAndHide(false);
                    labelControl_Status.Text = "Đang tạo report, vui lòng chờ trong giây lát...";

                    _ThreadReport = new System.Threading.Thread(() =>
                    {
                        DevExpress.UserSkins.BonusSkins.Register();
                        Application.EnableVisualStyles();
                        UserLookAndFeel.Default.SetSkinStyle(TSCD.Global.local_setting.ApplicationSkinName);
                        DevExpress.Skins.SkinManager.EnableFormSkins();

                        DateTime From = dateEdit_TuNgay.DateTime.Date, To = dateEdit_DenNgay.DateTime.Date;
                        List<TK_TangGiam_TheoLoaiTS> Data = GetData_BaoCaoTangGiamTaiSanCoDinh(From, To);

                        TSCD_GUI.ReportTSCD.XtraReport_BaoCaoTangGiamTSCD _XtraReport_BaoCaoTangGiamTSCD = new ReportTSCD.XtraReport_BaoCaoTangGiamTSCD(Data, From, To);
                        if (IsDesign)
                        {
                            ReportDesignTool designTool = new ReportDesignTool(_XtraReport_BaoCaoTangGiamTSCD);

                            ReportCompeleted();

                            designTool.ShowDesignerDialog();

                            ReportPrintTool printTool = new ReportPrintTool(designTool.Report);
                            printTool.PreviewForm.PrintControl.Zoom = Zoom;
                            printTool.ShowPreviewDialog();

                            ShowAndHide(true);
                        }
                        else
                        {
                            ReportPrintTool printTool = new ReportPrintTool(_XtraReport_BaoCaoTangGiamTSCD);
                            printTool.PreviewForm.PrintControl.Zoom = Zoom;
                            ReportCompeleted();

                            printTool.ShowPreviewDialog();

                            ShowAndHide(true);
                        }
                    });
                    _ThreadReport.SetApartmentState(ApartmentState.STA);
                    _ThreadReport.Start();
                    break;

                #endregion

                #region Sổ tài sản cố định

                case 1:
                    if (dateEdit_Nam.DateTime.Year > DateTime.Today.Year)
                    {
                        XtraMessageBox.Show("Năm lớn hơn năm hiện tại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    List<Guid> ListLoaiTaiSan = ucComboBoxLoaiTS_LoaiTaiSan.list_loaitaisan;
                    if (Object.Equals(ListLoaiTaiSan, null))
                    {
                        XtraMessageBox.Show("Chưa chọn loại tài sản cần thống kê", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    if (!(ListLoaiTaiSan.Count > 0))
                    {
                        XtraMessageBox.Show("Chưa chọn loại tài sản cần thống kê", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    List<Guid> ListCoSo = CheckedComboBoxEditHelper.getCheckedValueArray(checkedComboBoxEdit_ChonCoSo);
                    if (!checkEdit_ChuaCoViTri.Checked)
                    {
                        if (Object.Equals(ListCoSo, null))
                        {
                            XtraMessageBox.Show("Chưa chọn cơ sở cần thống kê", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            return;
                        }
                        if (!(ListCoSo.Count > 0))
                        {
                            XtraMessageBox.Show("Chưa chọn cơ sở cần thống kê", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            return;
                        }
                    }
                    if (checkEdit_XuatBaoCao.Checked)
                    {
                        IsDesign = false;
                    }
                    else if (checkEdit_ThietKe.Checked)
                    {
                        IsDesign = true;
                    }

                    ShowAndHide(false);
                    labelControl_Status.Text = "Đang tạo report, vui lòng chờ trong giây lát...";

                    _ThreadReport = new System.Threading.Thread(() =>
                    {
                        DevExpress.UserSkins.BonusSkins.Register();
                        Application.EnableVisualStyles();
                        UserLookAndFeel.Default.SetSkinStyle(TSCD.Global.local_setting.ApplicationSkinName);
                        DevExpress.Skins.SkinManager.EnableFormSkins();

                        Object Data = GetData_SoTaiSanCoDinh(ListLoaiTaiSan, ListCoSo, dateEdit_Nam.DateTime.Year, checkEdit_ChuaCoViTri.Checked);

                        TSCD_GUI.ReportTSCD.XtraReport_SoTaiSanCoDinh _XtraReport_SoTaiSanCoDinh = new ReportTSCD.XtraReport_SoTaiSanCoDinh(Data, dateEdit_Nam.DateTime.Year);
                        if (IsDesign)
                        {
                            ReportDesignTool designTool = new ReportDesignTool(_XtraReport_SoTaiSanCoDinh);

                            ReportCompeleted();

                            designTool.ShowDesignerDialog();

                            ReportPrintTool printTool = new ReportPrintTool(designTool.Report);
                            printTool.PreviewForm.PrintControl.Zoom = Zoom;
                            printTool.ShowPreviewDialog();

                            ShowAndHide(true);
                        }
                        else
                        {
                            ReportPrintTool printTool = new ReportPrintTool(_XtraReport_SoTaiSanCoDinh);
                            printTool.PreviewForm.PrintControl.Zoom = Zoom;
                            ReportCompeleted();

                            printTool.ShowPreviewDialog();

                            ShowAndHide(true);
                        }
                    });
                    _ThreadReport.SetApartmentState(ApartmentState.STA);
                    _ThreadReport.Start();
                    break;

                #endregion

                #region Sổ chi tiết tài sản cố định

                case 2:
                    if (dateEdit_Nam.DateTime.Year > DateTime.Today.Year)
                    {
                        XtraMessageBox.Show("Năm lớn hơn năm hiện tại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    else if (Object.Equals(ucComboBoxDonVi_ChonDonVi.DonVi, null))
                    {
                        XtraMessageBox.Show("Chưa chọn đơn vị", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    else if (Object.Equals(ucComboBoxDonVi_ChonDonVi.DonVi.id, Guid.Empty))
                    {
                        XtraMessageBox.Show("Chưa chọn đơn vị", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    if (checkEdit_XuatBaoCao.Checked)
                    {
                        IsDesign = false;
                    }
                    else if (checkEdit_ThietKe.Checked)
                    {
                        IsDesign = true;
                    }

                    ShowAndHide(false);
                    labelControl_Status.Text = "Đang tạo report, vui lòng chờ trong giây lát...";

                    _ThreadReport = new System.Threading.Thread(() =>
                    {
                        DevExpress.UserSkins.BonusSkins.Register();
                        Application.EnableVisualStyles();
                        UserLookAndFeel.Default.SetSkinStyle(TSCD.Global.local_setting.ApplicationSkinName);
                        DevExpress.Skins.SkinManager.EnableFormSkins();

                        var DonViSelected = ucComboBoxDonVi_ChonDonVi.DonVi;
                        Object Data = null;
                        String strTenDonVi = "";
                        if (!Object.Equals(DonViSelected, null))
                        {
                            strTenDonVi = DonViSelected.ten;
                            Data = GetData_SoChiTietTaiSanCoDinh(DonViSelected.id, dateEdit_Nam.DateTime.Year);
                        }

                        TSCD_GUI.ReportTSCD.XtraReport_SoChiTietTaiSanCoDinh _XtraReport_SoChiTietTaiSanCoDinh = new ReportTSCD.XtraReport_SoChiTietTaiSanCoDinh(Data, dateEdit_Nam.DateTime.Year, strTenDonVi);
                        if (IsDesign)
                        {
                            ReportDesignTool designTool = new ReportDesignTool(_XtraReport_SoChiTietTaiSanCoDinh);

                            ReportCompeleted();

                            designTool.ShowDesignerDialog();

                            ReportPrintTool printTool = new ReportPrintTool(designTool.Report);
                            printTool.PreviewForm.PrintControl.Zoom = Zoom;
                            printTool.ShowPreviewDialog();

                            ShowAndHide(true);
                        }
                        else
                        {
                            ReportPrintTool printTool = new ReportPrintTool(_XtraReport_SoChiTietTaiSanCoDinh);
                            printTool.PreviewForm.PrintControl.Zoom = Zoom;
                            ReportCompeleted();

                            printTool.ShowPreviewDialog();

                            ShowAndHide(true);
                        }
                    });
                    _ThreadReport.SetApartmentState(ApartmentState.STA);
                    _ThreadReport.Start();
                    break;

                #endregion

                #region Sổ theo dõi tài sản cố định tại nơi sử dụng

                case 3:
                    if (Object.Equals(ucComboBoxDonVi_ChonDonVi.DonVi, null))
                    {
                        XtraMessageBox.Show("Chưa chọn đơn vị", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    else if (Object.Equals(ucComboBoxDonVi_ChonDonVi.DonVi.id, Guid.Empty))
                    {
                        XtraMessageBox.Show("Chưa chọn đơn vị", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    if (checkEdit_XuatBaoCao.Checked)
                    {
                        IsDesign = false;
                    }
                    else if (checkEdit_ThietKe.Checked)
                    {
                        IsDesign = true;
                    }

                    ShowAndHide(false);
                    labelControl_Status.Text = "Đang tạo report, vui lòng chờ trong giây lát...";

                    _ThreadReport = new System.Threading.Thread(() =>
                    {
                        DevExpress.UserSkins.BonusSkins.Register();
                        Application.EnableVisualStyles();
                        UserLookAndFeel.Default.SetSkinStyle(TSCD.Global.local_setting.ApplicationSkinName);
                        DevExpress.Skins.SkinManager.EnableFormSkins();

                        var DonViSelected = ucComboBoxDonVi_ChonDonVi.DonVi;
                        Object Data = null;
                        String strTenDonVi = "";
                        if (!Object.Equals(DonViSelected, null))
                        {
                            strTenDonVi = DonViSelected.ten;
                            Data = GetData_SoTheoDoiTaiSanCoDinhTaiNoiSuDung(DonViSelected.id);
                        }

                        TSCD_GUI.ReportTSCD.XtraReport_SoTheoDoiTSCDTaiNoiSuDung _XtraReport_SoTheoDoiTSCDTaiNoiSuDung = new ReportTSCD.XtraReport_SoTheoDoiTSCDTaiNoiSuDung(Data, strTenDonVi);
                        if (IsDesign)
                        {
                            ReportDesignTool designTool = new ReportDesignTool(_XtraReport_SoTheoDoiTSCDTaiNoiSuDung);

                            ReportCompeleted();

                            designTool.ShowDesignerDialog();

                            ReportPrintTool printTool = new ReportPrintTool(designTool.Report);
                            printTool.PreviewForm.PrintControl.Zoom = Zoom;
                            printTool.ShowPreviewDialog();

                            ShowAndHide(true);
                        }
                        else
                        {
                            ReportPrintTool printTool = new ReportPrintTool(_XtraReport_SoTheoDoiTSCDTaiNoiSuDung);
                            printTool.PreviewForm.PrintControl.Zoom = Zoom;
                            ReportCompeleted();

                            printTool.ShowPreviewDialog();

                            ShowAndHide(true);
                        }
                    });
                    _ThreadReport.SetApartmentState(ApartmentState.STA);
                    _ThreadReport.Start();
                    break;

                #endregion

                case 4:
                    XtraMessageBox.Show("Chức năng này chưa có", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    break;
                default:
                    break;
            }
        }
Ejemplo n.º 7
0
        public void Disenyar()
        {
            Factura factura = bsFactura.Current as Factura;

            if (factura != null)
            {
                var cliente = Cliente ?? new Cliente();

                XtraReportFactura xtraReport = new XtraReportFactura
                {
                    Factura = factura
                };

                try
                {
                    using (var ms = new MemoryStream(cliente.ModeloDocumento))
                    {
                        ms.Position = 0;

                        xtraReport.LoadLayout(ms);
                    }
                }
                catch (Exception)
                {
                }

                ReportDesignTool dt = new ReportDesignTool(xtraReport);

                // Invoke the Ribbon End-User Designer form modally.
                dt.ShowRibbonDesignerDialog();

                using (var ms = new MemoryStream())
                {
                    xtraReport.SaveLayout(ms);

                    ms.Position = 0;

                    cliente.ModeloDocumento = ms.ToArray();
                }
            }
        }
Ejemplo n.º 8
0
        private void btnTuyChinh_Click(object sender, EventArgs e)
        {
            if(!kiemTraTruocKhiIn())
            {
                return;
            }

            ReportDesignTool dt = new ReportDesignTool(new rptInTemNuTrang(txtTenTiem.Text, txtDiaChi.Text, txtMaVach.Text, txtTenHang.Text, txtTongTrongLuong.Value, txtTongTrongLuong.Value, txtTienCong.Value, txtHot.Value, "", txtNhaCungCap.Text, txtHamLuongPho.Text, Convert.ToInt32(txtSoLuongTem.Value), txtTongTrongLuongChu.Text, txtTrongLuongChu.Text, txtHotChu.Text));

            // Access the report's properties.
            dt.Report.DrawGrid = false;

            // Access the Designer form's properties.
            dt.DesignForm.SetWindowVisibility(DesignDockPanelType.FieldList | DesignDockPanelType.PropertyGrid, false);

            // Show the Designer form, modally.
            dt.ShowDesignerDialog();

            //var rptMaVach = new rptInTemNuTrang(txtTenTiem.Text, txtDiaChi.Text, txtMaVach.Text, txtTenHang.Text, txtTongTrongLuong.Value, txtTongTrongLuong.Value, txtTienCong.Value, txtHot.Value, "", txtNhaCungCap.Text, txtHamLuongPho.Text, Convert.ToInt32(txtSoLuongTem.Value), txtTongTrongLuongChu.Text, txtTrongLuongChu.Text, txtHotChu.Text);
            //rptMaVach.AssignPrintTool(new ReportPrintTool(rptMaVach));
            //rptMaVach.CreateDocument();
            //rptMaVach.ShowDesigner();
            try
            {
                if (cbLuuSauKhiIn.Checked)
                {
                    _clsXuLyDuLieu.luuDuLieuExcel(duongDanFileExcel, txtMaVach.Text, txtTenHang.Text, txtTongTrongLuong.Value, txtTrongLuong.Value, txtHot.Value, txtTienCong.Value, "", txtNhaCungCap.Text, txtHamLuongPho.Text, txtTenTiem.Text, txtDiaChi.Text, Convert.ToInt32(txtSoLuongTem.Value));
                    RaiseXemEventHander();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        private void button2_Click(object sender, EventArgs e)
        {
            ReportDesignTool designTool = new ReportDesignTool(report);

            designTool.ShowDesignerDialog();
        }
        private void barBtnXuatBaoCao_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (Object.Equals(objPhong, null))
            {
                XtraMessageBox.Show("Chưa chọn phòng!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (Object.Equals(objPhong.id, Guid.Empty))
            {
                XtraMessageBox.Show("Chưa chọn phòng!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            String strViTri = "[Không Rõ]";
            if (!Object.Equals(objPhong.vitri, null))
                strViTri = objPhong.vitri.coso != null ? objPhong.vitri.coso.ten + (objPhong.vitri.day != null ? " - " + objPhong.vitri.day.ten + (objPhong.vitri.tang != null ? " - " + objPhong.vitri.tang.ten : "") : "") : "";
            if (Object.Equals(listCTThietBis, null))
            {
                XtraMessageBox.Show(String.Format("Phòng {0} ({1}) chưa có thiết bị!", objPhong.ten, strViTri), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            else
            {
                if (listCTThietBis.Count > 0)
                {
                    try
                    {
                        DevExpress.XtraSplashScreen.SplashScreenManager splashScreenManager_Report = new DevExpress.XtraSplashScreen.SplashScreenManager(this, typeof(global::PTB_GUI.WaitForm1), true, true, DevExpress.XtraSplashScreen.ParentType.UserControl);
                        splashScreenManager_Report.ShowWaitForm();
                        splashScreenManager_Report.SetWaitFormCaption("Đang tạo report");
                        splashScreenManager_Report.SetWaitFormDescription("Vui lòng chờ trong giây lát...");

                        XtraReport_Template _XtraReport_Template = new XtraReport_Template(SHARED.Libraries.ReportHelper.FillDatasetFromGrid(gridViewCTThietBi), gridViewCTThietBi, barCheckItemLandscape.Checked);
                        _XtraReport_Template.SetTitleText(String.Format("Danh Sách Thiết Bị Tại Phòng: {0} ({1})", objPhong.ten, strViTri));
                        if (barCheckItemThietKe.Checked)
                        {
                            ReportDesignTool designTool = new ReportDesignTool(_XtraReport_Template);
                            splashScreenManager_Report.CloseWaitForm();
                            designTool.ShowDesignerDialog();

                            ReportPrintTool printTool = new ReportPrintTool(designTool.Report);
                            printTool.ShowPreviewDialog();
                        }
                        else
                        {
                            ReportPrintTool printTool = new ReportPrintTool(_XtraReport_Template);
                            splashScreenManager_Report.CloseWaitForm();
                            printTool.ShowPreviewDialog();
                        }
                    }
                    catch
                    {
                        XtraMessageBox.Show("Đã xảy ra lỗi!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    XtraMessageBox.Show(String.Format("Phòng {0} ({1}) chưa có thiết bị!", objPhong.ten, strViTri), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
Ejemplo n.º 11
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            Factura factura = bsFactura.Current as Factura;

            if (factura != null)
            {
                XtraReportFactura xtraReport = new XtraReportFactura
                {
                    Factura = factura
                };
                ReportDesignTool dt = new ReportDesignTool(xtraReport);

                // Invoke the Ribbon End-User Designer form modally.
                dt.ShowRibbonDesignerDialog();
            }
        }
Ejemplo n.º 12
0
 private void OpenDesigner()
 {
     _designer = new ReportDesignTool(new XtraReport());
     _designer.ShowRibbonDesigner();
 }
        private void simpleButton_Design_Click(object sender, EventArgs e)
        {
            //design
            if (comboBoxEdit_Report.SelectedIndex == 0)
            {
                splashScreenManager_Report.ShowWaitForm();
                splashScreenManager_Report.SetWaitFormCaption("Đang tạo report");
                splashScreenManager_Report.SetWaitFormDescription("Vui lòng chờ trong giây lát...");

                XtraReport_Template _XtraReport_Template = new XtraReport_Template(FillDatasetFromGrid(), gridViewThongKe, checkEdit_Landscape.Checked);
                ReportDesignTool designTool = new ReportDesignTool(_XtraReport_Template);
                splashScreenManager_Report.CloseWaitForm();
                designTool.ShowDesignerDialog();

                ReportPrintTool printTool = new ReportPrintTool(designTool.Report);
                printTool.ShowPreviewDialog();
            }
            else
            {
                splashScreenManager_Report.ShowWaitForm();
                splashScreenManager_Report.SetWaitFormCaption("Đang tạo report");
                splashScreenManager_Report.SetWaitFormDescription("Vui lòng chờ trong giây lát...");

                XtraReport_XtraGrid _XtraReport_XtraGrid = new XtraReport_XtraGrid(gridControlThongKe, checkEdit_Landscape.Checked);
                ReportDesignTool designTool = new ReportDesignTool(_XtraReport_XtraGrid);
                splashScreenManager_Report.CloseWaitForm();
                designTool.ShowDesignerDialog();

                ReportPrintTool printTool = new ReportPrintTool(designTool.Report);
                printTool.ShowPreviewDialog();
            }
        }
Ejemplo n.º 14
0
        private void simpleButton_Xuat_Click(object sender, EventArgs e)
        {
            switch (comboBoxEdit_LoaiBaoCao.SelectedIndex)
            {
                #region Báo cáo tăng giảm tài sản cố định

            case 0:
                if (dateEdit_TuNgay.DateTime.Date > DateTime.Today.Date)
                {
                    XtraMessageBox.Show("Ngày từ không được lớn hơn ngày hiện tại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    dateEdit_TuNgay.Focus();
                    return;
                }
                if (dateEdit_DenNgay.DateTime.Date > DateTime.Today.Date)
                {
                    XtraMessageBox.Show("Ngày đến không được lớn hơn ngày hiện tại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    dateEdit_DenNgay.Focus();
                    return;
                }
                if (dateEdit_TuNgay.DateTime.Date > dateEdit_DenNgay.DateTime.Date)
                {
                    XtraMessageBox.Show("Ngày từ không được lớn hơn ngày đến", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    dateEdit_TuNgay.Focus();
                    return;
                }
                if (checkEdit_XuatBaoCao.Checked)
                {
                    IsDesign = false;
                }
                else if (checkEdit_ThietKe.Checked)
                {
                    IsDesign = true;
                }

                ShowAndHide(false);
                labelControl_Status.Text = "Đang tạo report, vui lòng chờ trong giây lát...";

                _ThreadReport = new System.Threading.Thread(() =>
                {
                    DevExpress.UserSkins.BonusSkins.Register();
                    Application.EnableVisualStyles();
                    UserLookAndFeel.Default.SetSkinStyle(TSCD.Global.local_setting.ApplicationSkinName);
                    DevExpress.Skins.SkinManager.EnableFormSkins();

                    DateTime From = dateEdit_TuNgay.DateTime.Date, To = dateEdit_DenNgay.DateTime.Date;
                    List <TK_TangGiam_TheoLoaiTS> Data = GetData_BaoCaoTangGiamTaiSanCoDinh(From, To);

                    TSCD_GUI.ReportTSCD.XtraReport_BaoCaoTangGiamTSCD _XtraReport_BaoCaoTangGiamTSCD = new ReportTSCD.XtraReport_BaoCaoTangGiamTSCD(Data, From, To);
                    if (IsDesign)
                    {
                        ReportDesignTool designTool = new ReportDesignTool(_XtraReport_BaoCaoTangGiamTSCD);

                        ReportCompeleted();

                        designTool.ShowDesignerDialog();

                        ReportPrintTool printTool = new ReportPrintTool(designTool.Report);
                        printTool.PreviewForm.PrintControl.Zoom = Zoom;
                        printTool.ShowPreviewDialog();

                        ShowAndHide(true);
                    }
                    else
                    {
                        ReportPrintTool printTool = new ReportPrintTool(_XtraReport_BaoCaoTangGiamTSCD);
                        printTool.PreviewForm.PrintControl.Zoom = Zoom;
                        ReportCompeleted();

                        printTool.ShowPreviewDialog();

                        ShowAndHide(true);
                    }
                });
                _ThreadReport.SetApartmentState(ApartmentState.STA);
                _ThreadReport.Start();
                break;

                #endregion

                #region Sổ tài sản cố định

            case 1:
                if (dateEdit_Nam.DateTime.Year > DateTime.Today.Year)
                {
                    XtraMessageBox.Show("Năm lớn hơn năm hiện tại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                List <Guid> ListLoaiTaiSan = ucComboBoxLoaiTS_LoaiTaiSan.list_loaitaisan;
                if (Object.Equals(ListLoaiTaiSan, null))
                {
                    XtraMessageBox.Show("Chưa chọn loại tài sản cần thống kê", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                if (!(ListLoaiTaiSan.Count > 0))
                {
                    XtraMessageBox.Show("Chưa chọn loại tài sản cần thống kê", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                List <Guid> ListCoSo = CheckedComboBoxEditHelper.getCheckedValueArray(checkedComboBoxEdit_ChonCoSo);
                if (!checkEdit_ChuaCoViTri.Checked)
                {
                    if (Object.Equals(ListCoSo, null))
                    {
                        XtraMessageBox.Show("Chưa chọn cơ sở cần thống kê", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    if (!(ListCoSo.Count > 0))
                    {
                        XtraMessageBox.Show("Chưa chọn cơ sở cần thống kê", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                }
                if (checkEdit_XuatBaoCao.Checked)
                {
                    IsDesign = false;
                }
                else if (checkEdit_ThietKe.Checked)
                {
                    IsDesign = true;
                }

                ShowAndHide(false);
                labelControl_Status.Text = "Đang tạo report, vui lòng chờ trong giây lát...";

                _ThreadReport = new System.Threading.Thread(() =>
                {
                    DevExpress.UserSkins.BonusSkins.Register();
                    Application.EnableVisualStyles();
                    UserLookAndFeel.Default.SetSkinStyle(TSCD.Global.local_setting.ApplicationSkinName);
                    DevExpress.Skins.SkinManager.EnableFormSkins();

                    Object Data = GetData_SoTaiSanCoDinh(ListLoaiTaiSan, ListCoSo, dateEdit_Nam.DateTime.Year, checkEdit_ChuaCoViTri.Checked);

                    TSCD_GUI.ReportTSCD.XtraReport_SoTaiSanCoDinh _XtraReport_SoTaiSanCoDinh = new ReportTSCD.XtraReport_SoTaiSanCoDinh(Data, dateEdit_Nam.DateTime.Year);
                    if (IsDesign)
                    {
                        ReportDesignTool designTool = new ReportDesignTool(_XtraReport_SoTaiSanCoDinh);

                        ReportCompeleted();

                        designTool.ShowDesignerDialog();

                        ReportPrintTool printTool = new ReportPrintTool(designTool.Report);
                        printTool.PreviewForm.PrintControl.Zoom = Zoom;
                        printTool.ShowPreviewDialog();

                        ShowAndHide(true);
                    }
                    else
                    {
                        ReportPrintTool printTool = new ReportPrintTool(_XtraReport_SoTaiSanCoDinh);
                        printTool.PreviewForm.PrintControl.Zoom = Zoom;
                        ReportCompeleted();

                        printTool.ShowPreviewDialog();

                        ShowAndHide(true);
                    }
                });
                _ThreadReport.SetApartmentState(ApartmentState.STA);
                _ThreadReport.Start();
                break;

                #endregion

                #region Sổ chi tiết tài sản cố định

            case 2:
                if (dateEdit_Nam.DateTime.Year > DateTime.Today.Year)
                {
                    XtraMessageBox.Show("Năm lớn hơn năm hiện tại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                else if (Object.Equals(ucComboBoxDonVi_ChonDonVi.DonVi, null))
                {
                    XtraMessageBox.Show("Chưa chọn đơn vị", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                else if (Object.Equals(ucComboBoxDonVi_ChonDonVi.DonVi.id, Guid.Empty))
                {
                    XtraMessageBox.Show("Chưa chọn đơn vị", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                if (checkEdit_XuatBaoCao.Checked)
                {
                    IsDesign = false;
                }
                else if (checkEdit_ThietKe.Checked)
                {
                    IsDesign = true;
                }

                ShowAndHide(false);
                labelControl_Status.Text = "Đang tạo report, vui lòng chờ trong giây lát...";

                _ThreadReport = new System.Threading.Thread(() =>
                {
                    DevExpress.UserSkins.BonusSkins.Register();
                    Application.EnableVisualStyles();
                    UserLookAndFeel.Default.SetSkinStyle(TSCD.Global.local_setting.ApplicationSkinName);
                    DevExpress.Skins.SkinManager.EnableFormSkins();

                    var DonViSelected  = ucComboBoxDonVi_ChonDonVi.DonVi;
                    Object Data        = null;
                    String strTenDonVi = "";
                    if (!Object.Equals(DonViSelected, null))
                    {
                        strTenDonVi = DonViSelected.ten;
                        Data        = GetData_SoChiTietTaiSanCoDinh(DonViSelected.id, dateEdit_Nam.DateTime.Year);
                    }

                    TSCD_GUI.ReportTSCD.XtraReport_SoChiTietTaiSanCoDinh _XtraReport_SoChiTietTaiSanCoDinh = new ReportTSCD.XtraReport_SoChiTietTaiSanCoDinh(Data, dateEdit_Nam.DateTime.Year, strTenDonVi);
                    if (IsDesign)
                    {
                        ReportDesignTool designTool = new ReportDesignTool(_XtraReport_SoChiTietTaiSanCoDinh);

                        ReportCompeleted();

                        designTool.ShowDesignerDialog();

                        ReportPrintTool printTool = new ReportPrintTool(designTool.Report);
                        printTool.PreviewForm.PrintControl.Zoom = Zoom;
                        printTool.ShowPreviewDialog();

                        ShowAndHide(true);
                    }
                    else
                    {
                        ReportPrintTool printTool = new ReportPrintTool(_XtraReport_SoChiTietTaiSanCoDinh);
                        printTool.PreviewForm.PrintControl.Zoom = Zoom;
                        ReportCompeleted();

                        printTool.ShowPreviewDialog();

                        ShowAndHide(true);
                    }
                });
                _ThreadReport.SetApartmentState(ApartmentState.STA);
                _ThreadReport.Start();
                break;

                #endregion

                #region Sổ theo dõi tài sản cố định tại nơi sử dụng

            case 3:
                if (Object.Equals(ucComboBoxDonVi_ChonDonVi.DonVi, null))
                {
                    XtraMessageBox.Show("Chưa chọn đơn vị", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                else if (Object.Equals(ucComboBoxDonVi_ChonDonVi.DonVi.id, Guid.Empty))
                {
                    XtraMessageBox.Show("Chưa chọn đơn vị", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                if (checkEdit_XuatBaoCao.Checked)
                {
                    IsDesign = false;
                }
                else if (checkEdit_ThietKe.Checked)
                {
                    IsDesign = true;
                }

                ShowAndHide(false);
                labelControl_Status.Text = "Đang tạo report, vui lòng chờ trong giây lát...";

                _ThreadReport = new System.Threading.Thread(() =>
                {
                    DevExpress.UserSkins.BonusSkins.Register();
                    Application.EnableVisualStyles();
                    UserLookAndFeel.Default.SetSkinStyle(TSCD.Global.local_setting.ApplicationSkinName);
                    DevExpress.Skins.SkinManager.EnableFormSkins();

                    var DonViSelected  = ucComboBoxDonVi_ChonDonVi.DonVi;
                    Object Data        = null;
                    String strTenDonVi = "";
                    if (!Object.Equals(DonViSelected, null))
                    {
                        strTenDonVi = DonViSelected.ten;
                        Data        = GetData_SoTheoDoiTaiSanCoDinhTaiNoiSuDung(DonViSelected.id);
                    }

                    TSCD_GUI.ReportTSCD.XtraReport_SoTheoDoiTSCDTaiNoiSuDung _XtraReport_SoTheoDoiTSCDTaiNoiSuDung = new ReportTSCD.XtraReport_SoTheoDoiTSCDTaiNoiSuDung(Data, strTenDonVi);
                    if (IsDesign)
                    {
                        ReportDesignTool designTool = new ReportDesignTool(_XtraReport_SoTheoDoiTSCDTaiNoiSuDung);

                        ReportCompeleted();

                        designTool.ShowDesignerDialog();

                        ReportPrintTool printTool = new ReportPrintTool(designTool.Report);
                        printTool.PreviewForm.PrintControl.Zoom = Zoom;
                        printTool.ShowPreviewDialog();

                        ShowAndHide(true);
                    }
                    else
                    {
                        ReportPrintTool printTool = new ReportPrintTool(_XtraReport_SoTheoDoiTSCDTaiNoiSuDung);
                        printTool.PreviewForm.PrintControl.Zoom = Zoom;
                        ReportCompeleted();

                        printTool.ShowPreviewDialog();

                        ShowAndHide(true);
                    }
                });
                _ThreadReport.SetApartmentState(ApartmentState.STA);
                _ThreadReport.Start();
                break;

                #endregion

            case 4:
                XtraMessageBox.Show("Chức năng này chưa có", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                break;

            default:
                break;
            }
        }
Ejemplo n.º 15
0
 private void YeniRapor(XtraReport rapor1)
 {
     ReportDesignTool designTool = new ReportDesignTool(rapor1);
     //designTool.ShowDesignerDialog();
 }
Ejemplo n.º 16
0
 private void button2_Click(object sender, RoutedEventArgs e)
 {
     using (ReportDesignTool printTool = new ReportDesignTool(report)) {
         printTool.ShowDesignerDialog();
     }
 }
        // Use a ReportDesignTool, to show a report in a Ribbon End-User Designer form.
        private void button4_Click(object sender, EventArgs e)
        {
            ReportDesignTool dt = new ReportDesignTool(new XtraReport1());

            dt.ShowRibbonDesignerDialog();
        }
Ejemplo n.º 18
0
        private void barBtnXuatBaoCao_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (Object.Equals(_ViTriHienTai, null))
            {
                XtraMessageBox.Show("Chưa chọn vị trí!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (Object.Equals(listPhong, null))
            {
                XtraMessageBox.Show("Không có phòng!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            else
            {
                String strViTri = _ViTriHienTai.coso != null ? _ViTriHienTai.coso.ten + (_ViTriHienTai.day != null ? " - " + _ViTriHienTai.day.ten + (_ViTriHienTai.tang != null ? " - " + _ViTriHienTai.tang.ten : "") : "") : "";
                if (listPhong.Count > 0)
                {
                    try
                    {
                        DevExpress.XtraSplashScreen.SplashScreenManager splashScreenManager_Report = new DevExpress.XtraSplashScreen.SplashScreenManager(this, typeof(global::PTB_GUI.WaitForm1), true, true, DevExpress.XtraSplashScreen.ParentType.UserControl);
                        splashScreenManager_Report.ShowWaitForm();
                        splashScreenManager_Report.SetWaitFormCaption("Đang tạo report");
                        splashScreenManager_Report.SetWaitFormDescription("Vui lòng chờ trong giây lát...");

                        XtraReport_Template _XtraReport_Template = new XtraReport_Template(SHARED.Libraries.ReportHelper.FillDatasetFromGrid(gridViewPhong), gridViewPhong, barCheckItemLandscape.Checked);
                        _XtraReport_Template.SetTitleText("Danh Sách Phòng Tại: " + strViTri);
                        if (barCheckItemThietKe.Checked)
                        {
                            ReportDesignTool designTool = new ReportDesignTool(_XtraReport_Template);
                            splashScreenManager_Report.CloseWaitForm();
                            designTool.ShowDesignerDialog();

                            ReportPrintTool printTool = new ReportPrintTool(designTool.Report);
                            printTool.ShowPreviewDialog();
                        }
                        else
                        {
                            ReportPrintTool printTool = new ReportPrintTool(_XtraReport_Template);
                            splashScreenManager_Report.CloseWaitForm();
                            printTool.ShowPreviewDialog();
                        }
                    }
                    catch
                    {
                        XtraMessageBox.Show("Đã xảy ra lỗi!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    strViTri = "[" + strViTri + "]";
                    XtraMessageBox.Show(strViTri + " không có phòng!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
Ejemplo n.º 19
0
 private void simpleButton1_Click(object sender, EventArgs e)
 {
     designer = new ReportDesignTool(new XtraReport1());
     designer.DesignRibbonForm.DesignMdiController.DesignPanelLoaded += DesignMdiController_DesignPanelLoaded;
     designer.ShowRibbonDesignerDialog();
 }