Hi there,
I am evaluating the use of Aspose in a Visio solution that currently makes use of .VSSX stencils and interop with C#.
I have come across an issue when using the Aspose API to work with the user-defined cells in the shapesheet. In interop I am able to do the following to turn a rectangle shape into a container:
indent preformatted text by 4 spaces
rectangle.AddRow((short)VisSectionIndices.visSectionUser, (short)VisRowIndices.visRowUser, (short)VisRowTags.visTagDefault);
rectangle.CellsU[“User.Row_2”].RowName = “msvStructureType”;
rectangle.CellsU[“User.msvStructureType”].FormulaForceU = “=“Container””; //sets row value to “Container”, makes shape a container
rectangle.AddRow((short)VisSectionIndices.visSectionUser, (short)VisRowIndices.visRowUser, (short)VisRowTags.visTagDefault);
rectangle.Cells["User.Row_3"].RowName = "msvSDContainerResize";
rectangle.CellsU["User.msvSDContainerResize"].FormulaForceU = "=1"; //sets row value to 1, container resizes according to how many shapes are within it
rectangle.AddRow((short)VisSectionIndices.visSectionUser, (short)VisRowIndices.visRowUser, (short)VisRowTags.visTagDefault);
rectangle.Cells["User.Row_4"].RowName = "msvSDContainerMargin";
rectangle.CellsU["User.msvSDContainerMargin"].FormulaForceU = "=20 mm*DropOnPageScale"; //sets the margin between shapes and container edges
I have used the User object in the Aspose.Diagram API to add three rows in the User-defined cells.
The value of the user-defined cell which I have set e.g.
indent preformatted text by 4 spaces
User myUser3 = new User();
myUser3.NameU = "msvSDContainerMargin";
myUser3.Value.Val = "20mm*DropOnPageScale";
rectangle.Users.Add(myUser3);
Only 20 appears in the shapesheet in the row’s value without the remainder “…mm*DropOnPageScale”. The third line in the above example only seems to work for integer values but not string values. I have looked online regarding this issue but to no avail.
I have attached a sample program highlighting my issue. This also includes the .vssx file I am using as well as the output file for reference.
asposeUserDefinedCellsIssue.zip (105.3 KB)
Any guidance/ideas are appreciated. Thank you