Ejemplo n.º 1
0
        private void outputToExcel(IViewGridForm activeForm)
        {
            int re = activeForm.DataExport();

            if (re != 0)
            {
                return;
            }

            object mainGrid = activeForm.GetCurrentMainGridView(false);

            DevExpress.XtraGrid.GridControl grdCtl = mainGrid as DevExpress.XtraGrid.GridControl;
            if (grdCtl != null)
            {
                MB.XWinLib.XtraGrid.XtraGridHelper.Instance.ExportToExcelAndShow(grdCtl);
            }
            else
            {
                DevExpress.XtraPivotGrid.PivotGridControl pivGrid = mainGrid as DevExpress.XtraPivotGrid.PivotGridControl;
                if (pivGrid != null)
                {
                    MB.XWinLib.PivotGrid.PivotGridHelper.Instance.ExportToExcelAndShow(pivGrid);
                }
            }
        }
Ejemplo n.º 2
0
        private void FrmQueryFilterInput_Load(object sender, EventArgs e)
        {
            if (!_IsPageSettingPanelVisiable)
            {
                mpanFilterTop.Visible = false;
            }

            //add by aifang
            if (string.IsNullOrEmpty(_DataFilterElementsName))
            {
                _DataFilterElementsName = DATA_FILTER_MAIN_CFG_NAME;
            }
            _DataElementCfgs = MB.WinBase.LayoutXmlConfigHelper.Instance.GetDataFilterCfgElements(_ClientRuleObject.ClientLayoutAttribute.UIXmlConfigFile, _DataFilterElementsName);
            if (_DataElementCfgs == null || _DataElementCfgs.Count == 0)
            {
                throw new MB.Util.APPException("该对象在对应的XML配置文件中没有配置查询项!", MB.Util.APPMessageType.DisplayToUser);
            }

            _Columns = _ClientRuleObject.UIRuleXmlConfigInfo.GetDefaultColumns();

            #region 设置过滤框的长度与宽度
            if (_DataElementCfgs.Width > 0)
            {
                this.Width = _DataElementCfgs.Width;
            }
            if (_DataElementCfgs.Height > 0)
            {
                this.Height = _DataElementCfgs.Height;
            }
            #endregion

            //增加判断,如果主窗口中的不是GridView,则不加载高级查询
            var gridControl = _ViewGridForm.GetCurrentMainGridView(true) as DevExpress.XtraGrid.GridControl;
            if (gridControl != null)
            {
                tPageAdvanceFilter.PageVisible = true;
                showAdvanceFilter();
            }
            else
            {
                tPageAdvanceFilter.PageVisible = false;
            }

            //判断大数据查询是否被激活
            IViewGridFormWithGreatData viewWithGreatData = _ViewGridForm as IViewGridFormWithGreatData;
            this.cbQueryAll.Visible = (viewWithGreatData != null && _DataElementCfgs.AllowQueryAll);
            this.cbQueryAll.Checked = false;


            bool isDynamicGroupEnabled = false;
            IViewDynamicGroupGridForm dynamicGroupView = _ViewGridForm as IViewDynamicGroupGridForm;
            if (dynamicGroupView != null)
            {
                isDynamicGroupEnabled = dynamicGroupView.IsDynamicGroupIsActive;
            }

            this.lnkDynamaicSetting.Visible = (_ClientRuleObject.ClientLayoutAttribute.LoadType == ClientDataLoadType.ReLoad && !isDynamicGroupEnabled);
            this.cbShowTotalPage.Visible    = !isDynamicGroupEnabled;
            this.cbQueryAll.Visible         = !isDynamicGroupEnabled;
        }
Ejemplo n.º 3
0
        private void showPrintPreview(IViewGridForm activeForm)
        {
            object mainGrid = activeForm.GetCurrentMainGridView(false);

            DevExpress.XtraGrid.GridControl grdCtl = mainGrid as DevExpress.XtraGrid.GridControl;
            if (grdCtl != null)
            {
                grdCtl.ShowPrintPreview();
            }
            else
            {
                DevExpress.XtraPivotGrid.PivotGridControl pivGrid = mainGrid as DevExpress.XtraPivotGrid.PivotGridControl;
                if (pivGrid != null)
                {
                    pivGrid.ShowPrintPreview();
                }
            }
        }
 /// <summary>
 /// 创建高级查询控件。
 /// </summary>
 /// <param name="viewGridForm"></param>
 public void IniLoadFilterControl(IViewGridForm viewGridForm)
 {
     IniLoadFilterControl(viewGridForm.ClientRuleObject, viewGridForm.GetCurrentMainGridView(true) as DevExpress.XtraGrid.GridControl);
 }