Welcome to MSDN Blogs Sign in | Join | Help

Rodney Viana's (MSFT) Blog

Post on Sharepoint, IIS and C#
Org Chart Web Part - Part I - Overview and Download

In this post we are going to explore User Profiles by extending the Organizational Hierarchy in MOSS. I've posted in Codeplex both installer and code for the Organizational Chart Hierarchy web part. This post will only discuss installation and configuration. I will discuss the code in posts to come.

What this webpart does:

This web part reads and analyzes the user profiles in MOSS and creates a full hierarchical organizational chart.  See screenshot below:

image

 

What I need to make it work:

1. It requires MOSS (Microsoft Office Sharepoint Server) 2007.

2. It requires you have imported profiles from you AD.

3. In order to have the hierarchy displayed correctly you have to include managerial and department information for all users who have manager (see the example in the snapshot below).

image

4. You have to edit the departmentconfig.xml file if you want links to the department sites. After the install, this file normally is found at: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\OrgChartPart\. This file is only available after the install is complete.

5. Just edit, add or delete <Mapping Department="[Department Name As in Profile]">[url]</Mapping> entries as appropriate. The mapping must be exact. As the example below (this entry is case sensitive):

<Mapping Department="Operations">http://myweb/sites/operations</Mapping>

 

Installing Steps:

1. Download the latest release here: http://www.codeplex.com/orgchartpart/Release/ProjectReleases.aspx?ReleaseId=15590 and save in a folder you will remember later (eg. c:\downloads).

2. Go to MOSS Bin folder, commonly at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN

3. Run the following commands from the command prompt when logged as farm administrator (assuming the .wsp file is in C:\Downloads):

stsadm -o addsolution -filename c:\downloads\OrgChartPart.wsp
stsadm -o deploysolution -name c:\downloads\OrgChartPart.wsp -allowgacdeployment -immediate
stsadm -o execadmsvcjobs

4. Go to the shared services provider you use for personalization in Central Administration.

5. Choose Personalization services permission under User Profiles and My Sites.

6. Make sure NT AUTHORITY\Authenticated Users has "Personal Features" and "Personal Site" rights.

image

 

7. Go to the site collection you want to include the web part (eg. http:/myweb).

8. Go to Site Actions | Site Settings | Modify All Site Settings

9. Go to Site Collection Features under Site Collection Administration

10. Activate Org chart Web Part

image

 

11. Verify if OrgChartPart is available in the Web Part Gallery of the Site Collection (Site Actions | Site Settings | Galleries | WebParts)

image

 

12. Add the web part wherever you want in a page

13. Make sure you adjust the web part to render correctly:

image

 

Notes:

  • The beautiful tree layout in Javascript was developed by the talented Emilio CL and can be found here: http://www.codeproject.com/KB/scripting/graphic_javascript_tree.aspx
  • Don't try it in a large Enterprise with over 500 user profiles. It will work but will be slow. A few modifications are necessary to enable better performance.
  • Next post will be about the source code.
Posted: Friday, July 25, 2008 3:12 AM by Rodney Viana

Comments

AACLAGE said:

Excelent article, just give some other goog ideas, here you use the MOSS, but i change to use the the wss3.0 with AD and integrated users photos, excelent post.

# July 26, 2008 11:12 AM

Tariq said:

In installing steps: Refer to point 3 correct command is  

stsadm -o deploysolution -name c:\downloads\OrgChartPart.wsp -allcontenturls -allowgacdeployment -immediate

# July 28, 2008 7:19 AM

SharePoint por Hector Insua said:

En un alto porcentaje de los proyectos en los que he trabajado, siempre la visualización del Organigrama

# July 28, 2008 9:54 AM

Rodney Viana said:

Hi AACLAGE,

Cool. Share the code with us in a comment entry.

# July 28, 2008 10:25 AM

Rodney Viana said:

Hi Tarig,

It is not necessary to add -allcontenturls as it is a farm wide solution.

Cheers

# July 28, 2008 10:29 AM

Rodney Viana said:

Ola Hector,

I've checked your post. Thanks for taking the web part to the Spanish speaking audience.

# July 28, 2008 10:40 AM

Mirrored Blogs said:

En un alto porcentaje de los proyectos en los que he trabajado, siempre la visualizaci&#243;n del Organigrama

# July 28, 2008 10:41 AM

SvenE said:

This webpart is exactly what we need.

