SlideShare ist ein Scribd-Unternehmen logo
1 von 52
Visualizing Information the Smart
(Diagram) Way
David J Parker
MVP (Visio)
bVisual ltd
Microsoft MVP (Visio)
Microsoft MCP (Visio, SQL)

Pre-Microsoft acquisition
    Visio Business Partner, 1996-8
    Speaker at Visio Conferences 1997 &1998
    Started bVisual in 1998


Post-Microsoft acquisition
    Microsoft Visio Solution Provider since 1999
    Speaker at Microsoft Office Visio Conferences 2006
    Visio Solution Provider Training for Microsoft EMEA


Visualizing Information with Microsoft Office Visio 2007
    McGraw-Hill, 2007
•   http://www.visualizinginformation.com
DataLegends – Visio add-in to add Data Graphic legends
•   http://www.visiotoolbox.com/productdetail.aspx?productid=9
WBS Modeler for Visio and Project
    www.wbsmodeler.com
Visio Examples
•   http://www.bvisual.net/examples.htm
On-line

                             Shape

                                Graphics
  Data        odc                                         Prints
 Source
                                     Data

                           Visio Drawing                 Reports


Import    >         Link       >        Display   >   Communicate
Visual data
  Microsoft Office Visio 2007 Standard
    Database Wizard
  Microsoft Office Visio 2007 Professional
    Database Wizard
    Database reverse engineering
    UML models
    Link Data To Shapes *
    PivotDiagrams *
    Data Graphics *
Visio Professional 2007
  Shape Data
    Renamed from Custom Properties
  Link Data to Shapes
    Multiple data sources per shape
    Read only
    Uses Office Data Connections (*.odc files)
  PivotDiagrams
    Diagrammatic version of PivotTables
    Uses Office Data Connections (*.odc files)
  Data Graphics
    Data sensitive text and graphics on shapes
.NET Primary Interoperability Assemblies (PIAs)
            Sample code




                                                                                                   Save
                                                                                                    As
                                                                                                   Web
                                               Visio Object Model (COM)




                                                                                          Data Diagramming
            Tools & Wizards




                              Extensibility Support
Visio SDK




                                                                                                 ML
                                VSTO Add-in
                                                       Full Visio      Visio Drawing




                                                                                                             Visio Viewer
                                 COM Add-in           Client App      Control (ActiveX)
                                   Add-ons
                                     VBA
            ShapeStudio




                                                                                          Drawings
                                             ShapeSheet, Smart Shapes




                                                                                            Visio
                                                       Visio Engine
DataConnection and DataRecordsets
  Visio 12.0 Type Lib
  Add, AddFromConnectionFile, AddFromXML
UI and code links to:
  Microsoft Office Excel & Access
  SharePoint Services Lists
  SQL Server Tables and Views
  OLEDB & ODBC
Can also create link in code to :
  SQL Server stored procedures
  XML files
Declarations & Connection String
 Dim   dds As Visio.DataRecordset 'The data recordset
 Dim   ary() As String        ‘Array to hold the p key columns
 Dim   SQLConnStr As String    'The connection string
 Dim   SQLCommStr As String    'The Command string
 Dim   datasetName As String   'The dataset name

 SQLConnStr = "Provider=SQLOLEDB.1;" & _
             "Integrated Security=SSPI;" & _
             "Persist Security Info=True;" & _
             "Data Source=.;" & _
             "Initial Catalog=AdventureWorks;" & _
             "Use Procedure for Prepare=1“
Command String & Adding DataRecordset

 SQLCommStr = "EXEC uspGetEmployees 1"
    ary() = Split("EmployeeID", ";")
    datasetName = "Employees“

 Set dds = Visio.ActiveDocument.DataRecordsets.Add( _
        SQLConnStr, SQLCommStr, _
    VisDataRecordsetAddOptions.visDataRecordsetDelayQuery, _
        datasetName)

    dds.SetPrimaryKey VisPrimaryKeySettings.visKeySingle, ary()
    dds.Refresh

Visio.ActiveWindow.Windows.ItemFromID( _
       visWinIDExternalData).Visible = True
