Profile Picture

export to data table error

Posted By Bruce Guthrie 14 Years Ago
Author
Message
Bruce Guthrie
Posted 14 Years Ago
View Quick Profile
Junior Member

Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)

Group: Forum Members
Last Active: 6 Years Ago
Posts: 14, Visits: 2

hello

i am trying to export a simple Line chart data (XY series) to a data table.  i think i follow your examples but i keep getting the same error when i run, that the "The data series must have the same size."

Private Sub nExportData_Click(ByVal sender As System.Object, ByVal e As Nevron.UI.WinForm.Controls.CommandEventArgs) Handles nExportData.Click

Dim chart As NChart = myChartCtrl(selectedChart).Charts(0)

Dim arrSeries As NDataSeriesCollection = New NDataSeriesCollection()

Dim sTableName As String = ""

Dim dataView1 = New System.Data.DataView()

Dim myDataGrid = New System.Windows.Forms.DataGrid()

Dim line As NLineSeries = CType(chart.Series(0), NLineSeries)

'Dim myGrid As NDataSeriesGrid

sTableName = myChartCtrl(selectedChart).Name

arrSeries.Add(line.Values, DataSeriesMask.Values)

arrSeries.Add(line.XValues, DataSeriesMask.XValues)

arrSeries.Add(line.Labels, DataSeriesMask.Labels)

' customize the toolbar of the grid

'NChartGridControl1.ChartGridButtonsMask = ChartGridButtonsMask.UpdateGridFromSeries Or ChartGridButtonsMask.UpdateSeriesFromGrid Or ChartGridButtonsMask.BindToChart

' create your datagrid derivate

'myGrid = New NDataSeriesGrid()

'myGrid.DataSource = arrSeries.ExportToDataTable("Line Chart")

' replace the data grid used by the NChartGridControl

'NChartGridControl1.DataSeriesGrid = myGrid

' bind to the chart control

'NChartGridControl1.ChartControl = myChartCtrl(selectedChart)

Dim datatable As DataTable = arrSeries.ExportToDataTable("kl") --- fails here no matter what i put as the string.

'dataView1 = New System.Data.DataView()

'dataView1.Table = arrSeries.ExportToDataTable("kl")

NDataGridView1.DataSource = datatable

Me.DataGrid.DataSource = datatable

Me.Controls.Add(myDataGrid)

myDataGrid.Visible = True

myChartCtrl(selectedChart).Refresh()

End Sub

 

i cannot get past the arrSeries.ExportToDataTable command.

 

can you help, i follow your code examples but i cannot export the data.

Regards

bruce

 






Similar Topics


Reading This Topic