We followed your instructions, but we had problems installing the webpart.

If we want to add the webpart to a site we got an error message (unknown error). It takes about 2 minutes until the error message appears. There aren't any error messages in event log of Windows. The permissions are set correctly for NT AUTHORITY\Authenticated Users.

Do you have an idea?

Thank you in advance.

SvenE

# July 28, 2008 11:33 AM

Rodney Viana said:

Hi SvenE,

Try it again and just after you finish the trial see what the MOSS log says. It is normally located at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN and if you sort by date or creation descending you will see the latest log on top. Go to the final lines and look for something related to the webpart and let me know what it says.

If you have problems identifying the error in the log file, turn the stack trace on (turn it back off later). See more details here:

http://www.sharepointblogs.com/michael/archive/2007/06/28/sharepoint-under-the-hood-see-real-error-description-and-callstack-stack-trace.aspx

# July 28, 2008 12:29 PM

SvenE said:

The stack trace shows the following message:

[HttpException (0x80004005): Request timed out.]

At the first time, I could add the web part to the site, but the org chart didn't show anything (only access denied). After that i set the permission to all authenticated users in Shared Service Provider.

Now I get this error code...

# July 29, 2008 4:05 AM

Rodney Viana said:

Hi SvenE,

Take a look at this:

http://forums.msdn.microsoft.com/en-US/sharepointdevelopment/thread/5fb13f00-e557-4f97-9483-cb32867b3505/

But it seems you have more than 500 users. Wait a little bit until put the webpart in production. I'll add some changes to enable performance for companies with over 500 profiles.

# July 29, 2008 10:21 AM

Mirrored Blogs said:

Corpo: Olá pessoal, tudo bom? Estou montando este post para compartilhar uma novidade bastante interessante

# July 31, 2008 10:44 PM

AACLAGE said:

Hi,

Like i say the big issue is use the "UserProfileManager"

you can get the user by a list call

SPList list = web.Lists["User Information List"];

then you only have to get the values there.

Mappings : List<OrgChartPart.Mapping>

next is the use of line on class:

public class Mappings : List<OrgChartPart.Mapping>

return string.Format("<a href=\"{0}\" class=\"ecolink\" target=\"_new\">{1}</a>", mapping.PublicUri, mapping.Department);

create a link image parameter where you have the photo URL and add to return string

