Hi
Please See the following Code , I''m trying to display a chart but I tried many times without any result , here is a code for display the chart:
IWorkbook myWorkbook = ExcelUtils.CreateWorkBookUsingTemplate (Application.StartupPath + @"\\repDepInfobigFormat.xls");
//The first worksheet object in the worksheets collection is accessed.
IWorksheet SheetAll = myWorkbook.Worksheets[0];
IWorksheet SheetInfo = myWorkbook.Worksheets[1];
IWorksheet SheetSearch=myWorkbook.Worksheets [2];
IWorkbook myWorkbook1 = ExcelUtils.CreateWorkBookUsingTemplate (Application.StartupPath + @"\\ChartrepDepInfobigFormat.xls");
IWorksheet SheetChart = myWorkbook1.Worksheets[0];
IChartShape Chart = SheetChart.Charts.Add();
// Chart.ChartType=ExcelChartType.Pie_Exploded;
Chart.ChartType=ExcelChartType.Bar_Clustered_3D ;
Chart.ChartTitle="الجاهزية - القوى العاملة للقطاع";
Chart.IsDataTableVisible = true;
Chart.LegendPosition=ExcelLegendPosition.Bottom;
Chart.Series.Add(SheetChart.Range[8,7].Text);
Chart.Series[0].Values=SheetChart.Range[8,8,11,8];
Chart.Series.Add(SheetChart.Range[9,7].Text);
Chart.Series[1].Values=SheetChart.Range[9,8,11,8];
Chart.Series.Add(SheetChart.Range[10,7].Text);
Chart.Series[2].Values=SheetChart.Range[10,8,11,8];
Chart.Series.Add(SheetChart.Range[11,7].Text);
Chart.Series[3].Values=SheetChart.Range[11,8,11,8];
Chart.CategoryAxisTitle ="القوى العاملة";
Chart.TopRow=6;
Chart.BottomRow=29;
Chart.LeftColumn =6;
Chart.RightColumn =1;
myWorkbook.SaveAs(Application.StartupPath + @"\\repDepInfobig.xls");
myWorkbook1.SaveAs(Application.StartupPath + @"\\ChartrepDepInfobig.xls");
// SheetAll.Range["A10"].Formula = "SUM(B10:J10)";
// SheetAll.Range["A12"].Formula = "SUM(B12:J12)";
// SheetAll.Range["A14"].Formula = "SUM(B14:J14)";
// SheetAll.Range["A16"].Formula = "SUM(B16:J16)+A14";
// SheetAll.Range["A18"].Formula="SUM(B18:J18)+A16";
//No exception will be thrown if there are unsaved workbooks.
excelEngine.ThrowNotSavedOnDestroy = false;
excelEngine.Dispose();
//Launching the Excel file using the default Application.[MS Excel Or Free ExcelViewer]
System.Diagnostics.Process.Start(Application.StartupPath + @"\\repDepInfobig.xls");
System.Diagnostics.Process.Start(Application.StartupPath + @"\\ChartrepDepInfobig.xls");
--->
Please See the Attached File Go to void (PrintBigdata) to check the code.
Thanks
Chart_1730.zip
Chart_6199.zip