Connection String
 Dim   doc As Visio.Document
 Dim   dst As Visio.DataRecordset
 Dim   xmlFile As String
 Dim   dom As New MSXML2.DOMDocument
 Dim   OK As Boolean

  Set doc = Visio.ActiveDocument
  xmlFile = “MyXMLFile.xml"
  OK = dom.Load(xmlFile)

  Set dst = doc.DataRecordsets.AddFromXML( _
         dom.XML, 0, “Any Name")
UI and code refreshing of DataRecordset
  .Refresh
  .GetAllRefreshConflicts
  .GetMatchingRowsForRefreshConflict
  .RemoveRefreshConflict
XML files can only be refreshed in code
  .RefreshUsingXML
  Automation requires assigned name and file
Dim   doc As Visio.Document
Dim   dst As Visio.DataRecordset
Dim   xmlFile As String
Dim   dom As New MSXML2.DOMDocument
Dim   OK As Boolean

Set doc = Visio.ActiveDocument
xmlFile = “MyXMLFile.xml"
OK = dom.Load(xmlFile)

For Each dst In Visio.ActiveDocument.DataRecordsets
   If dst.Name = “Any Name" Then
       dst.RefreshUsingXML dom.XML
       Exit For
   End If
Next
External Data Window
  Select a Master – Drag data row(s)
  Drag a data row onto any shape
  Shape Data key field(s) contain values -
  AutoLink
What the user sees
  Shape Data automatically added to shapes
  Basic Data Graphics usually added by
  default
Behind the scenes
  User-defined Cells
  Shape Data
    _VisDM_ prefixes column names
    Unless already exist!
Importing Data
Definition
  DropManyLinkedU
    ObjectsToInstance()         array of variants
    XYs()                       array of doubles
    DataRecordsetID             long
    DataRowIDs()                array of longs
    ApplyDataGraphicAfterLink   boolean
    ShapeIDs()                  out array of longs
Example
'Retrieve the row ids from the datarecordset
Dim aryRowIDs() As Long
    aryRowIDs = drs.GetDataRowIDs("")

'Drop the master in random co-ords, and linked to the
'datarecordset, applying a DataGraphic
Dim aryShapeIDs() As Long
Dim applyDataGraphics As Boolean
    Visio.ActiveDocument.DocumentSheet.Cells( _
            "User.msvLastAppliedDataGraphic").FormulaU = _
              "=""Data - Employees"""
    applyDataGraphics = True
    Visio.ActivePage.DropManyLinkedU _
        aryMsts, aryXYs, drs.ID, aryRowIDs, _
        applyDataGraphics , aryShapeIDs
Linking Data to Shapes
Drop Many...
Using DataRecordsets in code
  Many types of diagrams require shapes to
  be connected
    Organization Charts, Network diagrams,
    Process
  Connecting shapes example code
    ConnectSubordinates
    ConnectDottedLineManagers
  Can then use different layouts for display
    LayoutPage... example code
    LayoutSelection... example code
Code excerpt
 For iEmp = 0 To UBound(aryShapeIDs)
     'Get the potential manager row
     Set shpEmp = Visio.ActivePage.Shapes.ItemFromID(aryShapeIDs(iEmp))
     rowID = shpEmp.GetLinkedDataRow(drs.ID)
     varRowData = drs.GetRowData(rowID)
     'Arrays are zero based
     empID = CLng(varRowData(empColumn - 1))
     'Filter the rows to get sub-ordinates of the current employee
     aryRowIDs = drs.GetDataRowIDs("ManagerID = " & CStr(empID))
     'Iterate thru the subordinate datarecordset rows
     For iSub = 0 To UBound(aryRowIDs)
         v = drs.GetRowData(aryRowIDs(iSub))
         'Get the subordinate shapes
         Visio.ActivePage.GetShapesLinkedToDataRow drs.ID, aryRowIDs(iSub), arySubShapeIDs
         'Check that there is actually something in the array
         If IsArrayAllocated(arySubShapeIDs) = True Then
             'Iterate thru the subordinate shapes
             For iSubShape = 0 To UBound(arySubShapeIDs)
                 Set shpSub = Visio.ActivePage.Shapes.ItemFromID(arySubShapeIDs(iSubShape))
                 'Create a dynamic connection from manager to subordinate
                 shpEmp.AutoConnect shpSub, visAutoConnectDirUp
             Next iSubShape
         End If
     Next iSub
 Next iEmp
Standard Hierachy Org Chart Page Layout
Modified with Selection Layout
  cf Org Chart Wizard
Other Page Layouts may also be suitable
  Compact Tree
  Radial
  Circular
Connecting Shapes from Data
Reading Data and Layouts
'Get the DataRecordset
Dim drs As DataRecordset
    Set drs = Visio.ActiveWindow.Windows.ItemFromID( _
       Visio.visWinIDExternalData).SelectedDataRecordset
...
‘Get the connection string
Dim conStr As String
    conStr = drs.DataConnection.ConnectionString
‘Use the connection string to create a connection
Dim dbCnxn As New ADODB.Connection
    dbCnxn.ConnectionString = conStr
    dbCnxn.Open
    dbCnxn.BeginTrans
...
Writing Data from Shapes
Overview
  Color By Value
  Text
  Data Bar
  Icon Set
What the user sees
  Document stencil only shows visible
  masters
  Drawing Explorer displays all (but not type)
Behind the scenes
Public Sub EnumMasters()
Dim mst As Visio.Master
    Debug.Print "ID", "Hidden", "Type", "IsDGCallout", "Name"
    For Each mst In Visio.ActiveDocument.Masters
        Debug.Print mst.ID, mst.Hidden, mst.Type, _
             mst.Shapes(1).IsDataGraphicCallout, mst.name
    Next mst
End Sub
Normal
Master

                                        Master
GraphicItem
                                        instance with
Master
                                        DataGraphic


DataGraphic
Master


         Document Stencil   Document Page
Create a new DataGraphic master
  Document.Masters.AddEx(visTypeDataGraphic)
Open the new Master
  Master.Open
Copy an existing GraphicItem to it
  .GraphicItems.AddCopy(existingGI)
Amend GraphicItems
  .HorizontalPosition & .VerticalPosition
  .SetExpression VisGraphicField, string
Close Master
SetDataBarMinMaxValues code
  A Data Bar graphic item can be
    Multiple times in same Data Graphic
    In multiple Data Graphics
    Each instance has different value ranges
  Min and max values read from shape
  instances
    Prop. msvCalloutField
  Data Bar can have multiple fields
    E.g. Multi-bar graph
    Prop. msvCalloutPropFieldn where n=2 to 5
  Update master using .Open
5. Update
DataGraphic
Master Data Bar
GraphicItem
Min/Max Values                                    4. Read
                                                  Min/Max of
2. Collect                                        Data Bar
Data Bar                                          Graphic Items
GraphicItems

1. Get Active
DataGraphic                 3. Create Selection
Master


         Document Stencil         Document Page
Start Part
Const   UserType As String = "User.msvCalloutType“
Const   UserDGID As String = "User.visDGItemID "
Const   PropMax As String = "Prop.msvCalloutPropMax"
Const   PropMin As String = "Prop.msvCalloutPropMin“

'Get the active Data Graphic
Dim mstDG As Master
    Set mstDG = GetActiveDataGraphic

im dicDataBarShapes As New Dictionary
Dim gi As Visio.GraphicItem
    'Create a dictionary of data bars
    For Each gi In mstDG.GraphicItems
        If gi.Type = visTypeDataBar Then
            dicDataBarShapes.Add CStr(gi.ID), 0
        End If
    Next gi
Middle Part
Dim colDataBarShapes As New Collection
Dim itmGraphic As Visio.shape
Dim gID As String
    'Update the data bars dictionary with shape pseudo-index
    For Each itmGraphic In mstDG.Shapes(1).Shapes
        If itmGraphic.IsDataGraphicCallout = True Then
            If itmGraphic.Cells(UserType).ResultStr("") = "Data Bar" Then
                gID = CStr(itmGraphic.Cells(UserDGID).ResultInt("", 0))
                dicDataBarShapes.Item(gID) = itmGraphic.NameU
                colDataBarShapes.Add gID
            End If
        End If
    Next itmGraphic
 'Iterate thru each page to collect min/max values
    For Each pag In Visio.ActiveDocument.Pages
        'Get all shapes that use this data graphic master
        Set sel = pag.CreateSelection(visSelTypeByDataGraphic, 0, mstDG)
        ...
        Next shp
    Next pag
End Part
...
'Finally - update the ItemGraphic in the DataGraphic Master
Dim mstCopy As Visio.Master
    Set mstCopy = mstDG.Open
    For Each itmGraphic In mstCopy.Shapes(1).Shapes
        If itmGraphic.IsDataGraphicCallout = True Then
            If itmGraphic.Cells(UserType).ResultStr("") = "Data Bar" Then
                 gID = CStr(itmGraphic.Cells(UserDGID).ResultInt("", 0))
                itmGraphic.Cells(PropMax).FormulaU = "=" & dicMaxVal.Item(gID)
                itmGraphic.Cells(PropMin).FormulaU = "=" & dicMinVal.Item(gID)
            End If
        End If
    Next itmGraphic
    'Close the copy to update all instances
    mstCopy.Close
Data Graphics
Updating DataBar Minimum and Maximum Values
automatically
Breakdown
 Breakdown data into Categories
 Sort
 Merge
 Promote
 Collapse
Breakdown
 PivotDiagram is an add-on
   Not an API extension
   Only launched in code from SharePoint
   Services List (soon to be published MSDN
   article)
 Use code to select in various ways
   Aids in applying DataGraphics and extra
   DataRecordsets
   E.g. SelectSameBreakdownName sample
...
Set vsoWindow = Visio.Application.ActiveWindow

If vsoWindow.Selection.Count > 0 Then
    Set shp = vsoWindow.Selection.PrimaryItem
    If IsPivotNode(shp) = True Then
       breakdownName = _
            GetGroupNameByID(GetBreakdownID(shp))
        SelectByBreakdownName breakdownName
    End If
End If
IsPivotNode = isPivotShapeType(shape, ePivotShapeType.Node)

Private Function isPivotShapeType(ByVal shape As Visio.shape, _
    ByVal pivotShapeType As ePivotShapeType) As Boolean

 If Not shape.CellExists(UserDDShapeType, _
    Visio.VisExistsFlags.visExistsAnywhere) = 0 Then
    If shape.Cells(UserDDShapeType).ResultIU = pivotShapeType Then
         isPivotShapeType = True
    Else
         isPivotShapeType = False
    End If
 Else
    isPivotShapeType = False
 End If
End Function
PivotDiagrams
Custom Selections
DataLegends
  Legends for Icon Sets & Color By Value
DataLegends
David J Parker
Microsoft MVP (Visio)
http://www.bVisual.net

Book
http://www.visualizinginformation.com

davidp@bvisual.net
Visio 2007 SDK
  http://msdn2.microsoft.com/en-us/library/ms409183.aspx

Visio 2007 Solution Development Workshop
  http://www.microsoft.com/downloads/details.aspx?FamilyID=332c211e-
  581e-4029-9839-8f45de10b4c2&DisplayLang=en

Visio Developer Portal
  http://msdn2.microsoft.com/en-us/office/aa905478.aspx

Visio Insight blog
  http://blogs.msdn.com/visio/

Visio MVP web site
  http://visio.mvps.org/

My Visio Blog
  http://bvisual.spaces.live.com/
Book Discount Vouchers
(visit my booth)
Visualizing Information the Smart
(Diagram) Way
Time                End User Track                Solution Developer Track
                    (Lassen Room)                 (Kodiak Room)

1:45pm - 2:45pm     Integrating Visio 2007 with   Visio 2007 as a Solutions
Yesterday           Other Office Applications     Development Platform

3:00pm - 4:00pm     Get Creative with Data in     Developing Visio Solutions with
Yesterday           Visio 2007                    Visual Studio Tools for Office

4:30pm - 5:30pm     Understanding and             Visio Solution Developer Pain
Yesterday           Demystifying Visio Shapes     Points

10:45am - 11:45am                                 Visio Futures - API Insights
Today

1:15pm - 2:15pm                                   Visualizing Information the Smart
Today                                             (Diagram) Way

2:30pm - 3:30pm                                   Going Further with Data
Today                                             Connectivity
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market
     conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.
                                 MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Weitere ähnliche Inhalte

Was ist angesagt?

ASP.Net 3.5 SP1 Dynamic Data
ASP.Net 3.5 SP1 Dynamic DataASP.Net 3.5 SP1 Dynamic Data
ASP.Net 3.5 SP1 Dynamic Datamicham
 
Microsoft Visio Detailed Presentation
Microsoft Visio Detailed PresentationMicrosoft Visio Detailed Presentation
Microsoft Visio Detailed PresentationQBI Institute
 
Document Classification using DMX in SQL Server Analysis Services
Document Classification using DMX in SQL Server Analysis ServicesDocument Classification using DMX in SQL Server Analysis Services
Document Classification using DMX in SQL Server Analysis ServicesMark Tabladillo
 
LeaderQuest SharePoint Business Intelligence Presentation
LeaderQuest SharePoint Business Intelligence PresentationLeaderQuest SharePoint Business Intelligence Presentation
LeaderQuest SharePoint Business Intelligence Presentationmbrinks
 
BI Dashboards with SQL Server 2008 R2
BI Dashboards with SQL Server 2008 R2BI Dashboards with SQL Server 2008 R2
BI Dashboards with SQL Server 2008 R2Eduardo Castro
 
Flex3 data binding
Flex3 data bindingFlex3 data binding
Flex3 data bindingguestdf3003
 

Was ist angesagt? (7)

ASP.Net 3.5 SP1 Dynamic Data
ASP.Net 3.5 SP1 Dynamic DataASP.Net 3.5 SP1 Dynamic Data
ASP.Net 3.5 SP1 Dynamic Data
 
Microsoft Visio Detailed Presentation
Microsoft Visio Detailed PresentationMicrosoft Visio Detailed Presentation
Microsoft Visio Detailed Presentation
 
Document Classification using DMX in SQL Server Analysis Services
Document Classification using DMX in SQL Server Analysis ServicesDocument Classification using DMX in SQL Server Analysis Services
Document Classification using DMX in SQL Server Analysis Services
 
LeaderQuest SharePoint Business Intelligence Presentation
LeaderQuest SharePoint Business Intelligence PresentationLeaderQuest SharePoint Business Intelligence Presentation
LeaderQuest SharePoint Business Intelligence Presentation
 
Introduction to mdx query ppt
Introduction to mdx query pptIntroduction to mdx query ppt
Introduction to mdx query ppt
 
BI Dashboards with SQL Server 2008 R2
BI Dashboards with SQL Server 2008 R2BI Dashboards with SQL Server 2008 R2
BI Dashboards with SQL Server 2008 R2
 
Flex3 data binding
Flex3 data bindingFlex3 data binding
Flex3 data binding
 

Andere mochten auch

Microsoft_Office_Visio_Professional_2007_for_IT_How_to_Use_Visio_
Microsoft_Office_Visio_Professional_2007_for_IT_How_to_Use_Visio_Microsoft_Office_Visio_Professional_2007_for_IT_How_to_Use_Visio_
Microsoft_Office_Visio_Professional_2007_for_IT_How_to_Use_Visio_TURKI , PMP
 
Microsoft Viso 2013 - Feature Comparison Chart
Microsoft Viso 2013 - Feature Comparison ChartMicrosoft Viso 2013 - Feature Comparison Chart
Microsoft Viso 2013 - Feature Comparison ChartDavid J Rosenthal
 
Visio, Jude and rational rose
Visio, Jude and rational roseVisio, Jude and rational rose
Visio, Jude and rational roseramesh kumar
 
The Top Skills That Can Get You Hired in 2017
The Top Skills That Can Get You Hired in 2017The Top Skills That Can Get You Hired in 2017
The Top Skills That Can Get You Hired in 2017LinkedIn
 

Andere mochten auch (6)

Microsoft_Office_Visio_Professional_2007_for_IT_How_to_Use_Visio_
Microsoft_Office_Visio_Professional_2007_for_IT_How_to_Use_Visio_Microsoft_Office_Visio_Professional_2007_for_IT_How_to_Use_Visio_
Microsoft_Office_Visio_Professional_2007_for_IT_How_to_Use_Visio_
 
Visio p&id process designer introduction
Visio p&id process designer   introductionVisio p&id process designer   introduction
Visio p&id process designer introduction
 
Microsoft Viso 2013 - Feature Comparison Chart
Microsoft Viso 2013 - Feature Comparison ChartMicrosoft Viso 2013 - Feature Comparison Chart
Microsoft Viso 2013 - Feature Comparison Chart
 
Flexsim y Visio
Flexsim y VisioFlexsim y Visio
Flexsim y Visio
 
Visio, Jude and rational rose
Visio, Jude and rational roseVisio, Jude and rational rose
Visio, Jude and rational rose
 
The Top Skills That Can Get You Hired in 2017
The Top Skills That Can Get You Hired in 2017The Top Skills That Can Get You Hired in 2017
The Top Skills That Can Get You Hired in 2017
 

Ähnlich wie Visio Conference 2008

Compu Brain Computer Institute
Compu Brain Computer InstituteCompu Brain Computer Institute
Compu Brain Computer InstituteWilfred Dsouza
 
SPSOslo 2014 - Visio 2013 & Visio Services – A Quick Guide
SPSOslo 2014 - Visio 2013 & Visio Services – A Quick GuideSPSOslo 2014 - Visio 2013 & Visio Services – A Quick Guide
SPSOslo 2014 - Visio 2013 & Visio Services – A Quick GuideKnut Relbe-Moe [MVP, MCT]
 
Visio Services in SharePoint 2010
Visio Services in SharePoint 2010Visio Services in SharePoint 2010
Visio Services in SharePoint 2010Alexander Meijers
 
My cool new Slideshow!
My cool new Slideshow!My cool new Slideshow!
My cool new Slideshow!rommel_gagasa
 
SQL Server Denali: BI on Your Terms
SQL Server Denali: BI on Your Terms SQL Server Denali: BI on Your Terms
SQL Server Denali: BI on Your Terms Andrew Brust
 
How do i connect to that
How do i connect to thatHow do i connect to that
How do i connect to thatBecky Bertram
 
Workshop supermodel munich
Workshop supermodel munichWorkshop supermodel munich
Workshop supermodel munichSonja Madsen
 
Data Virtualization Primer - Introduction
Data Virtualization Primer - IntroductionData Virtualization Primer - Introduction
Data Virtualization Primer - IntroductionKenneth Peeples
 
Accessing data within VB Applications
Accessing data within VB ApplicationsAccessing data within VB Applications
Accessing data within VB Applicationsrobertbenard
 
Bringing Data to Life with MongoDB Charts
Bringing Data to Life with MongoDB ChartsBringing Data to Life with MongoDB Charts
Bringing Data to Life with MongoDB ChartsMongoDB
 
Introduction To Sql Services
Introduction To Sql ServicesIntroduction To Sql Services
Introduction To Sql Servicesllangit
 
Data Enabled Enterprise Modeler (De2 M) Overview V2.12
Data Enabled Enterprise Modeler (De2 M) Overview V2.12Data Enabled Enterprise Modeler (De2 M) Overview V2.12
Data Enabled Enterprise Modeler (De2 M) Overview V2.12Paul W. Johnson
 
Modelibra Software Family
Modelibra Software FamilyModelibra Software Family
Modelibra Software Familydzenanr
 
BI SQL Server2008R2 Portfolio
BI SQL Server2008R2 PortfolioBI SQL Server2008R2 Portfolio
BI SQL Server2008R2 Portfoliodlinder25
 
Evolving your Data Access with MongoDB Stitch - Drew Di Palma
Evolving your Data Access with MongoDB Stitch - Drew Di PalmaEvolving your Data Access with MongoDB Stitch - Drew Di Palma
Evolving your Data Access with MongoDB Stitch - Drew Di PalmaMongoDB
 
Big Data: Technical Introduction to BigSheets for InfoSphere BigInsights
Big Data:  Technical Introduction to BigSheets for InfoSphere BigInsightsBig Data:  Technical Introduction to BigSheets for InfoSphere BigInsights
Big Data: Technical Introduction to BigSheets for InfoSphere BigInsightsCynthia Saracco
 
faciliCAD is Facility Management Made Easy
faciliCAD is Facility Management Made EasyfaciliCAD is Facility Management Made Easy
faciliCAD is Facility Management Made Easybkilp
 

Ähnlich wie Visio Conference 2008 (20)

Compu Brain Computer Institute
Compu Brain Computer InstituteCompu Brain Computer Institute
Compu Brain Computer Institute
 
SPSOslo 2014 Visio Services
SPSOslo 2014 Visio Services SPSOslo 2014 Visio Services
SPSOslo 2014 Visio Services
 
SPSOslo 2014 - Visio 2013 & Visio Services – A Quick Guide
SPSOslo 2014 - Visio 2013 & Visio Services – A Quick GuideSPSOslo 2014 - Visio 2013 & Visio Services – A Quick Guide
SPSOslo 2014 - Visio 2013 & Visio Services – A Quick Guide
 
Visio Services in SharePoint 2010
Visio Services in SharePoint 2010Visio Services in SharePoint 2010
Visio Services in SharePoint 2010
 
My cool new Slideshow!
My cool new Slideshow!My cool new Slideshow!
My cool new Slideshow!
 
SQL Server Denali: BI on Your Terms
SQL Server Denali: BI on Your Terms SQL Server Denali: BI on Your Terms
SQL Server Denali: BI on Your Terms
 
How do i connect to that
How do i connect to thatHow do i connect to that
How do i connect to that
 
Microsoft visio
Microsoft visioMicrosoft visio
Microsoft visio
 
Workshop supermodel munich
Workshop supermodel munichWorkshop supermodel munich
Workshop supermodel munich
 
Data Virtualization Primer - Introduction
Data Virtualization Primer - IntroductionData Virtualization Primer - Introduction
Data Virtualization Primer - Introduction
 
Accessing data within VB Applications
Accessing data within VB ApplicationsAccessing data within VB Applications
Accessing data within VB Applications
 
Arc+ EXEcutive 2010
Arc+ EXEcutive 2010Arc+ EXEcutive 2010
Arc+ EXEcutive 2010
 
Bringing Data to Life with MongoDB Charts
Bringing Data to Life with MongoDB ChartsBringing Data to Life with MongoDB Charts
Bringing Data to Life with MongoDB Charts
 
Introduction To Sql Services
Introduction To Sql ServicesIntroduction To Sql Services
Introduction To Sql Services
 
Data Enabled Enterprise Modeler (De2 M) Overview V2.12
Data Enabled Enterprise Modeler (De2 M) Overview V2.12Data Enabled Enterprise Modeler (De2 M) Overview V2.12
Data Enabled Enterprise Modeler (De2 M) Overview V2.12
 
Modelibra Software Family
Modelibra Software FamilyModelibra Software Family
Modelibra Software Family
 
BI SQL Server2008R2 Portfolio
BI SQL Server2008R2 PortfolioBI SQL Server2008R2 Portfolio
BI SQL Server2008R2 Portfolio
 
Evolving your Data Access with MongoDB Stitch - Drew Di Palma
Evolving your Data Access with MongoDB Stitch - Drew Di PalmaEvolving your Data Access with MongoDB Stitch - Drew Di Palma
Evolving your Data Access with MongoDB Stitch - Drew Di Palma
 
Big Data: Technical Introduction to BigSheets for InfoSphere BigInsights
Big Data:  Technical Introduction to BigSheets for InfoSphere BigInsightsBig Data:  Technical Introduction to BigSheets for InfoSphere BigInsights
Big Data: Technical Introduction to BigSheets for InfoSphere BigInsights
 
faciliCAD is Facility Management Made Easy
faciliCAD is Facility Management Made EasyfaciliCAD is Facility Management Made Easy
faciliCAD is Facility Management Made Easy
 

Mehr von David Parker

Creating a Visio web part with SharePoint SPFx
Creating a Visio web part with SharePoint SPFxCreating a Visio web part with SharePoint SPFx
Creating a Visio web part with SharePoint SPFxDavid Parker
 
Bpm portals with Visio and SharePoint
Bpm portals with Visio and SharePointBpm portals with Visio and SharePoint
Bpm portals with Visio and SharePointDavid Parker
 
Make your visio diagrams accessible to everyone
Make your visio diagrams accessible to everyoneMake your visio diagrams accessible to everyone
Make your visio diagrams accessible to everyoneDavid Parker
 
Visio Pro for Office 365 Slide Snippets
Visio Pro for Office 365 Slide SnippetsVisio Pro for Office 365 Slide Snippets
Visio Pro for Office 365 Slide SnippetsDavid Parker
 
Aug national seminar oxford 2017 - david parker
Aug national seminar   oxford 2017 - david parkerAug national seminar   oxford 2017 - david parker
Aug national seminar oxford 2017 - david parkerDavid Parker
 
Visio in the cloud
Visio in the cloudVisio in the cloud
Visio in the cloudDavid Parker
 
Tech days2010 uk_16-9_it_pro_dj_parker
Tech days2010 uk_16-9_it_pro_dj_parkerTech days2010 uk_16-9_it_pro_dj_parker
Tech days2010 uk_16-9_it_pro_dj_parkerDavid Parker
 
Vbug nov 2010 Visio Validation
Vbug nov 2010   Visio ValidationVbug nov 2010   Visio Validation
Vbug nov 2010 Visio ValidationDavid Parker
 

Mehr von David Parker (8)

Creating a Visio web part with SharePoint SPFx
Creating a Visio web part with SharePoint SPFxCreating a Visio web part with SharePoint SPFx
Creating a Visio web part with SharePoint SPFx
 
Bpm portals with Visio and SharePoint
Bpm portals with Visio and SharePointBpm portals with Visio and SharePoint
Bpm portals with Visio and SharePoint
 
Make your visio diagrams accessible to everyone
Make your visio diagrams accessible to everyoneMake your visio diagrams accessible to everyone
Make your visio diagrams accessible to everyone
 
Visio Pro for Office 365 Slide Snippets
Visio Pro for Office 365 Slide SnippetsVisio Pro for Office 365 Slide Snippets
Visio Pro for Office 365 Slide Snippets
 
Aug national seminar oxford 2017 - david parker
Aug national seminar   oxford 2017 - david parkerAug national seminar   oxford 2017 - david parker
Aug national seminar oxford 2017 - david parker
 
Visio in the cloud
Visio in the cloudVisio in the cloud
Visio in the cloud
 
Tech days2010 uk_16-9_it_pro_dj_parker
Tech days2010 uk_16-9_it_pro_dj_parkerTech days2010 uk_16-9_it_pro_dj_parker
Tech days2010 uk_16-9_it_pro_dj_parker
 
Vbug nov 2010 Visio Validation
Vbug nov 2010   Visio ValidationVbug nov 2010   Visio Validation
Vbug nov 2010 Visio Validation
 

Kürzlich hochgeladen

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Kürzlich hochgeladen (20)

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

Visio Conference 2008

  • 1.
  • 2. Visualizing Information the Smart (Diagram) Way David J Parker MVP (Visio) bVisual ltd
  • 3. Microsoft MVP (Visio) Microsoft MCP (Visio, SQL) Pre-Microsoft acquisition Visio Business Partner, 1996-8 Speaker at Visio Conferences 1997 &1998 Started bVisual in 1998 Post-Microsoft acquisition Microsoft Visio Solution Provider since 1999 Speaker at Microsoft Office Visio Conferences 2006 Visio Solution Provider Training for Microsoft EMEA Visualizing Information with Microsoft Office Visio 2007 McGraw-Hill, 2007 • http://www.visualizinginformation.com DataLegends – Visio add-in to add Data Graphic legends • http://www.visiotoolbox.com/productdetail.aspx?productid=9 WBS Modeler for Visio and Project www.wbsmodeler.com Visio Examples • http://www.bvisual.net/examples.htm
  • 4.
  • 5. On-line Shape Graphics Data odc Prints Source Data Visio Drawing Reports Import > Link > Display > Communicate
  • 6. Visual data Microsoft Office Visio 2007 Standard Database Wizard Microsoft Office Visio 2007 Professional Database Wizard Database reverse engineering UML models Link Data To Shapes * PivotDiagrams * Data Graphics *
  • 7. Visio Professional 2007 Shape Data Renamed from Custom Properties Link Data to Shapes Multiple data sources per shape Read only Uses Office Data Connections (*.odc files) PivotDiagrams Diagrammatic version of PivotTables Uses Office Data Connections (*.odc files) Data Graphics Data sensitive text and graphics on shapes
  • 8. .NET Primary Interoperability Assemblies (PIAs) Sample code Save As Web Visio Object Model (COM) Data Diagramming Tools & Wizards Extensibility Support Visio SDK ML VSTO Add-in Full Visio Visio Drawing Visio Viewer COM Add-in Client App Control (ActiveX) Add-ons VBA ShapeStudio Drawings ShapeSheet, Smart Shapes Visio Visio Engine
  • 9. DataConnection and DataRecordsets Visio 12.0 Type Lib Add, AddFromConnectionFile, AddFromXML UI and code links to: Microsoft Office Excel & Access SharePoint Services Lists SQL Server Tables and Views OLEDB & ODBC Can also create link in code to : SQL Server stored procedures XML files
  • 10. Declarations & Connection String Dim dds As Visio.DataRecordset 'The data recordset Dim ary() As String ‘Array to hold the p key columns Dim SQLConnStr As String 'The connection string Dim SQLCommStr As String 'The Command string Dim datasetName As String 'The dataset name SQLConnStr = "Provider=SQLOLEDB.1;" & _ "Integrated Security=SSPI;" & _ "Persist Security Info=True;" & _ "Data Source=.;" & _ "Initial Catalog=AdventureWorks;" & _ "Use Procedure for Prepare=1“
  • 11. Command String & Adding DataRecordset SQLCommStr = "EXEC uspGetEmployees 1" ary() = Split("EmployeeID", ";") datasetName = "Employees“ Set dds = Visio.ActiveDocument.DataRecordsets.Add( _ SQLConnStr, SQLCommStr, _ VisDataRecordsetAddOptions.visDataRecordsetDelayQuery, _ datasetName) dds.SetPrimaryKey VisPrimaryKeySettings.visKeySingle, ary() dds.Refresh Visio.ActiveWindow.Windows.ItemFromID( _ visWinIDExternalData).Visible = True
  • 12. Connection String Dim doc As Visio.Document Dim dst As Visio.DataRecordset Dim xmlFile As String Dim dom As New MSXML2.DOMDocument Dim OK As Boolean Set doc = Visio.ActiveDocument xmlFile = “MyXMLFile.xml" OK = dom.Load(xmlFile) Set dst = doc.DataRecordsets.AddFromXML( _ dom.XML, 0, “Any Name")
  • 13. UI and code refreshing of DataRecordset .Refresh .GetAllRefreshConflicts .GetMatchingRowsForRefreshConflict .RemoveRefreshConflict XML files can only be refreshed in code .RefreshUsingXML Automation requires assigned name and file
  • 14. Dim doc As Visio.Document Dim dst As Visio.DataRecordset Dim xmlFile As String Dim dom As New MSXML2.DOMDocument Dim OK As Boolean Set doc = Visio.ActiveDocument xmlFile = “MyXMLFile.xml" OK = dom.Load(xmlFile) For Each dst In Visio.ActiveDocument.DataRecordsets If dst.Name = “Any Name" Then dst.RefreshUsingXML dom.XML Exit For End If Next
  • 15. External Data Window Select a Master – Drag data row(s) Drag a data row onto any shape Shape Data key field(s) contain values - AutoLink
  • 16. What the user sees Shape Data automatically added to shapes Basic Data Graphics usually added by default
  • 17. Behind the scenes User-defined Cells Shape Data _VisDM_ prefixes column names Unless already exist!
  • 19. Definition DropManyLinkedU ObjectsToInstance() array of variants XYs() array of doubles DataRecordsetID long DataRowIDs() array of longs ApplyDataGraphicAfterLink boolean ShapeIDs() out array of longs
  • 20. Example 'Retrieve the row ids from the datarecordset Dim aryRowIDs() As Long aryRowIDs = drs.GetDataRowIDs("") 'Drop the master in random co-ords, and linked to the 'datarecordset, applying a DataGraphic Dim aryShapeIDs() As Long Dim applyDataGraphics As Boolean Visio.ActiveDocument.DocumentSheet.Cells( _ "User.msvLastAppliedDataGraphic").FormulaU = _ "=""Data - Employees""" applyDataGraphics = True Visio.ActivePage.DropManyLinkedU _ aryMsts, aryXYs, drs.ID, aryRowIDs, _ applyDataGraphics , aryShapeIDs
  • 21. Linking Data to Shapes Drop Many...
  • 22. Using DataRecordsets in code Many types of diagrams require shapes to be connected Organization Charts, Network diagrams, Process Connecting shapes example code ConnectSubordinates ConnectDottedLineManagers Can then use different layouts for display LayoutPage... example code LayoutSelection... example code
  • 23. Code excerpt For iEmp = 0 To UBound(aryShapeIDs) 'Get the potential manager row Set shpEmp = Visio.ActivePage.Shapes.ItemFromID(aryShapeIDs(iEmp)) rowID = shpEmp.GetLinkedDataRow(drs.ID) varRowData = drs.GetRowData(rowID) 'Arrays are zero based empID = CLng(varRowData(empColumn - 1)) 'Filter the rows to get sub-ordinates of the current employee aryRowIDs = drs.GetDataRowIDs("ManagerID = " & CStr(empID)) 'Iterate thru the subordinate datarecordset rows For iSub = 0 To UBound(aryRowIDs) v = drs.GetRowData(aryRowIDs(iSub)) 'Get the subordinate shapes Visio.ActivePage.GetShapesLinkedToDataRow drs.ID, aryRowIDs(iSub), arySubShapeIDs 'Check that there is actually something in the array If IsArrayAllocated(arySubShapeIDs) = True Then 'Iterate thru the subordinate shapes For iSubShape = 0 To UBound(arySubShapeIDs) Set shpSub = Visio.ActivePage.Shapes.ItemFromID(arySubShapeIDs(iSubShape)) 'Create a dynamic connection from manager to subordinate shpEmp.AutoConnect shpSub, visAutoConnectDirUp Next iSubShape End If Next iSub Next iEmp
  • 24. Standard Hierachy Org Chart Page Layout Modified with Selection Layout cf Org Chart Wizard
  • 25. Other Page Layouts may also be suitable Compact Tree Radial Circular
  • 26. Connecting Shapes from Data Reading Data and Layouts
  • 27. 'Get the DataRecordset Dim drs As DataRecordset Set drs = Visio.ActiveWindow.Windows.ItemFromID( _ Visio.visWinIDExternalData).SelectedDataRecordset ... ‘Get the connection string Dim conStr As String conStr = drs.DataConnection.ConnectionString ‘Use the connection string to create a connection Dim dbCnxn As New ADODB.Connection dbCnxn.ConnectionString = conStr dbCnxn.Open dbCnxn.BeginTrans ...
  • 29. Overview Color By Value Text Data Bar Icon Set
  • 30. What the user sees Document stencil only shows visible masters Drawing Explorer displays all (but not type)
  • 31. Behind the scenes Public Sub EnumMasters() Dim mst As Visio.Master Debug.Print "ID", "Hidden", "Type", "IsDGCallout", "Name" For Each mst In Visio.ActiveDocument.Masters Debug.Print mst.ID, mst.Hidden, mst.Type, _ mst.Shapes(1).IsDataGraphicCallout, mst.name Next mst End Sub
  • 32. Normal Master Master GraphicItem instance with Master DataGraphic DataGraphic Master Document Stencil Document Page
  • 33. Create a new DataGraphic master Document.Masters.AddEx(visTypeDataGraphic) Open the new Master Master.Open Copy an existing GraphicItem to it .GraphicItems.AddCopy(existingGI) Amend GraphicItems .HorizontalPosition & .VerticalPosition .SetExpression VisGraphicField, string Close Master
  • 34. SetDataBarMinMaxValues code A Data Bar graphic item can be Multiple times in same Data Graphic In multiple Data Graphics Each instance has different value ranges Min and max values read from shape instances Prop. msvCalloutField Data Bar can have multiple fields E.g. Multi-bar graph Prop. msvCalloutPropFieldn where n=2 to 5 Update master using .Open
  • 35. 5. Update DataGraphic Master Data Bar GraphicItem Min/Max Values 4. Read Min/Max of 2. Collect Data Bar Data Bar Graphic Items GraphicItems 1. Get Active DataGraphic 3. Create Selection Master Document Stencil Document Page
  • 36. Start Part Const UserType As String = "User.msvCalloutType“ Const UserDGID As String = "User.visDGItemID " Const PropMax As String = "Prop.msvCalloutPropMax" Const PropMin As String = "Prop.msvCalloutPropMin“ 'Get the active Data Graphic Dim mstDG As Master Set mstDG = GetActiveDataGraphic im dicDataBarShapes As New Dictionary Dim gi As Visio.GraphicItem 'Create a dictionary of data bars For Each gi In mstDG.GraphicItems If gi.Type = visTypeDataBar Then dicDataBarShapes.Add CStr(gi.ID), 0 End If Next gi
  • 37. Middle Part Dim colDataBarShapes As New Collection Dim itmGraphic As Visio.shape Dim gID As String 'Update the data bars dictionary with shape pseudo-index For Each itmGraphic In mstDG.Shapes(1).Shapes If itmGraphic.IsDataGraphicCallout = True Then If itmGraphic.Cells(UserType).ResultStr("") = "Data Bar" Then gID = CStr(itmGraphic.Cells(UserDGID).ResultInt("", 0)) dicDataBarShapes.Item(gID) = itmGraphic.NameU colDataBarShapes.Add gID End If End If Next itmGraphic 'Iterate thru each page to collect min/max values For Each pag In Visio.ActiveDocument.Pages 'Get all shapes that use this data graphic master Set sel = pag.CreateSelection(visSelTypeByDataGraphic, 0, mstDG) ... Next shp Next pag
  • 38. End Part ... 'Finally - update the ItemGraphic in the DataGraphic Master Dim mstCopy As Visio.Master Set mstCopy = mstDG.Open For Each itmGraphic In mstCopy.Shapes(1).Shapes If itmGraphic.IsDataGraphicCallout = True Then If itmGraphic.Cells(UserType).ResultStr("") = "Data Bar" Then gID = CStr(itmGraphic.Cells(UserDGID).ResultInt("", 0)) itmGraphic.Cells(PropMax).FormulaU = "=" & dicMaxVal.Item(gID) itmGraphic.Cells(PropMin).FormulaU = "=" & dicMinVal.Item(gID) End If End If Next itmGraphic 'Close the copy to update all instances mstCopy.Close
  • 39. Data Graphics Updating DataBar Minimum and Maximum Values automatically
  • 40. Breakdown Breakdown data into Categories Sort Merge Promote Collapse
  • 41. Breakdown PivotDiagram is an add-on Not an API extension Only launched in code from SharePoint Services List (soon to be published MSDN article) Use code to select in various ways Aids in applying DataGraphics and extra DataRecordsets E.g. SelectSameBreakdownName sample
  • 42. ... Set vsoWindow = Visio.Application.ActiveWindow If vsoWindow.Selection.Count > 0 Then Set shp = vsoWindow.Selection.PrimaryItem If IsPivotNode(shp) = True Then breakdownName = _ GetGroupNameByID(GetBreakdownID(shp)) SelectByBreakdownName breakdownName End If End If
  • 43. IsPivotNode = isPivotShapeType(shape, ePivotShapeType.Node) Private Function isPivotShapeType(ByVal shape As Visio.shape, _ ByVal pivotShapeType As ePivotShapeType) As Boolean If Not shape.CellExists(UserDDShapeType, _ Visio.VisExistsFlags.visExistsAnywhere) = 0 Then If shape.Cells(UserDDShapeType).ResultIU = pivotShapeType Then isPivotShapeType = True Else isPivotShapeType = False End If Else isPivotShapeType = False End If End Function
  • 45. DataLegends Legends for Icon Sets & Color By Value
  • 47. David J Parker Microsoft MVP (Visio) http://www.bVisual.net Book http://www.visualizinginformation.com davidp@bvisual.net
  • 48. Visio 2007 SDK http://msdn2.microsoft.com/en-us/library/ms409183.aspx Visio 2007 Solution Development Workshop http://www.microsoft.com/downloads/details.aspx?FamilyID=332c211e- 581e-4029-9839-8f45de10b4c2&DisplayLang=en Visio Developer Portal http://msdn2.microsoft.com/en-us/office/aa905478.aspx Visio Insight blog http://blogs.msdn.com/visio/ Visio MVP web site http://visio.mvps.org/ My Visio Blog http://bvisual.spaces.live.com/
  • 50. Visualizing Information the Smart (Diagram) Way
  • 51. Time End User Track Solution Developer Track (Lassen Room) (Kodiak Room) 1:45pm - 2:45pm Integrating Visio 2007 with Visio 2007 as a Solutions Yesterday Other Office Applications Development Platform 3:00pm - 4:00pm Get Creative with Data in Developing Visio Solutions with Yesterday Visio 2007 Visual Studio Tools for Office 4:30pm - 5:30pm Understanding and Visio Solution Developer Pain Yesterday Demystifying Visio Shapes Points 10:45am - 11:45am Visio Futures - API Insights Today 1:15pm - 2:15pm Visualizing Information the Smart Today (Diagram) Way 2:30pm - 3:30pm Going Further with Data Today Connectivity
  • 52. © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Hinweis der Redaktion

  1. http://www.microsoft.com/downloads/details.aspx?familyid=06616212-0356-46a0-8da2-eebc53a68034&displaylang=en
  2. Visio.Application.DataFeaturesEnabled will return false for standard
  3. Ignoring SolutionXML – not visibleData1, 2 and 3 were once the only visible shape data
  4. Visio 2007 also has the ability to export to Xps and PdfXps is a zipped format which can be extended, I will show an example of enhancing the Xps output to include Shape Data for smarter communication.
  5. In VBA, requires reference to Microsoft Scripting Runtime
  6. Requires reference to MicrosoftXML
  7. Requires reference to MicrosoftXMLNeed to know both the file and Name used when added
  8. Can switch off automatic generation of graphics
  9. Can switch off automatic generation of graphics
  10. Remember that Blue rows are not inherited from the Master!Therefore, consider having named shape data in Master before linking.
  11. Run code examples:CreateRecordsetDropEmployees
  12. Setting these properties can improve speed in automationApplication.AutoLayoutApplication.InhibitSelectChangeApplication.ScreenUpdatingApplication.ShowChangesEnsure that "=""Data - Employees""“ exists
  13. Run code examples:CreateRecordsetDropEmployees
  14. Private Sub LayoutPage( _ByValplaceStyle As Visio.VisCellVals, _ByValrouteStyle As Visio.VisCellVals, _ByVallineRouteExt As Visio.VisCellVals)
  15. Run code examples:ConnectSubordinatesDropEmployees
  16. Needs reference to ADODB
  17. Run code examples:
  18. The order of the graphic items in the Z-order
  19. Note that DataGraphic and GraphicItem masters are both hidden by defaultCan only really recognise a GraphicItem by its main shape
  20. Cannot create new GraphicItems in code ... only copy existingConstant Value Description visGraphicPropertyLabel1The label of a shape data item.visGraphicExpression2The ShapeSheet formula of a shape data item.
  21. User.msvCalloutIconNumber controls display of elements
  22. http://blogs.msdn.com/visio/archive/2007/03/06/custom-formulas-in-data-graphics.aspx
  23. Visio Toolbox for alternative icon sets using imageshttp://www.visiotoolbox.com/downloads.aspx?resourceid=2#atdimgtopNot as efficient as using shape geometry
  24. Public Function GetActiveDataGraphic() As Visio.MasterDim mstName As String 'You can get the Data Graphics master from a particlar cell value If Visio.ActiveDocument.DocumentSheet.CellExistsU( _ "User.msvLastAppliedDataGraphic", Visio.visExistsAnywhere) <> 0 ThenmstName = Visio.ActiveDocument.DocumentSheet.Cells( _ "User.msvLastAppliedDataGraphic").ResultStr("") End If If Len(mstName) = 0 Then Set GetActiveDataGraphic = Nothing Else Set GetActiveDataGraphic = Visio.ActiveDocument.Masters(mstName) End If Exit FunctionEnd Function
  25. Do this before saving a document
  26. Data Visualization competency is for Information Worker SolutionsData Management Solutions is just another competency that bVisual has