Reporting on Connections

Started by jarogers, August 06, 2009, 12:07:35 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jarogers

Hello,
Im trying to find some way of creating an excel report that shows what shape are at the beginning of a connector and what shape is at the end?
Can this be done?

Thanks so much,
Cheers,
Jason

scott

It's always seemed odd to me that the currently released versions of Visio don't have a built-in notion of "connectedness" (Visio 2010 does have better capabilities for determining what is connected to what; watch for additional information about this...)

However, with a bit of code and Visio's built-in reporting capability, you can create an Excel report showing what's at the beginning and end of each connector. If you want a very complete description, check out this article:
   http://www.visguy.com/2009/04/22/analyze-connectivity-between-process-flows/

If you want a quick-and-dirty solution, try the code below. Both samples do essentially the same thing -- they store the text of the shape at each end of a connector in "From" and "To" data fields in the connector shape. The only difference between the two code samples is that one creates and uses shape data fields (aka custom properties) in case you want to be able to access the "From" and "To" data via the Visio user interface. The second sample utilizes USER fields so the data is there but is less accessible from the UI.

In either case, run the macro on your drawing and it will save the text of the shapes at the ends of each connector. Then you can create a report and send the output to Excel to see the results (Visio 2007: select Data/Reports... from the Visio main menu; Visio 2003: I think it's Tools/Reports...).

jarogers

Hello Scott,

Thanks for the post!

Looks like the second idea you had, the (quick and dirty) one
would work perfectly...but cant seem to get it to work?
i run the macro, but the to/from properties fields do not populate?
also... any way to have them populate dynamically or automatically? so that the user doesn't have to run a macro each time?

Thanks,
Jason

scott

Jason,

I'm pretty sure the code does work... are you running the version that creates custom properties or that creates user fields? In the latter case, you'll only see the From and To fields in the shapesheet for each connector line in the flowchart. Is the problem that you don't see the data in the report wizard or that you can't find it at all?

Scott

tsuck

hi Scott
i used the code, and it worked fine (i can see the "from" and "to" entities names on the report). but...
i would like to see the connector name in the report as well, in addition to the "from" and "to" entities. is it possible ?
thanks a lot, tsuck.

scott

Not only is it possible but it doesn't require any code changes. You merely need to modify the report definition and include the field called <Displayed Text>.

tsuck


scott


tsuck

hi again.
i have another question, if you don't mind.
when i open a file using "Determine_flowchart_paths_--_USER.vsd", everything works fine.
but what if i want to activate the macro on a new file i made from scratch ?  i dont see the macro when i go through tools-->macro-->macros...
thanks a lot, tsuck

tsuck

by the way, i work with visio 2007

scott

The macro was designed to run on the "active" document in Visio, which is the one "on top" inside the Visio Window. Therefore, if you want to run the code on a new document you've created: 1) open "Determine_flowchart_paths_--_USER.vsd"; 2) open your document; 3) select Tools>Macro... to run the macro.

As an alternative, you could copy and paste the macro into your own document, but you may or may not want to have it in every document. (If you want help doing this, just ask...)

tsuck

since i want to use the macro on all the drawings i will make (both the macro and the report), i will very much appreciate your help with the alternative you described.
thank you very much, tsuck.

scott

The easiest way to include the macro in every document is to save it in a template and then create your new documents from that template. To do so:

  • Create a new document based on whichever current template you want to use as the starting point
  • Open the drawing containing the macro
  • Press ALT+F11 to open the Visual Basic Editor
  • Copy the macro code from the ThisDocument module of my document into the ThisDocument module of the document created from your template
  • Save the working document as a template

To have your template appear on Visio's File>New menu (among other places), store the path to the template file next to the Template entry in Tools>Options>Advanced>File Paths.