Visio Guy

Visio Discussions => General Visio => Topic started by: jarogers on August 06, 2009, 12:07:35 AM

Title: Reporting on Connections
Post by: jarogers on August 06, 2009, 12:07:35 AM
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
Title: Re: Reporting on Connections
Post by: scott on August 09, 2009, 07:15:27 PM
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...).
Title: Re: Reporting on Connections
Post by: jarogers on August 18, 2009, 11:13:57 PM
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
Title: Re: Reporting on Connections
Post by: scott on August 19, 2009, 01:56:43 AM
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
Title: Re: Reporting on Connections
Post by: tsuck on May 31, 2010, 03:36:28 PM
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.
Title: Re: Reporting on Connections
Post by: scott on June 01, 2010, 12:29:19 PM
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>.
Title: Re: Reporting on Connections
Post by: tsuck on June 01, 2010, 04:15:00 PM
ooops  :)
thanks a lot.
Title: Re: Reporting on Connections
Post by: scott on June 02, 2010, 12:19:14 AM
no problem...
Title: Re: Reporting on Connections
Post by: tsuck on June 03, 2010, 10:51:38 AM
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
Title: Re: Reporting on Connections
Post by: tsuck on June 03, 2010, 10:57:39 AM
by the way, i work with visio 2007
Title: Re: Reporting on Connections
Post by: scott on June 03, 2010, 11:56:50 AM
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...)
Title: Re: Reporting on Connections
Post by: tsuck on June 03, 2010, 03:02:43 PM
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.
Title: Re: Reporting on Connections
Post by: scott on June 07, 2010, 01:03:23 PM
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:

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.