Share:

" /> Visio Guy » European Cup 2008 Auto-Updating Visio Diagram
Home » Code, Drawings & Templates, Maps & Geography, Shapes, ShapeSheet, Video

European Cup 2008 Auto-Updating Visio Diagram

Submitted by on June 9, 2008 – 1:49 pm | | 25346 views 22 Comments

Read Full Article

Visio is a natural choice for creating brackets for sports tournaments.

I have seen many elimination-tournament diagrams created in Visio over the years. In fact, just a few years ago, a very nice example was done for the 2006 World Cup. You can get it at Office Online here: 2006 World Cup Bracket.

But the trouble with these diagrams is that they require *gasp* manual input of data, or user-movement of shapes. The horror!

Well this year, that is all going to change…

The Way it Should Be

It always seemed to me that the drawing and diagramming should be done by the creator, not by the user. A user should just:

  1. Open the drawing
  2. Click the Update button
  3. Jump for joy

Sounds like a plan, no?

Now Presenting: Automated Drawing

Well, with this wonderfully simple work-flow in mind, I’ve created a bracket diagram for the European Cup 2008 soccer/football tournament. In case you haven’t heard, Euro 2008 is going on right this minute in Austria and Switzerland, and all of Europe is glued to the television.

The diagram looks something like this. You can see the gray and green boxes where some match results are already in:

Those with sharp eyes will notice the Update button in the top-right corner:

You sharp-eyed folks might also notice that the button is ugly. Therefore it was set to Non-printing (via the Format > Behavior dialog), so it won’t besmirch your cubicle wall.

Installation: IMPORTANT!

The Visio drawing contains VBA code that connects to a web service to get the latest scores and data. The diagram visually reflects the scores, the winners, the losers, and those who advance to the next round.

But to use VBA with a web service, your PC will unfortunately need additional components. Here’s the task list to get this thing to work:

  1. Download and install this toolkit from Microsoft:Microsoft Office XP Web Services Toolkit 2.0
    If you don’t, the VBA code will not function.
  2. Enable the VBA macros in the diagram, when you open it. See:VBA Macro Security for more information
  3. Press the Update button in the top-right corner of the document

That’s all there is to it!

Your automated Visio document serves as a sort of digital dashboard, all you have to do is click Update and perhaps Print!

Shape Features

All that automation is nice, but if you don’t want to bother with installing extra dlls from Microsoft, or messing with VBA Macro Security, then the drawing still functions manually.

You can select each box and enter a team name or a score. Winners and losers will be shown, thanks to the underlying SmartShape technology used to create the diagram. Below, we can see that Austria turns green when they defeat Switzerland in the Quarterfinals.

As the finalists become known, country-flag icons will show up to make the diagram even more interesting! In our example, Austria, Switzerland Germany have shown their colors next to each match shape, but Germany still doesn’t have an opponent…

If the score is the same in the final rounds, then a penalty-kick boxes appear, so you can enter the results of a shoot-out. Above, Austria defeated Switzerland 5:2 on penalties.

A note about the penalty kicks: The documentation for the web service that is used to get the match information was not clear on how penalties will be reported.

It might be that the code in this document doesn’t properly handle penalty situations. If so, I will update the drawing so you can download a properly working version. Check back often!

EuroCup 2008 Bracket (v1) (404.94 kB) - 59

Soccer Silliness, Fußball Spaß, Fotbol Brincadera

What technical post would be complete without comedy relief for tired eyes? Here’s a few videos from our sporting friends in Hungary and Italy to get you in the footie spirit!

Great defensive stand, lousy follow-up:

 

The deception that wasn’t:

 

Team schmeam! One man is all you need:

 

 

