private void btnShowPivot_Click(object sender, EventArgs e) { try { switch (cbPivotType.Value) { case "One Field": _pivotDataSet = Olap.Pivot(_dataSource, ValueColumn, KeyColumn, GroupSignificant); break; case "Two Fields": _pivotDataSet = Olap.Pivot(_dataSource, ValueColumn, EntryColumn, BaseColumn); break; default: throw new ArgumentOutOfRangeException("cbPivotType.Value=" + cbPivotType.Value); } dgResult.DataSource = _pivotDataSet; dgResult.DataMember = Olap.PIVOT_TABLE_NAME; } catch (Exception ex) { FormUtil.WinException(ex); } }
private static void PivotTest() { var dt = Olap.Pivot(TestTable(), "Value", "Field", "Type"); if (dt == null) { throw new ApplicationException("dt is empty"); } }