Monday, September 12, 2011

Visio Services 2010 – Part 3

This post is the continuation part of the last post. So if you have not gone through Part 1 and Part 2, I would recommend reading them first and then continue reading from here on.

In this post, we are going to see how to add the diagram that we’ve created into the SharePoint and how to display it in the SharePoint site inside the browser even though the client does not have Visio client installed in the machine.

Open the same diagram that we have created in part-2. This time instead of saving it as drawing, save it as a web drawing.



Now we have two options, we can directly use publish button and give path of document library inside a SharePoint site where you want to publish or you can upload manually this wen drawing file that we’ve just saved.



Now open a SharePoint web part page or a page where you want to add this Visio diagram. Edit the page and click on Add Web part and add Visio web access from business data category.



You can also directly click on the drawing file from library. This will open the diagram in full page.

Open the tool pane if you’ve added web part; select the Visio web drawing file from document library and click on Ok. Now we have the diagram displayed inside the SharePoint.



You can see all options like Open in Visio, Zoom buttons, refresh buttons, fit to screen, paging and drag the diagram by using hand tool inside web part options. These options are configurable in web access web part’s properties. However because this web drawing is rendered in Silverlight, hence we get all these options. Should you company has blocked the Silverlight in browsers, then this diagram would have rendered as a PNG image and you do not get several options.



One of the very important feature of rending it as a Silverlight is that you can select the object and then see its properties. That actually gives you an idea about the entire row from database or that specific list item details.

Select the object and click on the icon which is on the right upper corner of the web part which looks like square.



Click the icon gets us the details.



Main advantage of rendering as Silverlight is the interactivity that comes along with shape. We will see it in future post when one shape interacts with other in the drawing.

As you can see it says enable refresh. That means let the web part allow refreshing the drawing by clicking on refresh button. This is due to some untrusted connection. We can always enable the refreshing when we know the data source of the diagram.

Now go ahead and change the list items and come back and see the difference. Let’s change Server A for IT and Server B for finance and see if our diagram changes.

And it does not reflect the change immediately. You can click on refresh and even though it does not change. You need to wait some time and after that click on refresh, and Visio drawing updates automatically.



You can also have auto refresh property setup that determines when to refresh.



0 means the default time used in SharePoint for updating the diagram. Now go ahead and set that timing to one minute. Change the list value, come back to a diagram, and wait for one minute. And bingo you get the updated diagram. Cool, isn’t it? In this case we are lucky. There may be a time where setting one minutes or two minutes or any time in the property may not reflect the changes in diagram. Why is that? Why so? What can be the reason? You need to keep reading to find that out.

Read Visio Services Part-4 for further reading.

No comments:




Share your SharePoint Experiences with us...
As good as the SharePointKings is, we want to make it even better. One of our most valuable sources of input for our Blog Posts comes from ever enthusiastic Visitors/Readers. We welcome every Visitor/Reader to contribute their experiences with SharePoint. It may be in the form of a code stub, snippet, any tips and trick or any crazy thing you have tried with SharePoint.
Send your Articles to sharepointkings@gmail.com with your Profile Summary. We will Post them. The idea is to act as a bridge between you Readers!!!

If anyone would like to have their advertisement posted on this blog, please send us the requirement details to sharepointkings@gmail.com