Getting Search to Work
The
IT Asset Management and Visio’s network shapes in general have a
problem that make the web search function not work properly. To get an
idea of how Search Pages are intended to work, let’s create a simpler
example.
Saving a Visio Drawing as a Web Page
1. | Start a new, blank drawing.
|
2. | Draw a circle, square, and diamond shape.
|
3. | Type the text circle, square, and diamond into the corresponding shapes.
|
4. | Give each shape a different fill color.
|
5. | Select all three shapes and add the Shape Data field “Color” to them.
|
6. | For
each shape, type a descriptive name for the shape’s color into the
Color Shape Data field. For example, I colored the circle, square and
diamond gray, blue and black. Then I entered the values “Gray,” “Blue”
and “Black” in their Color fields.
|
7. | Save the drawing as a web page. A browser window opens showing the exported diagram. You see something like Figure 9.
|
8. | Type Circle
into the field under Search Pages. Then click the green arrow or press
Enter to perform the search. One search result appears below.
|
9. | Click
the Circle item in the Search Results area. An arrow appears over the
circle for three seconds, indicating the location of the shape. If the
shape is off the screen, the drawing is panned to bring the shape into
view.
|
10. | Ctrl+click the square shape. You see its Shape Data in the Details area on the left, also shown in Figure 9. You can also search on Shape Data values.
|
11. | Type the square’s value for Color into the Search Pages field and then press Enter. In Figure 9, a search for “Blue” results in one result: the Square shape.
|
12. | Click on Square in the results area. An arrow temporarily highlights the square shape.
|
13. | Type Color
into the Search Pages field and press Enter. You see the message “No
matches found in the results area.” Only Shape Data values are
searched, not field names.
|
You can see that Search Pages is a nifty and useful feature!
If you try search with a web export of the IT Asset
Management drawing, however, you encounter problems. Very few searches
will be successful, even though you search for data that is in the
diagram.
The problem is with the network shapes used in the
diagram. At some point in history, they were assigned to layers, then
these layers were removed. This left a sort of “empty layer artifact”
behind that oddly causes problems with Search Pages.
You can quickly simulate this with your simple circle-square-diamond drawing if you follow these steps:
1. | Duplicate the diamond shape and leave it selected.
|
2. | Assign it to a layer called “Bug.”
|
3. | Duplicate the new diamond shape (which is on the Bug layer).
|
4. | Remove
this diamond from the layer by unchecking Bug in the Assign to Layer
dialog. Note that your drawing now has three diamond shapes. One was
never on a layer, one is on the Bug layer, and one has been removed
from the Bug layer.
|
5. | Save the drawing as a web page. The browser opens with your new creation.
|
6. | Type
“Diamond” into the Search Pages field and press Enter. Only two results
for Diamond appear, even though three shapes clearly say “Diamond.”
|
I tried to fix the IT Asset Management drawing by
assigning all shapes to a dummy layer. This got me plenty of search
results, but the highlighting arrow never appeared when I clicked a
search result item. If the result was on another page, at least that
page would be brought into view. So adding the layer only half-fixed
the problem.
If I changed the output format to VML and assigned
all the network shapes to a layer, the search worked, and the
highlighting arrow appeared.
It’s sad that such bugs exist to tarnish what is a
really cool web export feature. But knowing about these bugs is better
than getting stuck in a loop, wondering if you have done something
wrong. (I’ve done my best to point out the problems.)
If you need multiple hyperlinks in your web pages,
switch the default format to VML and tell your users to use Internet
Explorer. If your need search to work, try the XAML output format
first. If it doesn’t work, switch to VML. If you have Visio Standard, you can’t change the export options and will have to wait for an update or some other workaround.
And lest we forget, the Go to Page, Pan
& Zoom, and Details controls are bug-free and add wonderful
functionality to your web pages. You get these by default, no matter
which edition of Visio you have, and they work in any major browser
that has the Silverlight plug-in installed.