We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Please I need Help Chart Didin''t Displayed on Excel Sheet

Thread ID:

Created:

Platform:

Replies:

27647 Apr 15,2005 04:24 AM Windows Forms 0
loading
Tags: XlsIO
Mohammad Abdullah
Asked On April 15, 2005 04:24 AM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;