Ya the title has a lot to say and I am disappointed as I write this post.

So I came to a point while I am implementing a SharePoint 2013 project to a client in Egypt, where they are in need for the Organization Chart, ok no problem, or I thought no problem!!

I configured the User Profile, and started a My Site with a test user, then I looked for the Organization Chart, nothing!! Inserting it as web part after clicking “Sites” on top right, you can find under your name “Personalize this Page” to be able to insert a Web Part into My Site. Ok inserted the Web Part, of course the new name in 2013 is “Organization Browser Web Part” anyway..

Organization Browser Web Part is not by default in “My Site”

Problem:

Client doesn’t know SharePoint that well.. so WHO would edit his “My site” to add the Web Part!! Believe me even with a training to them, they won’t.. they will forget.. they are lazy.. CLIENTS
J nothing new.

Solution:

Either I create a feature with event receiver that once activated, it adds the Organization Browser Web Part to all “My Sites”, I think we need as well a Timer Job to check later if there is a new “My site” created to add the web part to it.

Ok.. many steps & lots of work to do but doable, right.

Another case:

We need this Web Part on the Portal itself and not My site.. is when we will say “Sweet times” but it is “miserable times”

Just first enable this feature “SharePoint Server Enterprise Site Collection features”.

Problem:

Now try to add the Organization Browser Web Part in any page, its empty or call it blank or it is not working… I called it BUG.

Solution:

Add a Content Editor Web Part below the “Organization Browser Web Part” and add this script inside it & it will work & Voila!

After searching, I got the script from here

<script type=”text/javascript”>

function CreateHierarchyChartControl(parentId, profileId, type, persistControlId) {

var i = profileId.indexOf(“|”);

var claimsmode = profileId.substr(i-1,1);

if((i >=0 ) & (claimsmode==”w”))

{

profileId = profileId.substr(i+1,profileId.length-i-1);

var initParam = profileId + ‘,’ + type + ‘,’ + persistControlId;

var host = document.getElementById(parentId);

host.setAttribute(‘width’, ‘100%’);

host.setAttribute(‘height’, ‘100%’);

Silverlight.createObject(‘/_layouts/ClientBin/hierarchychart.xap’,

host,

‘ProfileBrowserSilverlightControl’,

{

top: ’30’,

width: ‘100%’,

height: ‘100%’,

version: ‘2.0’,

isWindowless: ‘true’,

enableHtmlAccess: ‘true’

},

{

onLoad: OnHierarchyChartLoaded

},

initParam,

null);

}

}

</script>

Should I tell you Enjoy SharePointing!! Or just cry L anyway god bless us J

Advertisements