22 Comments »

  • Lars-Erik says:

    Like Austria is gone make it to the half finals, this clearly has to be a bug! ;)

    Nice that you added the flags! V2 (if theres gone be one) should also fix a small (very small) inconsistency, the group letters start at different points (The ones in the background, B is the most noticeable).

    – Lars

  • Visio Guy says:

    Hi Folks,

    One of our trusty readers (and Visio Experts – he’s arguably Smarter Than Me) had an error with the diagram with Visio 2007 Prop running on Windows Vista.

    He was getting this error:

    There was a problem updating your diagram!

    WSDLService:The PROGID MSSOAP.GenericCustomTypeMapper30 is invalid
    HRESULT=0x800401F3:Invalid class string
    – WSDLREader:Analyzing the WSML file failed HRESULT=0x800401F3:Invalid class string
    -Client:An unanticipated error occurred during the processing of this request.
    HRESULT-0x800401F3:Invalid class string

    Now, he already had the SOAP Toolkit installed, but was able to fix the error by changing (in the VBA code) MSSOAP to ‘MSOSOAP:

    str_WSML = str_WSML & “<using PROGID=’MSSOAP.GenericCustomTypeMapper30′ cachable=’0′ ID=’GCTM’/>”
    became:
    str_WSML = str_WSML & “<using PROGID=’MSOSOAP.GenericCustomTypeMapper30′ cachable=’0′ ID=’GCTM’/>”

    Hopefully this will help some of you, if you’re having problems!

    – Chris

  • Visio Guy says:

    @Lars-Erik,

    You have sharp eyes my son. Let’s use it as an excuse to learn ShapeSheet stuff:

    The header shapes have repeating “AAAAA…”, “BBBBB…”, “CCCCC…”, “DDDDD…” text blocks in them.

    To get this effect, they use a formula like this:

    Fields.Value = =REPT(Sheet.3!Prop.group&” “,0.9*Width/Char.Size)

    So the number of repetitions has to do with the font size, which really means the height of the font.

    The problem is that the “B” for the font is a bit skinnier than “A”, “C” or “D”, so 15 Bs isn’t as wide as 15 As.

    It would really be nice to be able to get character widths in Visio, or normalized string-lengths so that font-sizes, or repetitions could be handled more intelligently vis ShapeSheet formulas.

    – Chris

  • Philippe C says:

    I want to win the sharp-eyed tournament.
    1) Is there a reason why you show the connection points ?
    2) Why is there no place yet for the winner of the tournament ?

  • Visio Guy says:

    Hi Philippe,

    1. Connection points can be turned off under the View menu
    2. Germany will turn green automatically June 25, so I didn’t think we really needed an extra winner shape. Plus, I ran out of space on the page :)

  • Lars-Erik says:

    Would be fun to really implement that second point :)
    Just to see how people would react! I can see Germany getting to the finals…

  • Visio Guy says:

    Ok, let’s have some fun with this…

  • garlandkr says:

    cool! not sure if i’ll use it because i have visio at work and don’t want any spoilers as i watch the matches at home after recording.

    if the oranje can keep it going like that they’ll do very well, but i still have them as bowing out against france in the semis! ;)

    Les Bleus!!! =)

  • Lars-Erik says:

    LOL @ the 3rd movie! It’s hilarious!

  • Roger Cox says:

    Cannot get the bracket to work. Security settings info does not match the sample screens using IE7 with the visioviewer installed. What’s up? The Update icon appears but does nothing.

  • Visio Guy says:

    IE7: nothing to do with it.

    You have to install Microsoft Office XP Web Services Toolkit 2.0

    Update icon? There’s an Update button on the Visio drawing page, when you open the drawing in Visio. Doesn’t work with the Visio Viewer. You have to have Visio installed.

    Good luck,

    – Chris

  • Philippe C says:

    It worked fine utill now.
    Germany has won but has not yet taken its place in the Quarter Finales.

  • Visio Guy says:

    Hi Philippe,

    Thanks for the sharp eyes :)

    I checked a text-dump of the web-service info. They haven’t updated the participants for the semi-finals yet, even though they should have. Let’s give it another day.

    I’m hoping for a penalty-kick situation tonight so I can see if anything breaks, then I can upload all the improvements.

    – Chris

  • Philippe C says:

    That’s what I thought.
    But I didn’t know how to check that at dataaccess.

  • Visio Guy says:

    Ok Folks,

    Croatia lost to Turkey on penalties: 1-1 (P 1-3) I can hear the Turkish honking in the streets.

    Anyway, the code doesn’t yet know what to do with penalty situations, so I’ll post a fix in time for the Netherlands victory over Russia on Saturday :)

  • Visio Guy says:

    …er Russia 3-1…doh!

  • Lars-Erik says:

    Been told they deserved to lose…
    At least now everything can return to normal… I was getting rather sick of the:
    – Drunken supporters
    – Orange flags and crap all over the place
    – Annoying commercials
    – Stupid football songs on the radio

    The country can now, finally, return to ‘normal’

    And it saves people who live in Vienna from ever getting in contact with Dutch supporters!

  • Visio Guy says:

    Yes, but the Dutch were the best team, or at least the best to watch, and they’re just about the only team in the tournament that doesn’t wear RGB(255,0,0)

    Ok, the Germans are black and white.

    I’m not a big soccer fan, because it doesn’t involve a little hard ball and a piece of tree, but I love the spectacle, as long as the fans don’t beat each other up. If you didn’t have things like this, you wouldn’t even know what ‘normal’ is! :) :) :)

    3 months ’til Oktoberfest.

  • Ian says:

    Hoping you can help me on this, given your auto updating scenario! If there is a team of 6 analysts all using Visio to create application wireframes; where the core framework such as top/side navigation need to be kept consistent. Is there a SYNCH type function whereby a master template/asset can be updated and when the analysts SYNCH up their version all of the master assets they have used in their Visio file are updated automatically??? Thanks in advance for any help on this…

  • Visio Guy says:

    Hi Ian,

    Never expected a serious inquiry on this post! :)

    I think you are in need of the mythical “Global Stencil” or “Shared Masters”, which don’t exist, due to the local copies of masters that exist in the Document Stencil of every Visio file.

    So you might need a tool that can replace or update masters that are already in use. There are a few mentioned in this thread on my forum: Update/Replace Shapes Addon

    Are your shapes changing physically, i.e.: in how they look, or are there data fields behind each master/shape that are changing, or both?

    If the utilities aren’t quite what you need, then Visio can be automated (as you have noticed) in quite sophisticated ways. My guess is that you’ll probably need something along these lines, since it looks like you are updating the layout of shapes, not just individual items.

    Let me know either way!

    – Chris

  • Philippe C says:

    I am more interested in the pre-Enlightment sideshow or in future football

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.

*