return string.Format("<a href=\"{0}\" class=\"ecolink\" target=\"_new\">{1}</a><img src=\"MyPhoto.jpg\" mapping.PublicUri, mapping.Department);

Sorry cant be more explicit this is not the best place.

Hope this help.

# August 1, 2008 6:49 AM

Jeff said:

Hello,

When I try to run the 2nd command to deploy the webpart, I get the following warning:

This solution contains resources scoped for a Web application and must be deployed to one or more Web applications.

and nothing appears in the Templates folder as described.

Any ideas?

# August 26, 2008 4:22 PM

Jiga said:

I've a Problem, wehen i Publish the Webpart i see a Blue Ball with "Zugriff Verweigert", that means i don't have the Access Right.

My NT-AUTORITÄT\Authentifizierte Benutzer have the Right to read Personal Information.

Where is the Problem?

# September 3, 2008 4:39 AM

Jiga said:

I've a Problem, wehen i Publish the Webpart i see a Blue Ball with "Zugriff Verweigert", that means i don't have the Access Right.

My NT-AUTORITÄT\Authentifizierte Benutzer have the Right to read Personal Information.

Where is the Problem?

# September 3, 2008 4:46 AM

Jen said:

Rodney -

This is a GREAT webpart.  I was wondering if you had an ETA as to when the performance enhancements to support 500+ users would be completed?  If not, can you describe what you were thinking of doing so that I can give it a shot?  

Also, I am trying to use the web part as a vertical tree view that will display the hierarchy for an employee based on where they exist in the hierarchy (i.e. Director sees only his Managers, and the employees that report to his managers).  Then I will use this tree view list as a provider to a list of documents relating to the employee selected in the tree...

Do you think this is feasible, and if so, do you have any suggestions on how to do this?  We have several web applications that we are working on in our organization that require this functionality in a webpart.

Thanks much in advance!

Jen

# September 4, 2008 9:55 AM

barrypre said:

We have 3000 users in the organization. The webpart is not working correctly. Are you planning on releasing your improved source code soon? Or are you going to present your code in a new post?

On a smaller test dataset it looks good.

Thanks and Best Regards

# September 17, 2008 4:19 AM

Apple said:

Can the organisation chart be filter out into department by department?

# September 24, 2008 1:40 AM

Pierre said:

I got this message when i try to add or view the webpart :

"Impossible de charger le fichier ou l'assembly 'Microsoft.Office.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' ou une de ses dépendances. Le fichier spécifié est introuvable. à OrgChartPart.OrgChartPart.PopulateOrg() à OrgChartPart.OrgChartPart.Render(HtmlTextWriter writer)"

which means that it can't load the assembly Microsoft.Office.Server because it can't find the file.

can you help me plz ?

# October 8, 2008 3:08 AM

Bernhard said:

Hi,

thanks a lot for this great webpart!

It works really fine but the display of the department name. If I change some of the webpart settings, it takes some seconds until it is displayed and in this case also the department info are displayed correctly.

If I hit the refresh button, instead of the department names "Fatal:Unable to connect to the remote server" is displayed while the names of the employees are still displayed correctly.

I changed the cache time in the Org Chart settings to 24 (hours) but it seems to have no impact on the problem.

Do I have to change some timer settings or what could be the reason for this behaviour?

Thanks a lot!

# October 16, 2008 2:15 AM

Peter Moys said:

I've added the webpart and done everything i think i'm supposed to.  However, the orgchart is blank when i try to view it on the MOSS server itself, and gives this error message when i try to view it on a workstation:

Access Denied: Only an administrator may enumerate through all user profiles.

Can you give me any advice.  According to the crawl log, i have 285 user profiles imported so i don't think my org is too big.

Any help gratefully received,

Peter

# October 16, 2008 8:02 AM

crsnt said:

Hi,

I installed the webpart. But when I added it on the site, the chart is not showing up.

Does each user have to have Department info filled in?

and Manager info? or both?

Cheers.

# October 27, 2008 1:07 AM

Jeff said:

In case anyone has trouble running the stsadm -o addsolution command, be aware that the account you are running that account under must have access to the Admin Content Database. If you go add an account to the server farm admin area under SharePoint Central Admin > Operations, that is not enough.

# November 26, 2008 5:52 PM

Amir Parsa said:

Hi Friend

Please edit Title of this post.

ORG Chat ---> Org Chart

# December 2, 2008 12:26 AM

Rodney Viana said:

Hi Amir,

Good catch. I fixed it :)

# December 2, 2008 1:31 AM

Dave Lewis said:

I am wondering if I could possibly get the code from you I see in your post that you posted it on codeplex but all I can find is the installer.  The reason I need the code is I want to make modifications to it to include things like secondary manager and so on.  if you still have the code somewhere I would really appreciate taking a look at it if possibl

# December 4, 2008 11:07 AM

Rodney Viana said:

The source code is in the codeplex as well. You can download going to the appropriate tab:

http://www.codeplex.com/orgchartpart/SourceControl/ListDownloadableCommits.aspx

# December 4, 2008 1:05 PM

Ashwin Bhagwat said:

Hi Rodney Viana...

Nice post... I have installed OrgChartPart.wsp

I have added webpart page... Where I hav added OrgChartPart Web Part... But it displaying only Title as OrgChartPart... M I missed something...???

Please Help me... Thanks !!

# December 6, 2008 2:43 AM

lattelis said:

Hi,

I install your webpart.

It works correctly when I'm logged as administrator.

But when I'm logged as simple user, I get an error message ("Fatal:The remote ...") in place of each user's title and company.

Did you have an idea ?

Thanks

# December 22, 2008 3:53 AM

Rodney Viana said:

Hi Lattelis,

Did you follow step 6? What kind of authentication are you using?

Thanks,

Rodney

# December 22, 2008 8:12 PM

Douglas Filipe said:

Ola Rodney,

instalei a webpart, consegui adiciona-la ao website mas ela fica em branco o organograma nao é gerado. editei o arquivo departmentconfig da seguinte forma:

 <Mapping Department="TI">http://es99:26760/RH/</Mapping>">http://es99:26760/RH/</Mapping>

</Mappings>

TI: é o departamento da minha empresa

http://es99:26760/RH/: é o site onde está a orgchart.

Tem alguma ideia do porque da webpart ficar em branco?

# December 30, 2008 1:38 PM

