Hello,
we use Aspose.Cells for .NET to work on Excel-reports that contain charts and labels. One of the things we need to do is merging a number of charts to a new file.
This task worked well in previous versions of Cells. Unfortunately, using the most recent versions the Textboxes on the Charts are not visible in some cases.
I’ve included two sample files and a result file created here that shows the label on Chart 2 is not visible anymore. Additionaly I’ve added some code that shows that the Shape itself seems to be included in the file - but it’s not visible when you open the file in Excel.
Here is some code to merge the input files:
And here is some code to show that the shape is still in the file:// Load template and remove all not needed worksheetsvar chartNames = new string[] { “Chart 1”, “Chart 2” };var template = new Workbook(@“C:\temp\Template.xlsx”);var checkIndex = 0;while (template.Worksheets.Count != chartNames.Length){if (!chartNames.Contains(template.Worksheets[checkIndex].Name)){template.Worksheets.RemoveAt(checkIndex);}else{checkIndex++;}}// merge filesvar source = new Workbook(@“C:\temp\source.xlsx”);source.Combine(template);// save and closesource.Save(@“C:\temp\Result.xlsx”);source.Dispose();template.Dispose();
// Check - open result and lookup textboxvar result = new Workbook(@“C:\temp\Result.xlsx”);var shapeText = result.Worksheets[“Chart 2”].Charts[0].Shapes[0].Text;Console.WriteLine(shapeText); // Output: Mittelflüsse EUR % Sum %