Visio Guy

Visio Discussions => General Visio => Topic started by: jimibray on September 17, 2020, 03:37:41 PM

Title: Reports and Layers
Post by: jimibray on September 17, 2020, 03:37:41 PM
Hi,

In the Reporting functionality on Visio 2016 I know you can determine the scope of a report to look at specific layers but I'd like to have one report which includes layer name and then do some data manipulation in excel after.

I'd like to include "Layer Name" as a column in my report but it doesn't appear in the properties list - I was expecting to see it in this format <Layer Name>.

Is it possible to include layer name in a report?

Thanks,
James
Title: Re: Reports and Layers
Post by: jimibray on September 25, 2020, 01:31:14 PM
So I've been looking into this and I can see in the shape sheet there's a field for layer membership (=LayerMember) which returns an index value and made me think I should be able use that to get the layer name - Layer.Name(LayerMember), but that didn't work.

It looks like the information around layers isn't accessible in shapesheet and would need some code, but I'm not sure how to construct this!

I think I want an IF statement saying:
IF a shape is assigned to a layer,
THEN write the layer.name to the shape property "Prop.Layer".
ELSE do nothing

Looking at the macro for writing the connection info into a property field I think my THEN element would be:

shp.CellsU("Prop.Layer").FormulaU = "sheet." & shpFrom.ID & "!Layer.Name"


But I'm not sure how to write the initial if statement to even test this!

Thanks,
James
Title: Re: Reports and Layers
Post by: wapperdude on September 25, 2020, 08:13:57 PM
Did you search the forum???

Try this link:  http://visguy.com/vgforum/index.php?topic=8635.msg37654#msg37654 (http://visguy.com/vgforum/index.php?topic=8635.msg37654#msg37654)  Both the 3rd and 2nd responses ought to help.
Title: Re: Reports and Layers
Post by: jimibray on September 28, 2020, 10:45:24 AM
Hi Wapperdude,

I did search the forum, but I think i search the General sub-forum rather than the whole forum!  ???

The item you linked to is about using a macro to apply a layer to a shape (using the name and not the index). But what I want to do is write the layername into a property field so I can include it in my shape report.

<Layer Name> doesn't exist in the report drop down (as per the image in post 1) so I need to write the layername into a property that I can then include in my report.

I want to use layers so I can quickly mass select a bunch of shapes and put them on a layer to allow grouping in my report - I feel this is quite a user friendly interaction as opposed to adding a property that has to be populated by the user for each shape.

I will keep searching in the right place and add any useful links here if I find a solution to my querry.

Thanks,
James
Title: Re: Reports and Layers
Post by: mark_s on February 19, 2021, 09:02:11 AM
For anyone else looking , the easiest way i found was, select by layer the add shape data to the layer, say cable layer or something, then run the report and select that.