Rodney Viana said:

# December 30, 2008 7:32 PM

milindmilind said:

Thank you very much for this useful Web Part. I will share my cutomized edition with you. In customized edition I have made it show the tree from the node I want. Now, I need to understand how can upward navigation implemented in this? i.e. how can I go to the parent/manager from root node.

# January 8, 2009 5:44 AM

Les Catlin said:

I've added the webpart and done everything i think i'm supposed to.  However, the orgchart is blank when i try to view it on the MOSS server itself, and gives this error message when i try to view it on a workstation:

Access Denied: Only an administrator may enumerate through all user profiles.

(I have only 103 user profiles).

# January 14, 2009 3:44 AM

Rodney Viana said:

Hi Les,

Review step 6 for the permission problem and see:

http://www.codeplex.com/orgchartpart/Thread/View.aspx?ThreadId=40087

For your blank page problem.

# January 14, 2009 9:01 AM

Panayotis Tzedakis said:

Hello,

This looks like an excellent webpart!!!

I have one question I would appreciate your answer.

We currently have ~2000 user profiles but NONE of them has managerial/departmental info on their AD profile. We are only interested in presenting the Organisation Chart for the 1st line of managers in the company. If we assign Manager/Department info to these 20-30 user profiles, will your web part be slow in rendering such an OrgChart ?

Thank you in advance for your time and help.

Panayotis Tzedakis.

# January 25, 2009 11:55 AM

Pavelik said:

Hi Rodney, nice part, but i have xml:

<Mapping Department="Operations">http://incartech/IT</Mapping>

<Mapping Department="Finance">http://incartech/ERP</Mapping>

and in Organization in AD realy have both depts in xml, but chart show nothing. Before i change them, tehy show all. Thx Pavel

# February 10, 2009 5:24 AM

Pallavi Pathi & Lavanya chalasani said:

We have used a visio file where the organization chart with the pictures are drawn.

The easy steps without any coding are :

- Import the excel details to visio file, create the org chart

- right click on the name and insert the picture

- Save the visio file as an XML stencil - .vsx file

- save this under the MOSS/WSS site directly

- Used a "page viewer web part" and provided the above link and set the page length and width.

- The visio functionality of editing the org chart is allowed with a stencil in the online site. No more code/progammer effort to change it

We have roadblocks though, can someone help us

- the site takes 3-4 minutes since the visio chart is with picutures, how can i reduce this time... any option like buffering etc etc... I am not a programmer hence may not know the options

- though the margin is set in the visio file, there is still an extra space on the SPS page viewer window that is not nice to look at. How can I avoid it.

Our IDs are : ppathi@deloitte.com;lchalasani@deloitte.com

# February 20, 2009 5:29 AM

Giles said:

To addition to step 6 I have found that I need to add the "Manage user profiles" permission as well to get a ersponse out of this web part. Even still I believe I have too many AD profiles for this to work correctly for my site as the page eventually times out and "errors" after taxing the server CPU for a few minutes.

Good looking web part though - would love to see an extended version ;)

# February 20, 2009 11:15 AM

Wei Hann said:

Hi, thanks for the great webpart. I am able to display everything but when i try to filter by department using the method mentioned above, it still giving me everything instead of filtering. Lets say i have http://myweb/sites/sitedirectort/research/default.aspx, i added:

<Mapping department="Business">" href="http://myweb/sites/sitedirectort/research</Mapping>">http://myweb/sites/sitedirectort/research</Mapping>

is that correct? or am i missing something?

Thanks!

Best Regards,

WeiHann

# March 5, 2009 10:11 PM

Rodney Viana said:

Hi Wei,

Mapping is not for filtering, it is only to create a link to departments. As of now there is no filtering mechanism.

Thanks.

# March 6, 2009 12:14 AM

John said:

Have you made the updates yet to improve performance for deployments with more than 500 profiles?

# March 12, 2009 9:58 AM

praveen said:

hi Rodney Viana,

   I need to have webpart for 4000 users.so, suggest me the changes to increase performance.

Thanks and Regards

Pravyn

# March 19, 2009 6:34 AM

Rodney Viana said:

Hi Praveen,

Create a job to generate the HTML code and make it run once daily off peak hours. Save the generated HTML code in a property bag scoped to site collection or web application. Change the web part to just render the HTML from the property bag.

# March 19, 2009 5:17 PM

praveen said:

