Using the Visio 2002 Organization Chart Solution

Archived content. No warranty is made as to technical accuracy. Content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Published: October 1, 2001

Visimation, Inc.

Microsoft Certified Partner

Applies to:

Microsoft Visio Standard 2002

Microsoft Visio Professional 2002

Summary This article discusses how a developer can write an application integrated with an existing Human Resources (HR) database to dynamically generate organization charts for users. New features, planning and usage tips, and performance guidelines are also provided.

For the latest information, please see https://www.microsoft.com/technet/prodtechnol/visio/default.mspx and https://www.microsoft.com/office/visio/.

On This Page

Overview of the Organization Chart Solution
New and Improved Features
Create an Organization Chart from an HR Database
Performance Notes
Recommended Reading

Overview of the Organization Chart Solution

Microsoft® Visio® 2002 Organization Chart solution enables you to graphically represent the interrelationships among people, operations, functions, or activities in an organization. Examples of how the Organization Chart solution can be used for hierarchical diagrams other than charts of employees include profit and cost center statements, revenue by region or division, and process flow in factory automation. Using the Organization Chart template, you can:

  • Automatically create an organizational hierarchy by dragging employee shapes on top of other employee shapes on the drawing page.

  • Create multi-paged charts, placing departments on separate pages and synchronizing data between the chart pages.

  • Update an organization chart by comparing it to a newer version.

  • Experiment with different layouts without manually moving shapes.

  • Change the appearance of your chart by changing the style of the position shapes.

  • Generate reports of your custom property data in Hypertext Markup Language (HTML), Microsoft Excel, Visio, and XML file formats.

  • Use the Organization Chart Wizard to automate the creation and layout of organization charts and build charts directly from data in properly formatted text files, Microsoft Exchange Server directories, Microsoft Excel, or Open Database Connectivity (ODBC) compliant applications.

About Organization Chart Shapes

The Visio Organization Chart shapes contain built-in intelligence that enables the shapes to "know" to whom they report. For example, when the user drags an Assistant shape on top of the Executive shape, the Assistant shape appears below and to the side of the Executive. As a user adds shapes to the chart, the unique drop-on-top behavior ensures that the proper organizational structure is maintained.

The intelligent shape behavior is available programmatically too, enabling a developer to assign a specific shape to an employee through a value in the data file. For example, the data source can contain the value Executive in the Master_Shape field for the person at the top of the organization chart to indicate that the wizard should use the Executive shape for this person when it builds the organization chart.

Visio organization chart

Figure 1: Visio organization chart

New and Improved Features

Visio 2002 Organization Chart solution contains many new and improved features including:

  • Hyperlink between same employee shapes using the Organization Chart Wizard The wizard can create hyperlinks between shapes representing the same employee appearing on different pages of the drawing.

  • Include hyperlink addresses within an import source file Your import data file can have a column or field, named HYPERLINK or URL that contains an address that the wizard can store as a hyperlink for a shape. For example, an Executive shape may contain a hyperlink to a document on the intranet outlining the organization's mission and goal statements.

  • Improved Wizard command line interface and programmability You can combine the Silent and Interactive Wizard modes, using the silent mode command line to pass initial data to the Organization Chart Wizard and preload default values in the wizard. You can optionally launch the wizard so that the user can tailor the appearance of the chart.

  • Display multiple custom property fields You can display more than two custom property fields within your organization chart shapes. You can change the custom property fields displayed on your shapes at any time.

  • Change the font You can change the font used for display fields for current and new drawings.

  • Updated Synchronized Copy behavior Prior to version 2002, if a user modified a shape's format or property on one page, Visio automatically updated all synchronized copies of that employee's shape, across all chart pages. In Visio 2002, the properties and displayed text are updated on all pages, but changes to the reporting structure are only updated on the current page. This option enables the user to delete a subordinate shape from one page without the shape being removed from the other page. The Synchronize Relationships command can be used to make the pages consistent. Consult the online Help window (on the Help menu, click Microsoft Visio Help) for more information on the Create Synchronized Copy and Synchronize Relationships commands.

  • Updated Organization Chart Layout behavior Prior to version 2002, Visio automatically arranged the optimal position and spacing for organization chart shapes on the drawing page that had not been dragged into position by the user. With Visio 2002, the automatic layout feature is no longer the default behavior. To prompt the Organization Chart solution to auto-arrange shapes on a chart, on the Organization Chart menu, click Auto-Arrange. To set auto-arrange as the default behavior, on the Organization Chart menu, click Options, and then choose Automatically move shapes into position, when possible.

