Visio Guy

Visio Discussions => Shapes & Templates => Topic started by: mmulvenna on February 02, 2009, 05:19:59 PM

Title: Dropping data-linked Title Block Masters
Post by: mmulvenna on February 02, 2009, 05:19:59 PM
I have a scaled drawing started from a template.
I want to drop an unscaled title block master shape onto the drawing.
Within the title block there are text fields that I want to update from a Database.

I can do this all in the drawing just fine.
  - Drop master shape
  - Link Data base
  - Insert fields into the text box

and it all works just fine.

My question is how do I do all of this in the master of the stencil so that it is all accomplished when I drop the master on the page?

When I edit the master for the stencil the LINK DB functions are greyed out.

Do I need to do this programmatically using data recordsets etc?

As always thanks for any help anyone can provide.

Mike


Title: Re: Dropping data-linked Title Block Masters
Post by: Visio Guy on February 02, 2009, 05:42:53 PM
Hi Mike,

You mean you want to edit the master first, fill out the data, then drop it on several pages?

Are you stuck on the data linking or dropping, or what?
Title: Re: Dropping data-linked Title Block Masters
Post by: mmulvenna on February 02, 2009, 05:45:46 PM
I want the master to have the data links enabled so I dont have to do it everytime I drop the stencil.

I am beginning to think I have to do the link programatically after the shape is drop on the page.
Mike
Title: Re: Dropping data-linked Title Block Masters
Post by: Visio Guy on February 02, 2009, 05:48:58 PM
I think you can link the shape to data, then create a new master out of it and re-use it. I haven't actually done it, but I'm pretty sure that David Parker does this a lot and mentions it in his book. (http://www.amazon.com/gp/product/007148261X?ie=UTF8&tag=wanderkind-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=007148261X)

You can also create Visio 2007 data links programmatically!
Title: Re: Dropping data-linked Title Block Masters
Post by: mmulvenna on February 02, 2009, 05:51:21 PM
Yes I have done that and the links do carry to the new master. The data source however does not.

Guess i will go the programatic route.

As always thanks
Title: Re: Dropping data-linked Title Block Masters
Post by: Visio Guy on February 02, 2009, 05:56:48 PM
OHHHHH! Your data source doesn't get yanked into new drawings, eh?

You could probably write it into the shape/master (if it isn't already -- I haven't looked at all the user-cells in a whille...)
Title: Re: Dropping data-linked Title Block Masters
Post by: mmulvenna on February 02, 2009, 05:58:23 PM
Thanks I will take a look at that.
Title: Re: Dropping data-linked Title Block Masters
Post by: aledlund on February 02, 2009, 10:42:11 PM
as a note from the side
"Every Visio 2007 Document object has a DataRecordsets collection, which is empty until a connection is made to a data source" The association between the recordset and the datasource is stored in the document when the recordset is loaded. You might consider keeping the "load code" in the stencil with the master (a lot of benefits since the stencil can be handled as a document with associated docsheet to store attributes).
al
Title: Re: Dropping data-linked Title Block Masters
Post by: mmulvenna on February 03, 2009, 12:58:32 AM
Quote from: aledlund on February 02, 2009, 10:42:11 PM
as a note from the side
"Every Visio 2007 Document object has a DataRecordsets collection, which is empty until a connection is made to a data source" The association between the recordset and the datasource is stored in the document when the recordset is loaded. You might consider keeping the "load code" in the stencil with the master (a lot of benefits since the stencil can be handled as a document with associated docsheet to store attributes).
al


Thanks a lot, I was just looking at the DataRecordsets Collection, sounds like just what I need
Title: Re: Dropping data-linked Title Block Masters
Post by: mmulvenna on February 04, 2009, 01:31:25 AM
Quote from: mmulvenna on February 03, 2009, 12:58:32 AM
Quote from: aledlund on February 02, 2009, 10:42:11 PM
as a note from the side
"Every Visio 2007 Document object has a DataRecordsets collection, which is empty until a connection is made to a data source" The association between the recordset and the datasource is stored in the document when the recordset is loaded. You might consider keeping the "load code" in the stencil with the master (a lot of benefits since the stencil can be handled as a document with associated docsheet to store attributes).
al


Thanks a lot, I was just looking at the DataRecordsets Collection, sounds like just what I need


Update,

I found that the Data Base Wizard in the tools/add on/visio extras allows a data base to be linked to a master stencil. After a litlle playing with it, it works just fine without having to do any programming. ;D ;D ;D

Thanks to everyone for their suggestions.

Mike
Title: Re: Dropping data-linked Title Block Masters
Post by: wapperdude on February 04, 2009, 01:59:29 AM
Senior guys rock!   :D
Title: Re: Dropping data-linked Title Block Masters
Post by: mmulvenna on February 04, 2009, 02:45:44 AM
Quote from: wapperdude on February 04, 2009, 01:59:29 AM
Senior guys rock!   :D

:) :) :) :)