Book Image

Mastering Data Visualization with Microsoft Visio Professional 2016

By : John Marshall, David Parker
Book Image

Mastering Data Visualization with Microsoft Visio Professional 2016

By: John Marshall, David Parker

Overview of this book

Microsoft Visio Professional is a data visualization application that is used by many different market sectors and many different departments to represent information visually, from network infrastructure to organization charts, from process diagrams to office layouts. Starting off with a brief introduction to Visio Professional 2016 and then moving on to data storage, linking data to shapes, and working with SQL Server to create a solid foundation. Then we’ll cover topics such as refreshing data, working with geographical data, working with various graphics, and diagrams, and more. Finally, you’ll find out how to deploy custom stencils, templates, and code.
Table of Contents (17 chapters)
Mastering Data Visualization with Microsoft Visio Professional 2016
Credits
About the Author
www.PacktPub.com
Preface
Index

The evolution of data in Visio before the Microsoft acquisition


The period between the years 1992 and 2000 saw Visio burst onto the scene and rapidly grow in size, acquiring almost every other product that used its drawing system. The first sales target was to out-sell the best-selling flowcharting tool of the time, ABC Flowcharter. This was done within 18 months, and Visio was on its way.

Beyond the Standard Edition was the Technical Edition, which contained CAD and engineering add-ons, and the Professional Edition, which contained database modelling and network diagramming. Eventually, there was also the Enterprise Edition with network discovery.

Note

Visit http://www.visiocorp.info/boxes.aspx for more information on the Visio Corporation.

The timeline displays the most relevant milestones of data diagramming, and a short explanation of each follows. They are relevant because these features still exist, and there are still code examples out there that use them.

v1.0 – modifiable ShapeSheets

The intelligence in Visio comes from its unique modifiable ShapeSheet, which is reputedly modeled on an Excel worksheet. Every single shape in Visio has one, as does each page and even the document itself. So, it is important to understand it. It can be opened from the Developer ribbon by the Shape Design | Show ShapeSheet button. The following screenshot shows an example of a current ShapeSheet, and it also shows the Shape Name dialog:

Note the Data 1, 2, and 3 boxes on the Shape Name dialog can actually hold 64,000 characters, but only use it with caution because there are some old add-ons out there that use them. Initially, they were the only way to persist data in the shape. The ShapeSheet on the right of the screenshot shows how it is broken down into sections, rows, and cells. We will learn more about this in the next chapter. In the first version of Visio, there was no User-defined Cells or Shape Data section because it was introduced in version 4. The pre-cursor to User-Defined Cells was the Scratch section. Both of these sections are optional because they can be created, and have new rows inserted, as required. This is in contrast to the fixed, mandatory sections such as Shape Transform because every shape needs to have a location and rotation in the page that it is on.

In the center of the screenshot is the Drawing Explorer window, which displays the document, pages, shapes, and so on. We will learn more about that too in the next chapter.

v2.0 – OLE2 compliance

OLE2 and the published object model allowed Visio to be controlled by programming languages such as Visual Basic 3. In fact, Visio was the first non-Microsoft product to have OLE2 compliance.

v4.0 – Custom Properties, Properties Reporter, and the OLE link to DBs

Custom Properties, later renamed as Shape Data in 2007, not only provides a method of storing typed data for each shape, but also provides a dialog to view and edit them. The following screenshot shows that there is now a Shape Data popup dialog and a Shape Data window that was added years later:

There will be much more about Shape Data in Chapter 2, Understanding How Data Is Stored within Visio.

Properties Reports, now called Shape Reports, provide a method to create simple tabular reports from data in Visio shapes. The following screenshot shows the Reports dialog, and there will be more about this feature in Chapter 8, Validating and Extracting Information:

The OLE link to databases provides a method to read and write data to/from not only Custom Properties/Shape Data, but also from the newly provided User-defined Cells, and in fact, almost all the ShapeSheet cells and even the position of the shape in the page. The following screenshot shows the Link to Database dialog that can be opened from the View | Macros | Add-Ons | Visio Extras ribbon menu:

User-Defined Cells were an important addition in the ShapeSheet. They have just two columns: Value and Prompt. This means that formulae can be entered in the Value column with a description of what they are there for in the Prompt column. Before that, developers would use the Scratch section for formulae and descriptions of their purpose. This can make it difficult to understand the ShapeSheet code; however, the Scratch section does remain important for geometric calculations because of the capabilities of the X, Y, and A to D columns.

v4.1 – the Database Connectivity wizard

This wizard provides an easy-to-use interface for data connectivity, and the following screenshot shows how it can be started from the View | Macros | Add-Ons | Visio Extras ribbon menu:

All of the data related add-ons under the View | Macros | Add-Ons | Visio Extras ribbon menu are part of one large add-on, and they are therefore not part of the core engine and object model in Visio. I have covered their functionality in an earlier book of mine (take a look at http://www.visualizinginformation.com), so it is not covered in this book.

v4.5 – ODBC-compliant DB connectivity, built-in VBA

This version saw improvements in the database connectivity and ODBC compliance, and the inclusion of built-in VBA vastly increased the speed of scripts.

The speed improvements that I could make on automating updates utilizing the database connectivity add-on with VBA were really good. The time taken to update nearly 600 data-linked desks was reduced from 6 minutes to less than 60 seconds. This was a great improvement, but it was still relying on an add-on using ODBC. Although the add-on is capable of two-way connectivity (it can update the data source as well as refresh from the data source), it still has issues. For example, only one link is possible to a single shape. This is restricting in the corporate world, where for example the facilities, IT, and HR departments loathe merging their databases at source.