Tips for the Organization Chart User

  • Using the Organization Chart Wizard to create an organization chart

    As you progress through the Organization Chart Wizard and reach the wizard page on which you choose how much of your organization to specify on each drawing page, select the I want to specify how much of my organization to display on each page option. On the next wizard page, accept the default configuration, which will result in positioning employees without a value in the Reports_To field at the top of their own page in the generated chart. This also places all of the employee's subordinates on the same page as the superior shape. Click Finish.

    After the wizard creates the drawing, you can decide if you want hierarchical groups of employees displayed on different pages. To display employees on a new page, select the manager (for example, superior level) and on the Organization Chart menu, click Create Synchronized Copy, and then select the New page and Hide subordinates on original page options. Then, use the Organization Chart toolbar layout buttons and the Organization Chart menu commands to rearrange the positions. Repeat the process of viewing each page and using the Auto-Arrange Shapes and Create Synchronized Copy commands to create a chart that best visually reflects your organization.

  • Connecting Organization Chart shapes

    To make sure the shapes in your organization chart are connected correctly, use the drop-on-top behavior. By dragging subordinate (employee) shapes directly on top of superior (manager) shapes, you ensure proper connections. If shapes are not connected correctly, features such as Auto-Arrange Shapes, Arrange Subordinates, Hide Subordinates, Move Subordinates, and Export Organization Data may not behave as expected.

Create an Organization Chart from an HR Database

If your company maintains organizational data in an enterprise resource planning (ERP) solution such as PeopleSoft or SAP R/3, you can develop a solution that enables users to dynamically create organization charts from the HR or ERP data without their using the Organization Chart Wizard interactively. A developer can programmatically generate organization charts by:

  • Creating a macro or an executable file that runs the Organization Chart Wizard (_Organization Chart Wizard.exe) add-on from the command line.

  • Running the Organization Chart Wizard add-on from a program using the Run method.

Both of these methods are referred to as silent mode because the wizard does not prompt the user to enter data. Through the add-on, a developer can access all the wizard options and functionality to pre-populate wizard fields, optionally launching the wizard for the user and simplifying dialog box entry. The developer can create fields that are hidden from the user that identify the data source and unique identifiers, and can create additional custom properties—viewable or hidden to the user.

The macro or executable file must include the statement:

_Organization Chart Wizard.exe <arguments>

There are currently 20 wizard-supported arguments that can be used to specify how to build the organization chart. The full list of arguments is well documented in the Visio online Help (on the Help menu, click Microsoft Visio Help). The following arguments are new or improved with Visio 2002 Organization Chart:

  • /HYPERLINK-FIELD=<fieldname> Use this optional argument to specify a field in the data file where the wizard can find an address to be stored as a hyperlink for the shape.

  • /CUSTOM-PROPERTY-FIELDS=<fieldname> HIDDEN, <fieldname> HIDDEN, … The HIDDEN modifier is new for this optional argument and provides the ability to create custom properties that are invisible to the user. Use this modifier, for example, if you are creating an organization chart that shows the hierarchy of tasks from Microsoft Project, and you want to store the Project Task ID value as a hidden custom property.

  • /HYPERLINK-ACROSS-PAGES Use this optional argument to specify that all shapes representing the same employee and appearing across different pages of the drawing contain hyperlinks to each other.

  • /LAUNCHGUI Use this optional argument to specify that the Organization Chart Wizard dialog box is displayed to the user, enabling the user to modify the preloaded values except the data values specified in the /FILENAME, /DATASOURCE, or /MICROSOFT-EXCHANGE arguments.

Note: The argument string length is limited to 100 characters, and must be accounted for by the developer when programmatically calling the add-on via the Run method. Calling the add-on from the command line silent mode automatically breaks the command line at the maximum length.

Each time the wizard is run interactively or in silent mode, a text file called OCWIZ_CmdLine.txt is generated by the wizard and stored in the temp directory. The file contains the command you can use in silent mode to recreate an identical wizard configuration, which assists in testing the silent mode argument string. This file is particularly useful when configuring the wizard to access an ODBC data source.

Note: The OCWIZ_CmdLine.txt file is provided "as is" and is undocumented, untested, and unsupported by Microsoft.

Microsoft HeadTrax is an example of an application that uses the Run method to dynamically generate organization charts. The online Help (on the Help menu, click Microsoft Visio Help) provides sample code as a guideline for using the Run method. In Help, search for the topic "Run the Organization Chart Wizard from a program using the Run method."

About Microsoft HeadTrax

HeadTrax is an intranet application that provides a single repository for Microsoft corporate-wide headcount information. A developer can create an application like HeadTrax, integrating with any existing ERP or HR database such as SAP R/3 and PeopleSoft with very little effort. The Visio Organization Chart application in HeadTrax is a small project to undertake (approximately 250 lines of code) that provides a significant pay-off in benefit and cost savings to an organization.

