Visio Guy

Visio Discussions => General Visio => Topic started by: retroviz on August 05, 2009, 04:59:16 PM

Title: Visio Data Binding 1 shape to many records
Post by: retroviz on August 05, 2009, 04:59:16 PM
Hi there. Hopefully someone can help me.

In Visio I see it possible to bind properties of a shape to an external database.

In my case I want to have a floor plan with desk information being retrieved from a database:

Desk Reference (e.g. D1)
Allocation (e.g. user or site)
Name (e.g. name of user or name of department).

This seems easy enough. However, I need to display on the shape the network ports that are attached to this desk. In my database I have a DeskPortMapping table that stores these assignments. One key point is that the number of ports on each desk can be variable (so I cannot create fields for Port1, Port2, Port3 etc.).

I cannot see how to display multiple records inside one shape. Ultamately I want my desk to display like so:

Desk Ref: D1
Allocation: User
Name: John Smith
Port 1134 - Network
Port 1135 - Printer
Port 1136 - Phone
Port 1137 - Blank

I then may have another desk like:

Desk Ref: D2
Allocation: Site
Name: Accounts
Port 1118 - Printer
Port 1119 - Blank

I suppose one way would be to dynamically generate the port details at database level so in fact it does map to just one property on the shape.

Has anyone done anything like this before? I would be interested to know what technique was used.

Ideally I would like to drag a desk onto the drawing, select a db record and show all the above information on the shape.

Thanks,

Ben





Title: Re: Visio Data Binding 1 shape to many records
Post by: Visio Guy on August 05, 2009, 05:12:39 PM
Hey Ben,

Just a quick check, are you using Visio 2007 Pro? I'm pretty sure you can map different databases to different fields on a shape, but I've no time to check right now, off to the biergarten (http://www.google.de/maps?f=d&source=s_d&saddr=48.143654,11.550906&daddr=&hl=de&geocode=&mra=mi&mrsp=0&sz=20&sll=48.143469,11.551341&sspn=0.000573,0.001367&ie=UTF8&ll=48.143643,11.550912&spn=0.000573,0.001367&t=h&z=20) right now...
Title: Re: Visio Data Binding 1 shape to many records
Post by: retroviz on August 05, 2009, 06:42:51 PM
Hi, I am using Visio 2003 but if I can use Visio 2007 for this then I will get that.
Title: Re: Visio Data Binding 1 shape to many records
Post by: retroviz on August 06, 2009, 03:32:16 PM
Think ive answered my own question. You can not link to multiple rows in the same recordset in visio so I think my original thought of creating the list of ports at the database level will be the most suitable.

Thanks for your help anyway.
Title: Re: Visio Data Binding 1 shape to many records
Post by: Visio Guy on August 06, 2009, 04:50:03 PM
This article might be worth a look, anyway: 12 Month Data Graphic Shape (almost) (http://www.visguy.com/2007/04/25/12-month-data-graphic-shape-almost/)