Hi all,
I’m trying to fill date value in Page shape data. Format in Visio (in Define Shape Data) is: Type = Date, Format = {{dd/MM/yyyy HH:mm:ss}} and Calendar = Gregorian. My code:
indent preformatted text by 4 spaces
Diagram diagram = new Diagram("c:\\tmp\\Template.vstx");
try {
Page page = diagram.getPages().get(0);
PropCollection pagePropCollection = page.getPageSheet().getProps();
for (int i = 0; i < pagePropCollection.getCount(); i++) {
Prop prop = pagePropCollection.get(i);
String name = prop.getName();
String value = "";
if (name.equals("ARIS_GUID")) {
value = "6fc48f98-9763-11e9-09a3-000d3a2af140";
} else if (name.equals("AT_CREAT_TIME_STMP")) {
value = "08/04/2019 17:12:20";
}
if (!value.equals("")) {
prop.getValue().getUfev().setF("");
prop.getValue().setVal(value);
}
}
DiagramSaveOptions diagramSaveOptions = new DiagramSaveOptions(SaveFileFormat.VSDX);
diagram.save(outputFileName, diagramSaveOptions);
Unfortunately, it is not displayed correctly. I can see value “07/01/1900 00:00:00” in Visio.
Can you help me, please?
See attached code, template, result and screenshot.
I’m using:
aspose-diagram-22.10.0.jar
Microsoft® Visio® Plan 2 MSO (Version 2210 Build 16.0.15726.20188) 64-bit
BR
Attachments.zip (57.8 KB)