Cannot get SmartArt Text

I’m using Aspose.Cells to process Excel Files. I have an XSLX file with various Shapes and SmartArt. I can easily loop through the Worksheet.Shapes to get all the shapes - whether it was a normal Shape or SmartArt shape. But, the TEXT property is only filled out in the normal Shape objects, not in the SmartArt Shapes. Is there another property or collection I should be looking at to get the TEXT for a SmartArt Object?

We are using Aspose.Cells for .NET, Version 17.2.0.0.

Thank you in advance!

@caramanica,

Thanks for providing us some details.

Could you try our latest version/fix: Aspose.Cells for .NET v17.10.4 if it makes any difference:

If you still find the issue with v17.10.4, kindly provide us your template Excel file (containing the smartart shapes), we will check it soon.

I just tried with version 17.9.0.0 for .NET 4.0. I’ll try with 17.10.4 as well. Here is the file.

Thank you so much!

Demo-Shapes.xlsx.zip (31.8 KB)

I tried with 17.10, same result. This is what I see when debugging and looking at the shape.

SmartArt-Shape-Text.png (41.5 KB)

@caramanica

Thanks for your posting and using Aspose APIs.

We were able to observe the issue and logged it in our database for investigation and for a fix. Once, the issue is resolved or we have some other news for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-45755 - Unable to get Text of Smart Art Shape

@caramanica

Thanks for using Aspose APIs.

This is to inform you that we have fixed your issue CELLSNET-45755 now. We will soon provide the fix after performing QA and including other enhancements and fixes.

Thanks! I can’t wait to try the fix.

The issues you have found earlier (filed as CELLSNET-45755) have been fixed in this Aspose.Cells for .NET 17.11 update.

Please also check the following article:

1 Like

Hi Support. I have tried again to with Aspose.Cells 17.11 - but still cannot get the Text from a SmartArt Shape. Is there another property I should be using besides “Text”?

aspose-117.11-SmartArtText.png (374.6 KB)

Here is what I was expecting to get.

SmartARt-Text.png (378.6 KB)

@caramanica

Thanks for using Aspose APIs.

Please use the Shape.GetResultOfSmartArt() method to convert your shape into group shape. Please use the Shape.IsSmartArt property to determine if shape is a smart art shape.

Please see the following sample code and its console output for your help.

C#

//Load source Excel file
Workbook wb = new Workbook("Demo-Shapes.xlsx");

//Access first worksheet
Worksheet ws = wb.Worksheets[0];

//Access this Smart Art Shape
Shape smShape = ws.Shapes["Diagram 4"];

//Check if this shape is smart art shape
if (smShape.IsSmartArt == true)
{
    //Convert it to group shape and access all indvidual shapes
    Shape[] shapes = smShape.GetResultOfSmartArt().GetGroupedShapes();

    foreach (Shape s in shapes)
    {
        Debug.WriteLine(s.Text);
    }
}//end if

Console Output

Seinfeld
Jerry
Elaine
Kramer
George

Home Improvement
Tim
Al

Modern Family
Jay
Gloria
Claire
Phil

Reference Links:

Awesome! Thank you so much Shakeel! That worked great for me.

@caramanica

Thanks for your posting and using Aspose APIs.

It is good to know that you are now able to get the smart art shape text successfully. Let us know if you encounter any other issue, we will be glad to look into it and help you further.