1

My task is to create an organizational chart in SharePoint that should be linked with Active Directory. I learned some articles and I also found Organization Browser in my site, but I am unable to understand this web part. How can I create an Organization Chart in SharePoint 2013 ? I have implemented the following code, but it shows me only login user information, neither his manager nor his followers.. the javascript code and result image is attached below.

<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>![enter image description here][1]
  • To make this work you should setup User Profiles and a full profile sync should be completed. – Amal Hashim Nov 4 '14 at 11:03
0

Organization chart webpart is available in MySite web application and it works well inside that application.

If you want to display it in other web application then use following workaround.

  1. Export the Organization Char Webpart from MySite
  2. Edit page in and upload the webpart
  3. Add a content editor webpart and place code below

    <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>
    

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.