T
Teo Lachev
How on earth I can bind an OWC 11 chart to pivot in C#? Whatever I tried
results in "Unknown error". It is really frustrating not to be able to find
out a single line of .NET code to use OWC 11.
My unsuccessful code so far:
//AxChartSpace chart = null;
OWC11.ChChart chart;
OWC11.PivotView pview = pivotTable.ActiveView;
// Bind the Chart control to the PivotTable control if necessary
//chartSpace.DataSourceType =
ChartDataSourceTypeEnum.chDataSourceTypePivotTable;
chartSpace.DataSource = (msdatasrc.DataSource) pivotTable.DataSourceEx;
//chartSpace.DataSourceName = pivotTable.Name;
chartSpace.DisplayFieldList = true;
//Get the chart or create one if needed
if (chartSpace.Charts.Count == 0)
chart = chartSpace.Charts.Add(0);
else
chart = chartSpace.Charts[0];
chart.HasLegend = true;
chart.HasTitle = true;
chart.Title.Caption = pview.TitleBar.Caption;
// Set the chart data
??? chart.SetData(ChartDimensionsEnum.chDimCategories, (int)
ChartSpecialDataSourcesEnum.chDataBound,
ChartPivotDataReferenceEnum.chPivotColumns);
chart.SetData (ChartDimensionsEnum.chDimCategories, 0,
ChartPivotDataReferenceEnum.chPivotRows);
results in "Unknown error". It is really frustrating not to be able to find
out a single line of .NET code to use OWC 11.
My unsuccessful code so far:
//AxChartSpace chart = null;
OWC11.ChChart chart;
OWC11.PivotView pview = pivotTable.ActiveView;
// Bind the Chart control to the PivotTable control if necessary
//chartSpace.DataSourceType =
ChartDataSourceTypeEnum.chDataSourceTypePivotTable;
chartSpace.DataSource = (msdatasrc.DataSource) pivotTable.DataSourceEx;
//chartSpace.DataSourceName = pivotTable.Name;
chartSpace.DisplayFieldList = true;
//Get the chart or create one if needed
if (chartSpace.Charts.Count == 0)
chart = chartSpace.Charts.Add(0);
else
chart = chartSpace.Charts[0];
chart.HasLegend = true;
chart.HasTitle = true;
chart.Title.Caption = pview.TitleBar.Caption;
// Set the chart data
??? chart.SetData(ChartDimensionsEnum.chDimCategories, (int)
ChartSpecialDataSourcesEnum.chDataBound,
ChartPivotDataReferenceEnum.chPivotColumns);
chart.SetData (ChartDimensionsEnum.chDimCategories, 0,
ChartPivotDataReferenceEnum.chPivotRows);