Hi Team,
We are using Aspose.Word.dll ver 6.3.0.0 and Aspose.Cell.dll ver 4.9.0.0 we have licenced for both.
Objective:-We want to copy chart from excelsheet to word doc.
Problem:- Excelsheet has chart and chart contain 2 series (series1,series2) when i copy chart from excelsheet to word doc as a image then one of the chart series is shrinking.
Attachement i) snapshot of word doc . ii) Chart Excelsheet.
i am using this following code for that:-
//////////////////////////////////////////
Workbook myWorkbook = new Workbook();
Document templateDocument = new Document(wordDocumentFilePath);
DocumentBuilder documentBuilder = new DocumentBuilder(templateDocument);
foreach (Worksheet myWorksheet in myWorkbook.Worksheets)
{
foreach (Chart myChart in myWorksheet.Charts)
{
try
{
string bookMarkName;
if (myWorksheet.Name.IndexOf("(") > 0)
{
bookMarkName = myWorksheet.Name.Substring(0, myWorksheet.Name.IndexOf("("));
}
else
{
bookMarkName = myWorksheet.Name;
}
if (templateDocument.Range.Bookmarks[bookMarkName] != null)
{
builder.MoveToBookmark(bookMarkName);
builder.InsertImage(myChart.ToImage());
}
}
catch (Exception ex)
{
//Program.LogException(ex);
}
}
}
templateDocument.Save(@"E:\DocumentTemplate\GeneratedDocument.docx"));
//////////////////////
This problem is occuring on our live server so please provied the solution ASAP.
Thanks
Samanvay