Convert MS charts from Excel to Word

Hello, We need to create editable charts (MS charts or Ole charts in word). We have license to Aspose Total, so if it is possible to create in one format and convert to another format it should be alright.

Hi Imran,

Thanks for your inquiry. Unfortunately, The requested feature is not supported yet in Aspose.Words. We had already logged this feature request as WORDSNET-4617 in our issue tracking system. I have linked this forum thread to the same feature and you will be notified via this forum thread once this feature is available. We apologize for your inconvenience.

However, you can use Aspose.Cells to create charts and convert the charts to image. Once you have image of chart, you can insert that image to Word document by using Aspose.Words as shown in following code snippet.

// Instantiating a Workbook object
Aspose.Cells.Workbook workbook = new Aspose.Cells.Workbook();
// Adding a new worksheet to the Excel object
int sheetIndex = workbook.Worksheets.Add();
// Obtaining the reference of the newly added worksheet by
// passing its sheet index
Aspose.Cells.Worksheet worksheet = workbook.Worksheets[sheetIndex];
// Adding a sample value to "A1" cell
worksheet.Cells["A1"].PutValue(50);
// Adding a sample value to "A2" cell
worksheet.Cells["A2"].PutValue(100);
// Adding a sample value to "A3" cell
worksheet.Cells["A3"].PutValue(150);
// Adding a sample value to "B1" cell
worksheet.Cells["B1"].PutValue(4);
// Adding a sample value to "B2" cell
worksheet.Cells["B2"].PutValue(20);
// Adding a sample value to "B3" cell
worksheet.Cells["B3"].PutValue(50);
// Adding a chart to the worksheet
int chartIndex = worksheet.Charts.Add(Aspose.Cells.Charts.ChartType.Pie3D, 5, 0, 15, 5);
// Accessing the instance of the newly added chart
Aspose.Cells.Charts.Chart chart = worksheet.Charts[chartIndex];
// Adding Series Collection (chart data source) to the chart ranging from "A1" cell to "B3"
chart.NSeries.Add("A1:B3", true);
// Converting chart to image.
chart.ToImage(MyDir + "Chart.Jpeg", System.Drawing.Imaging.ImageFormat.Jpeg);
Document doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);
builder.InsertImage(MyDir + "Chart.Jpeg");
doc.Save(MyDir + "AsposeOut.docx");

The issues you have found earlier (filed as WORDSNET-4617) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(18)

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan