Cannot open files in Visio Web Access

Hi,

I have a problem opening Visio files inside SharePoint.

I create some Visio Drawing by using Aspose.Diagrams and saving with

                DiagramSaveOptions options = new DiagramSaveOptions(SaveFileFormat.VSDX);
                options.AutoFitPageToDrawingContent = false;
                diagram.Save(outputFilePath, options);

Then I copy the files to a SharePoint document library which inside a Visio Service enabled site collection.

If I now try to view this drawing inside SharePoint using Visio Services (VisioWebAccess) it fails saying
“Visio Web Access kann dieses Diagramm nicht anzeigen. Stellen Sie bitte sicher, dass dieses Diagramm eine gültige Visio-Zeichnung ist.” which means
“Can’t open file. Assures that this is a proper Visio file”.

If I open this drawing inside the Visio 2016 desktop application it shows without error. Saving this same file once without any changes in Visio 2016 an uploading it again to SharePoint seems to repair the somehow broken file. From then on I can properly view the file in VisioWebAcces inside SharePoint.

I already tried different fileTypes and options and also tried opening and saving the diagram by aspose.diagrams again. But the only method that seems to fix the file ist to open and save in Visio 2016. (Which BTW is not an option as I’m talking about >1000 files)

Do you have any suggestions how to make this file be readable by VisioWebApp inside SharePoint?

@dvvde,

Did you try to open the output Visio drawing into the Visio Web application without SharePoint? Kindly send us the complete details of the use case, including source Visio drawing, code and let us know which Aspose.Diagram for .NET API version you are using. We will investigate and share our findings with you.

Hy and thanks for your answer.
I didnt tried to open the File in the VISIO Webapplication, but i will try it if we have the client to do it.

The program have to make Diagrams with the help of a CSV File. There in is the info about the shape lenght, X and Y Positions, what the shape is called by name and so on. That CSV is generated in an other Program.
The Version of Aspose.Diagram we use is: 17.7.0.0, the runtimeverson is: v4.0.30319

DiagramGenerator.zip (209.7 KB)

I have uploaded some of the generated Files we needed for the SharePoint and the required Program-Components. In the Directory “All Files” is a VSDX called “Vorlage.vsdx” to make the Program run properly, furthermore theres the CSV, PNG, SVG and the proper VSDX Files.

@dvvde,

We are investigating your project application and will get back to you early next week.

Hi,

I was able to solve this. Unfortunately, it had nothing to do with Aspose, but was a misconfiguration of our SharePoint server. Missing permissions for the service user on the Visio Cache-Folder ( C:\Program Files\Microsoft Office Servers\16.0\Data\VisioServer ).

Sorry, mixed it up. The server had some permission issues, but after fixing them the problem persists. VSDX-File generated by Aspose.Diagrams cannot be opened in VisioWebAccess, but if I open and save these Diagramswith Visio 2016 I can open them with VisioWebAccess afterwards.

Further error messages vom VisioWebAccess:

_Failed to generate raster diagram for file http://PATH_TO_FILE.vsdx page 0 Error : System.ServiceModel.FaultException`1[Microsoft.Office.Visio.Server.GraphicsServer.VisioGraphicsServiceFault]: Der Ersteller dieses Fehlers hat keinen Grund angegeben. (Fehlerdetail ist gleich Microsoft.Office.Visio.Server.GraphicsServer.VisioGraphicsServiceFault).

and

Failed to generate raster diagram for file http://PATH_TO_FILE.vsdx page 0 Error : System.ServiceModel.FaultException`1[Microsoft.Office.Visio.Server.GraphicsServer.VisioGraphicsServiceFault]: Der Ersteller dieses Fehlers hat keinen Grund angegeben. (Fehlerdetail ist gleich Microsoft.Office.Visio.Server.GraphicsServer.VisioGraphicsServiceFault).

Here’s the stack trace from VisioWebAccess:

RenderingWorker.Run(RequestId=d6bf90a2494940e7ab94f8fadf8bca17): Exception=System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt. bei
Microsoft.Office.Visio.Utility.ManagedTextServices.SetParagraphFormat(Double indentFirst, Double indentLeft, Double indentRight, Double lineSpacing, Double afterSpacing, Double beforeSpacing, Byte horizontalAlign, Byte bullet, String bulletString, String bulletFont, Byte localizeBulletFont, Double bulletFontSize, Double textPositionAfterBullet, Byte flags) bei Microsoft.Office.Visio.Server.TextServices.TextServices.SetFormatForParagraphs() bei Microsoft.Office.Visio.Server.TextServices.TextServices.SetAllProperties() bei Microsoft.Office.Visio.Server.TextServices.TextServices.ComposeText(Boolean collectTextRuns, Int64 pageID) bei Microsoft.Office.Visio.Server.Render.RenderingText.Translate(Boolean applyShadow) bei Microsoft.Office.Visio.Server.Render.RenderingShape.TranslateText(Shape currentShape, GroupShapeBuilder gsb, Boolean applyShadow) bei Microsoft.Office.Visio.Server.Render.RenderingShape.Translate(Boolean applyTransform) bei Microsoft.Office.Visio.Server.Render.RenderingShape.Process(Boolean applyTransform, IRenderingObserver observer) bei Microsoft.Office.Visio.Server.Render.RenderingPage.ProcessShapes(Page page, IRenderingObserver observer) bei Microsoft.Office.Visio.Server.Render.RenderingPage.Translate(Page page, IRenderingObserver observer) bei Microsoft.Office.Visio.Server.Render.RenderingEngine.ProcessPage(Page page, IRenderingObserver observer) bei Microsoft.Office.Visio.Server.GraphicsServer.RenderingWorker.BuildRenderingPage(RasterPageRequest request, SimpleDocument simpleDocument) bei Microsoft.Office.Visio.Server.GraphicsServer.RenderingWorker.CreateRasterPage(SimpleDocument simpleDocument, Boolean& setModelReady) bei Microsoft.Office.Visio.Server.GraphicsServer.RenderingWorker.InternalRun(Boolean& setModelReady, Boolean& endAggregate) bei Microsoft.Office.Visio.Server.GraphicsServer.RenderingWorker.Run()

@dvvde,

You are retrieving data from CSV files and building a drawing on the template drawing, but you have shared CSV and output VSDX drawings. Please send the template drawings, SharePoint version and list down all configuration steps to replicate this error in our environment. Your response is awaited.

The version is the SharePoint 2016 Enterprise with Visio Services activated.

Upload VSDX to any document library.
Activate VISIO Features for site collection.
Try to open VSDX in Web_viewer from document library. -> Error MSG.

There are two templates in the upload.

Temps.zip (51.2 KB)

@dvvde,

We have logged an investigation under the ticket ID DIAGRAMNET-51396 in our issue tracking system. We will try to replicate this error in our environment and let you know about our findings.

You have shared multiple files and it is causing a confusion. In your project application, Generator.GenerateDiagram method takes 3 parameters kindly define all 3 parameter strings or only file names.

I am happy to do so, at first parameter you have give the path of the CSVFile, the second ist the pattern path and at last parameter you have to give the savedirectory path.

For example:

DependencyDiagramGenerator.Generator.GenerateDiagram(@“c:\Temp\FileName.csv”, @“c:\Temp\PatterName.vsdx”,@“c:\Temp\CSVSaveName”);

Important to know is, that the CSVSaveName ist just the name, without datatyp, maybe you can use the variable: csvSaveName in the program for your tests.

The PatterName is Vorlagea3.vsdx, or Vorlagea4.vsdx. Not sure which one you have to test.

Hope that will help you.

I also attached the different output files (output-files.zip) (115.4 KB) generated by Aspose.Diagrams and Visio 2016. When comparing the unzipped VSDX-files it shows that the files generated by Aspose.Diagrams are much shorter than those generated by Visio 2016.
The file “aspose.vsdx” was generated by the above program. “visio.vsdx” was generated by opening “aspose.vsdx” in Visio 2016 an saving it again without any modifications.

@dvvde,

We have tried various combinations as per all your files, but the output VSDX drawings are not same as you shared. For each combination, the project application throws an error while saving output drawing in the PNG format. Anyways, we have recorded your recent drawings for the testing purposes. We will let you know once a significant progress has been made in this regard.

Hy,

the Problem seems a result after a text is add to the Shape.
After the Txt Object is added ( no matter, if you make an explicit object or not) theres no Viso Web Access.

            Shape shape = diagram.Pages[pageIndex].Shapes.GetShape(diagram.AddShape(1, 1, 1, 1, "Feld", pageIndex));
            shape.Text.Value.Add(new Txt("Hy, this is my Shape"));
            Txt shapeText = new Txt("Hy, this is my Shape");
            Shape shape2 = diagram.Pages[pageIndex].Shapes.GetShape(diagram.AddShape(1, 1, 1, 1, "Feld", pageIndex));
            shape2.Text.Value.Add(shapeText);

If there is no Txt Object added, to the Shape it can be used.

The nedded files are in the upload.
Thx for your help.

Web.zip (18.0 KB)

@dvvde,

We have logged this information under the same ticket ID DIAGRAMNET-51396 and will let you know once a significant progress has been made in this regard.