public MdxSelectStatement CreateWrappedStatement(MdxSelectStatement original) { if (original == null) { return(null); } try { MdxSelectStatement select = (MdxSelectStatement)original.Clone(); if (select.Axes.Count <= 0) { return(select); } var axis0_actions = ColumnsActionChain; if (select.Axes[0].Name.ToLower() == "1" || select.Axes[0].Name.ToLower() == "rows") { axis0_actions = RowsActionChain; } select.Axes[0] = axis0_actions.GetWrappedAxis(select.Axes[0] /*, this.ConcretizeMdxObject*/); if (select.Axes.Count <= 1) { return(select); } var axis1_actions = RowsActionChain; if (select.Axes[1].Name.ToLower() == "0" || select.Axes[1].Name.ToLower() == "columns") { axis1_actions = ColumnsActionChain; } select.Axes[1] = axis1_actions.GetWrappedAxis(select.Axes[1] /*, this.ConcretizeMdxObject*/); // Переворот осей if (RotateAxes) { if (select.Axes.Count > 1) { var axis0 = select.Axes[0]; select.Axes[0] = select.Axes[1]; select.Axes[0].Name = "0"; select.Axes[1] = axis0; axis0.Name = "1"; } } return(select); } catch (Exception) { throw; } }
private MdxSelectStatement CreateWrappedStatement() { if (!string.IsNullOrEmpty(Query) && m_OriginalStatement == null) { using (MdxDomProvider provider = MdxDomProvider.CreateProvider()) { m_OriginalStatement = provider.ParseMdx(this.Query) as MdxSelectStatement; } } MdxSelectStatement select = null; try { if (m_OriginalStatement != null) { select = m_OriginalStatement.Clone() as MdxSelectStatement; // (MdxSelectStatement)Serializer.Deserialize(Serializer.Serialize(m_OriginalStatement)); if (select != null) { if (History.CurrentHistoryItem != null) { if (select.Axes.Count > 0) { select.Axes[0] = GetWrappedAxis(select.Axes[0], History.CurrentHistoryItem.ColumnsActionChain); if (select.Axes.Count > 1) { select.Axes[1] = GetWrappedAxis(select.Axes[1], History.CurrentHistoryItem.RowsActionChain); } // Переворот осей if (RotateAxes) { if (select.Axes.Count > 1) { MdxExpression axis0_expression = select.Axes[0].Expression; select.Axes[0].Expression = select.Axes[1].Expression; select.Axes[1].Expression = axis0_expression; } } } } } } } catch (Exception ex) { throw ex; } return(select); }
private MdxSelectStatement CreateWrappedStatement() { if (m_OriginalStatement == null) { return(null); } try { MdxSelectStatement select = (MdxSelectStatement)m_OriginalStatement.Clone(); if (this.CurrentHistoryItem == null) { return(select); } return(this.CurrentHistoryItem.CreateWrappedStatement(select)); } catch (Exception) { throw; } }