//private void CreateHeaders(IList<PivotAreaData> list, int axisIndex) //{ // if (m_CellSet.Axes.Count > axisIndex) // { // foreach (Hierarchy h in m_CellSet.Axes[axisIndex].Set.Hierarchies) // { // list.Add(new PivotAreaData(h.UniqueName, h.Caption)); // } // } //} public CellValueInfo GetValue(params int[] index) { if (m_CellSet_Descr == null || index == null || index.Length < 2) { return(CellValueInfo.Empty); } foreach (CellData cell_descr in m_CellSet_Descr.Cells) { if (cell_descr.Axis0_Coord == index[0] && cell_descr.Axis1_Coord == index[1]) { object value = null; string displayName = string.Empty; if (cell_descr.Value != null) { try { displayName = cell_descr.Value.DisplayValue; value = cell_descr.Value.Value; } catch (Exception exc) { value = exc; } } if (string.IsNullOrEmpty(displayName)) { if (value == null) { displayName = String.Empty; } else { displayName = value.ToString(); } } CellValueInfo res = new CellValueInfo(value, displayName); foreach (PropertyData prop in cell_descr.Value.Properties) { res.Properties.Add(prop.Name, prop.Value); } return(res); } } return(CellValueInfo.Empty); }
//private void CreateHeaders(IList<PivotAreaData> list, int axisIndex) //{ // if (m_CellSet.Axes.Count > axisIndex) // { // foreach (Hierarchy h in m_CellSet.Axes[axisIndex].Set.Hierarchies) // { // list.Add(new PivotAreaData(h.UniqueName, h.Caption)); // } // } //} public CellValueInfo GetValue(params int[] index) { if (m_CellSet_Descr == null || index == null || index.Length < 2) { return CellValueInfo.Empty; } foreach (CellData cell_descr in m_CellSet_Descr.Cells) { if (cell_descr.Axis0_Coord == index[0] && cell_descr.Axis1_Coord == index[1]) { object value = null; string displayName = string.Empty; if (cell_descr.Value != null) { try { displayName = cell_descr.Value.DisplayValue; value = cell_descr.Value.Value; } catch (Exception exc) { value = exc; } } if (string.IsNullOrEmpty(displayName)) { if (value == null) { displayName = String.Empty; } else { displayName = value.ToString(); } } CellValueInfo res = new CellValueInfo(value, displayName); foreach (PropertyData prop in cell_descr.Value.Properties) { res.Properties.Add(prop.Name, prop.Value); } return res; } } return CellValueInfo.Empty; }