Tuesday 12 April 2016

My Findings while migrating SharePoint 2010 to SharePoint 2013

I am in process of migrating SharePoint 2010 to SharePoint 13, here are some of my findings till date:

Please note i have not migrated using content DB attach detach, i am taking STP's or trying to implement same css, scripts in 2013 environment.


Working Perfectly:



  1. My sandbox solution is working as expected after starting the sandbox services
  2. Silverlignt webpart working as expected 
  3. Most of the infopath is working, one issue i noted till date is mentioned below




Not working as expected:

  1. Infopath 
    1. GetUserProfileByName webservice is not working due to claims based, working on it to fix it.
  2. CSS
    1. #RibbonContainer-TabRowLeft changed to #RibbonContainer-TabRowRight
    2.  #s4-leftpanel  changed to #sideNavBox  and  .s4-ca changed to #contentBox
    3. Some new CSS i mentioned in my post
  3. Minimal Download Strategy- Facing issues if this feature is enabled
    1. Page is redirecting with _layouts/15/start.aspx#
    2. Connect to outlook greyed out
    3. Quick edit greyed out
    4. Error when Modifying a View on a List
    5. Error when Creating pages, lists, error "cannot complete this action"

CSS to hide quick launch, ribbon, newsfeed, site action, title row in SharePoint 2013


Below are the css which could be useful to hide tags in sharepoint 2013 pages

// hide newsfeed , skydrive and sites section

#suiteLinksBox
{
DISPLAY: none !important
}

// hide site action button

#siteactiontd
{
DISPLAY: none !important
}

// hide search box , top navigation, site  logo, site title

#s4-titlerow {
DISPLAY: none !important
}


//hide share follow and  edit button

#RibbonContainer-TabRowRight {
DISPLAY: none !important
}


// Hide ribbon 

.ms-cui-tts {
DISPLAY: none !important
}

// Hide Side navigation or quick launch

#sideNavBox
{
DISPLAY: none
}
#contentBox
 {
MARGIN-LEFT: 0px
}

Wednesday 6 April 2016

Export excel to data table using c#

Export excel to data table in c# using OleDbConnection 


 DataTable dt = new DataTable();  
string strpath = "C:\\SheetFinal.xlsx";       
String connstring = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + strpath + ";Extended Properties=Excel 12.0;";
            OleDbConnection con = new OleDbConnection(connstring);          
            OleDbDataAdapter da = new OleDbDataAdapter("select * from [Sheet1$]", con);          
            da.Fill(dt);            

Monday 4 April 2016

Remove hyperlink from lookup/people picker column of Sharepoint list display form


Add below lines of code in your default display form using CEWP, it will remove the hyperlinks from the columns like lookup, people picker

<script src="/sites/SiteName/SiteAssets/jquery-1.8.3.min.js"></script><script language="javascript">

// For muti user column
$("td.ms-formbody[id$='SPFieldUserMulti'] a").each(function (i,n) { $(n).replaceWith("" + $(n).text() + ""); });

// People Picker Column
$("td.ms-formbody[id$='SPFieldUser'] a").each(function (i,n) { $(n).replaceWith("" + $(n).text() + ""); });

// Lookup Column
$("td.ms-formbody[id$='SPFieldLookup'] a").each(function (i,n) { $(n).replaceWith("" + $(n).text() + ""); });
</script>