Hello Everyone.

   Rodney did a great job......

     Any one have idea to show images on the nodes??????and filtering by department.

Thanks and Regards,

Pravyn

# March 23, 2009 6:39 AM

Sab said:

Hi Rodney Viana,

It is a wonderful job.

I am very new to sharepoint. Can you please tell me after I customise the javascript file under 12/template/layouts/orgchartpart, do I need to create the solution file and install the web part?

-Thanks & regards,

Sab

# May 6, 2009 2:41 AM

Rodney Viana said:

Hi Sab,

You can use the source code and create a re-deploy. You can also change the Javascript in "12/template/layouts/orgchartpart" in ALL Web Front End (WFE) servers.

# May 6, 2009 7:12 AM

Chris said:

Getting an error at this step:

stsadm -o deploysolution -name c:\downloads\OrgChartPart.wsp -allowgacdeployment -immediate

Syntax error in argument: name.

# May 7, 2009 11:24 AM

Chris said:

Hi,

I manged to get this working ok but I have the problem with Error because we have more than 500 accounts. We probably have about 550. Is there any way to get this working for us? I'm not to good at coding or anything so simple step by step instructions (like the one on this page which were very good!) would be nice.

# May 7, 2009 12:48 PM

Tom said:

This looks good but can't get it working. Installed and ok but getting the same error when trying to add the webpart, probably because we have more than 500 people in AD. But on this test box we only have 20 people in SharePoint.

# May 8, 2009 5:23 AM

Sab said:

Hi Rodney,

As a starter, bit difficult to understand your code.Have you explained the code for this org chart in another post?

I have to display the team members reporting to the same manager in the same node with hyperlinks to their user profiles.

And this has to be done only for the team members as there are many team members and normal tree structure followed for other employees.

Can you please give me the idea of doing this.

I was comparing for the title and same parentOrder in the ReturnItem() but was not able to display the tree.

Please help me in solving this.

-Thankyou,

Sab

# May 13, 2009 6:14 AM

Chris said:

Someone else installed the webpaert and i am now rasked with making it work. After working past the "not registered as safe" issue i am now stuck at an access denied error when i try to open the webpart. The error is displayed as a blue flag after trying to open the webpart.  a link in the error flag opens a browser instance when clicked....no further info as to where access is denied.

Any ideas?  I'm new to SharePoint.

Thanks

# June 15, 2009 4:43 PM

Jason said:

Hi, great web part! I was wondering where I would be able to modify the source so the org chart renders by departments? Thanks for any advice.

# June 18, 2009 12:28 PM

Rodney Viana said:

Jason,

The source code is in the codeplex as well. You can download going to the appropriate tab:

http://www.codeplex.com/orgchartpart/SourceControl/ListDownloadableCommits.aspx

# June 18, 2009 2:40 PM

Rodney Viana said:

Chris,

You can see a lot of troubleshooting ideas in:

http://www.codeplex.com/orgchartpart

Go to discussions.

# June 18, 2009 2:43 PM

Jason said:

Thanks for pointing me out to the source.

By the way, does the web part currently have the ability to redener the chart by departments before i start mucking around with the code? Thanks

# June 18, 2009 3:17 PM

Rodney Viana said:

Jason,

No, you will have to implement your own filtering mechanism. It is a proof-of-concept web part so you can customize.

# June 18, 2009 4:08 PM

Eyad Adwan said:

I faced an issue regarding how the node tree is rendered.

If you try to build a long tree, you cannot see the leftmost nodes. This is the case in IE7

any ideas about this? Please help...

# June 23, 2009 1:55 AM

Rodney Viana said:

Hi Eyad,

You can control the width and height of the control when you edit the properties in the web part. Hope this helps.

# June 23, 2009 10:03 PM

Eyad Adwan said:

i used your idea about how to use the script but i have a big database that am read from, and i cant control the height and width for the web part because it will be too big,actually the problem that the javascript component "ECOtree" render the boxes of the chart outside the page from the left side.

# June 24, 2009 2:28 AM

Peter Brunone said:

So any word on that source code article?  All I see on Codeplex is the WSP file.

# June 29, 2009 12:57 PM

Rodney Viana said:

Hi Peter,

If you go to the Source Code tab you can browse and download the source code:

http://orgchartpart.codeplex.com/SourceControl/ListDownloadableCommits.aspx

# June 29, 2009 2:12 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker