hello
i send the result of search to a radGridView1, and radGridView1 to Excel.
i want to show chart of it in excel. but my code dont work prefectly
below is the code:
thanks very much.
Range range_kol = worksheet.get_Range("A3", Convert.ToChar(65 + radGridView1.RowCount - 1) + (i + 2).ToString());
range_kol.Select();
ChartObjects chartobjects = (ChartObjects)worksheet.ChartObjects(Missing.Value);
ChartObject chartobject = (ChartObject)chartobjects.Add(10, 150, 450, 250); //Left-Top-Width-Height
_Chart chart = (_Chart)chartobject.Chart;
// Call to chart.ChartWizard() is shown using late binding technique solely for the demonstration purposes
Object[] args7 = new Object[11];
args7[0] = range_kol; // Source
args7[1] = Microsoft.Office.Interop.Excel.XlChartType.xl3DColumn; // Gallery
args7[2] = Missing.Value; // Format
args7[3] = Microsoft.Office.Interop.Excel.XlRowCol.xlRows; // PlotBy
args7[4] = 0; // CategoryLabels
args7[5] = 0; // SeriesLabels
args7[6] = true; // HasLegend
args7[7] = "chart"; // Title
args7[8] = "Sample Category Type"; // CategoryTitle
args7[9] = "type data"; // ValueTitle
args7[10] = Missing.Value; // ExtraTitle
chart.GetType().InvokeMember("ChartWizard", BindingFlags.InvokeMethod, null, chart, args7);
i send the result of search to a radGridView1, and radGridView1 to Excel.
i want to show chart of it in excel. but my code dont work prefectly
below is the code:
thanks very much.
Range range_kol = worksheet.get_Range("A3", Convert.ToChar(65 + radGridView1.RowCount - 1) + (i + 2).ToString());
range_kol.Select();
ChartObjects chartobjects = (ChartObjects)worksheet.ChartObjects(Missing.Value);
ChartObject chartobject = (ChartObject)chartobjects.Add(10, 150, 450, 250); //Left-Top-Width-Height
_Chart chart = (_Chart)chartobject.Chart;
// Call to chart.ChartWizard() is shown using late binding technique solely for the demonstration purposes
Object[] args7 = new Object[11];
args7[0] = range_kol; // Source
args7[1] = Microsoft.Office.Interop.Excel.XlChartType.xl3DColumn; // Gallery
args7[2] = Missing.Value; // Format
args7[3] = Microsoft.Office.Interop.Excel.XlRowCol.xlRows; // PlotBy
args7[4] = 0; // CategoryLabels
args7[5] = 0; // SeriesLabels
args7[6] = true; // HasLegend
args7[7] = "chart"; // Title
args7[8] = "Sample Category Type"; // CategoryTitle
args7[9] = "type data"; // ValueTitle
args7[10] = Missing.Value; // ExtraTitle
chart.GetType().InvokeMember("ChartWizard", BindingFlags.InvokeMethod, null, chart, args7);