Microsoft created and first deployed HeadTrax in 1997 to provide quick and easy retrieval of accurate and up-to-date personnel information throughout the company. Through HeadTrax, managers can view employees by cost center or by their position in the organizational hierarchy. They can also perform ad hoc queries against organizational data, and look at headcount information in both a current view and a projected fiscal month end view. For example, a manager can query for all employees with a specific job title in one division of the organization. HeadTrax communicates directly with SAP R/3 to ensure that the HR information in the SAP R/3 databases contains current data on all employees and positions.

To develop the HeadTrax application, Microsoft developers used Microsoft Visual Basic® and ActiveX® controls. Users access the HR information through HeadTrax from their desktops running the Microsoft Windows® 2000 Professional operating system using Microsoft Internet Explorer version 5.0 or higher. HeadTrax closely integrates with Microsoft desktop application software like Excel and Visio. Through Visio, employees can automatically generate organization charts containing data on an employee or position, including telephone number, email address, and building location. In addition, users can quickly add, delete, or move positions in the organization chart, enabling managers to plan for and communicate organizational changes.

Create Organization Charts in HeadTrax

To create an organization chart in HeadTrax, the user clicks the Organization Chart button, displaying a dialog box where the user can select the criteria from which the organization chart is to be created. For example, the user can select the manager's name, the number of levels of reports to be included, and whether to include contingent and open staff in the chart. The user then selects the fields to be displayed on the chart—for example, a preferred name, title, and work place. The selections made by the user on the dialog box result in producing an appropriate SQL query that is sent to a backend database, retrieving the data to generate the chart. When the user clicks Finish, Visio is launched, running the Organization Chart Wizard add-on in silent mode, and passing the specified parameters to the add-on through the Visio RUNADDONWARGS function (for more information on RUNADDONWARGS, consult the Developing Microsoft Visio Solutions book listed in Recommended Reading). The user can print the chart, email the chart to another user, or publish the chart to the Web.

HeadTrax runs on Microsoft Windows 2000 Advanced Server with Internet Information Services (the Web server built into Windows 2000 Server) and Microsoft SQL Server™ 2000, and incorporates seven Microsoft products and technologies.

Before Developing the Application

Before you begin developing an application like HeadTrax to automatically generate organization charts for users, consider the following:

Import file format

The Organization Chart Wizard can read properly formatted data from:

  • Text files

  • Excel spreadsheets

  • Microsoft Exchange Server directories, through the Microsoft Application Programming Interface (MAPI)

  • Databases created by an ODBC compliant application like Microsoft Access or SAP R/3

If the data source is ODBC compliant or MAPI based, the wizard can read the data directly from the source providing the data is formatted according to the guidelines required by Visio.

For ODBC databases, you can typically format the data for organization charts by creating tables or views of tables and using the view as the reference for the import operation. However, if your database cannot set up a view of a table in a specified format or if your source is other than MAPI or ODBC compliant, then you must first extract the data from the database into a properly formatted file before you can import the data into Visio through the wizard. A developer may need to include the steps necessary within the application to extract data from the source into a properly formatted file.

Note: Visio Organization Chart expects a physical file containing the data to exist. A developer cannot create an application that holds the data to be imported within a referenced memory range.

Uniquely identify each record

The Organization Chart Wizard must be able to uniquely identify each employee in the data source. A unique identifier field must exist in the data that contains values that are unique for each employee. These unique values are also used in the Reports_To field to specify the superior/subordinate relationships between the employees. A unique identifier field can be provided in one of the following methods:

  • If every employee name in the Name field is unique, the Name field can be used as the unique identifier. For example, the Reports_To value for employee Ken Bergman is Amy Jones. A record with the value Amy Jones in the Name field must exist in order for Ken Bergman's reporting structure to be correctly drawn on the organization chart.

  • Since the values in the Name field generally are not guaranteed to be unique, the most flexible and common structure is to use a specific Unique Identifier field that contains unique values for each employee. You must also assign the value in this field to the Reports_To field. With this structure, the value in the Unique Identifier field is unique, and the Name field need not be unique. However, the value in the Reports_To field must correlate to the value in the /UNIQUEID_FIELD.

Note: Often, problems experienced during the import data process are caused by inconsistencies within the source data related to the unique identifier and Reports_To fields. For example, if the Name field is the unique identifier field, with an employee named Bob Hoffman, a subordinate employee with a Reports_To value of Robert Hoffman will not create the proper reporting structure. An exact match must be found.

Create unique identifiers for HR and ERP databases

Many HR database systems contain separate tables for employee data and job position data, and each table typically has a unique key (identifier). For example, the unique key for employee data can be a personnel number, such as you might see printed on a badge, and the unique identifier for position data can be a position number, as printed on headcount reports.

