We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Retrieve User defined Cells from Shape

Hi,
we are very Interested for the comercial Use of Aspose.Diagram for Java in our Company. For the Topic User defined Cells i have obe Question:
Our Visio Document contains one Shape with one User defined Cell (see attachement ZIP File with Shape and Java Code Example).
(Name: User.Rad Value: 0 (Defaultvalue) / Prompt: No Formular"
Starting to read the Visio and try to get the User defined Cells, no User Cells Object will be returned (see start-java-first-time.png). Change the Shape User Cell, save Visio and try again, we receive the one Cell with correct Values (see output-after-changing-cell.png).
Is is possible, to read all the User Cells without changing the Shape Cell Data (Right Click to the Context Menu), so i can get all User Cells with the default Values ?

thanks

Stefan

Hi Stefan,


Thank you for contacting support. We have tested your sample Visio diagram against the latest build of Aspose.Diagram for Java 5.6.0 and managed to replicate the problem of not retrieving user defined cell of the shape. We’ve logged this issue under ticket id DIAGRAMJAVA-50223 in our bug tracking system. Your post has also been linked to this issue. We’ll keep you informed regarding any available updates. We’re sorry for the inconvenience caused.

HI Stefan,


Thank you for being patient. Please download the latest version of Aspose.Diagram for Java 5.7.0 API and update the sample code as follows:

[Java]
int count = 0;

// load Visio diagram
Diagram diagram = new Diagram(“C:\temp\synchronisierung.vsd”);

// Iterate through pages
for(Page page : (Iterable) diagram.getPages())
{
// Iterate through shapes
for(Shape shape : (Iterable) page.getShapes())
{
System.out.println(shape.getNameU());
// Iterate through user-defined cells
for(User userField : (Iterable) shape.getMasterShape().getUsers())
{
count++;
System.out.println(count + " - Name: " + userField.getNameU() + " Value: " + userField.getValue().getVal() + " Prompt: " + userField.getPrompt().getValue());
}
}
}

Please let us know in case of any confusion or questions.

Note: Issue id DIAGRAMJAVA-50223 has now been closed as won't fix status.