To create an organization chart, you need details from both the employee and position tables because names, titles, and other personal details displayed in shapes are retrieved from the personnel table, and the reporting structure or hierarchy of the chart is typically derived from the data in the position table. However, using the personnel number or position number alone may not be sufficient to create a unique identifier for each shape on the chart and you may need to combine the two values.

For example, an open position may have a position number assigned but no personnel number because an employee is not associated with the position; in this case, personnel number cannot be used as the unique identifier. Another example is if two employees share the same job. The position number is no longer unique since both employees are associated with one position. To create a unique key in these examples, combine the personnel and position numbers.

Determine whether to create custom dialogs

Consider whether the application can use the existing Organization Chart Wizard dialogs, or if you should create custom dialog boxes to accommodate the behavior you want for your application. For example, will the application require the user to enter more or less data, or have more functionality than the wizard offers? If your application has requirements beyond what is included in the wizard, then you will need to create custom dialog boxes.

The HeadTrax application includes custom dialog boxes you can use to designate an employee as an Assistant on a chart. HeadTrax then creates a separate text file to be imported into the wizard containing the additional information in the Master_Shape field.

Determine whether you want to generate static or dynamic charts

Do you want the application to create static organization charts or charts that are dynamically created at a user's request? If you create static charts and, for example, publish the charts to the Web, you can also schedule a script to run that periodically updates the charts. Alternatively, an application that dynamically creates charts for users provides more flexibility, enabling the user to tailor a chart to a specific reporting structure.

Set upper bounds on the chart size

Per this article's Performance section, consider setting upper limits on the number of employees or reporting levels a user can include when generating a chart. Wizard processing begins to slow for selections of more than 1,000 employees. Consider including a procedure within the application that counts the number of employees requested within the selection before creating the chart. A dialog box can be displayed to the user, notifying the user of the estimated length of time the chart will take to display, or limiting the selection to a reasonable number of reporting levels.

Performance Notes

The information in this section is a guideline since official Visio 2002 Organization Chart performance benchmarks are not available. Application performance is affected by many variables such as hardware and software configuration, other applications running on the system at the same time, as well as the following factors:

  • Complexity of chart Generating an organization chart by importing a source file can require significant time to complete. This task is affected by the variables mentioned above, as well as the overall complexity of the chart you are generating, by the number of chart pages specified in the Organization Chart Wizard, and by how the data records are divided across multiple pages.

  • Size of chart The processing time required for the Wizard to import a file and generate a chart is affected by the size of the drawing to be created and, to a much lesser extent, by the size of the source file. The Organization Chart Wizard stores only the data needed to create the chart. Importing a source file that creates a chart containing approximately a thousand shapes and associated properties should process relatively quickly. If you have a large amount of data to include in your chart, such as several thousand records, consider breaking the chart into several drawings using smaller logical components—for example, by a department code, title, or other meaningful data.

    You can improve performance by assigning a field in your data source as the unique identifier for each record using the command line /UNIQUEID-FIELDargument. If the /UNIQUEID-FIELD argument is not specified, Visio searches for a field in the data source containing the same value as found in the Reports_To field (/MANAGER-FIELD).

    For example, an Excel spreadsheet containing 10,000 employee records, generating approximately 500 shapes per drawing page, creates a 20-page organization chart drawing. The wizard will slow after the first 1,000-2,000 records are processed and generating the chart may require several hours to complete, perhaps overnight depending upon your system configuration. On under-configured systems per the recommended guidelines, the system may run out of memory (a virtual memory error), preventing Visio Organization Chart from generating the chart.

System Requirements

Visio 2002 should be installed on a platform adhering to the recommended system guidelines published by Microsoft.

Recommended system requirements

  • Pentium III class processor with a minimum of 128 megabytes of memory

  • Windows 2000 Server or Professional operating system

Minimum system requirement

  • Pentium 200 MHz or higher class processor

  • Windows 98, Windows NT 4.0 Service Pack (SP) 6, Internet Explorer (IE) 4.01 SP 1, or Windows 2000 Server or Professional operating system

Make Visio 2002 Organization Charts from Personnel Files

https://office.microsoft.com/assistance/2002/articles/spotlight5_July00.aspx

Create Flexible Organization Charts with Visio 2002

https://office.microsoft.com/assistance/2002/articles/spotlight4_July00.aspx

Developing Microsoft Visio Solutions, Microsoft Corporation, Microsoft Press, June 2001.

https://www1.fatbrain.com/asp/bookinfo/bookinfo.asp?theisbn=0735613532&p=technet&s=29736"https://www.visimation.com/">https://www.visimation.com/