Uncategorized

Datasheet View error and solution: The list cannot be displayed in Datasheet view for one or more of the following reasons

Error message:

The list cannot be displayed in Datasheet view for one or more of the following reasons:

– A datasheet component compatible with Microsoft SharePoint Foundation is not installed.

– Your Web browser does not support ActiveX controls.

– A component is not properly configured for 32-bit or 64-bit support.

 

Symptom: When trying to click datasheet view in SharePoint 2010 with Windows 10, IE 11, and  Office 2016 (Excel 2016 x64).

 

Solution:

You just need to install the 32 bit Data Connectivity Components.

 https://www.microsoft.com/en-us/download/details.aspx?id=23734

 

By |November 29th, 2016|Uncategorized|0 Comments|

Adding bootstrap apps inside a Page Viewer Webpart

Problem:  Adding a bootstrap app inside a page viewer web part in SP2010 causes the formatting to be messed up.

Reason:  SP 2010 does not have the right compatibility mode required on the master page.

Solution: Open the site in SharePoint Designer

Copy the v.4 master page for the site to a new master page and add the following line as the first “meta” tag:

 <meta http-equiv=”X-UA-Compatible” content=”IE=10″ />

Click save as default master page on the ribbon.  Keep in mind this applies to all pages to the site.

 

 

By |December 18th, 2014|Uncategorized|0 Comments|

Cleaner List View Boxed style using jQuery

I’m sure we’ve all customized Lists in SharePoint to create different types of views. While most of the Styles to choose from aren’t always practical, the Boxed view is an interesting view because it creates a Table along with a row of all your properties and values, for each List item. A common issue with this view is that if you have empty values, it takes up space on the screen and is too “ugly” to use. This is particularly true if your list or library is associated with many Content Types because different Content Types may not populate certain fields. There’s also that hideous column/filter bar that doesn’t seem to have any value on a view like this.

By adding the jQuery below, you can make the Boxed view much more presentable. It will not display columns that have empty values or unchecked (yes/no) values.

$(“table.ms-listviewtable tr td.ms-stylebox table tr”).each(function() {
var [...]

By |May 20th, 2014|Uncategorized|13 Comments|

Accounting for Site / Subsite regional time zone settings

Often times, you will have custom web parts or code that write date values back to lists. In many cases, time zone settings are different across an organization and using DateTime.Now is generally not recommended.

Two scenarios come to mind. #1, when a site changes its time zone to be different than the hosted servers’ time zone. #2,  if a web part was deployed across a Site Collection and used in 5 different sub-sites with 5 different regional time zone settings.

I found the best way to retrieve a date is this here:

// time zone of site
SPTimeZone siteTimeZone = SPContext.Current.Web.RegionalSettings.TimeZone;

// currentTime will contain the current date and time according to the sites’ time zone settings
DateTime currentTime =  siteTimeZone.UTCToLocalTime(DateTime.Now.ToUniversalTime());

This will give you the current time in relation to the Site Regional Settings and will account for changes to the settings.

By |May 17th, 2014|Uncategorized|0 Comments|
  • ps
    Permalink Gallery

    Powershell script to change Sharepoint Information Policy for large document libraries (over 1 million docs)

Powershell script to change Sharepoint Information Policy for large document libraries (over 1 million docs)

Ran into an issue on a SP2010 farm that had over a million documents in a document library with a hundred thousand folders. Yes, lots of data, but not a bad practice in this case as it was tied to another system that relied on the folders.
In any case, I was unable to change information Policy on document library with many thousand folders due to SharePoint’s UI which creates a tree view of folders on the page to change the Information Policy. Not the best design. So as my browser crashed waiting for 100,000 folders to load, we came up with a Powershell script to accomplish this. This script will create an Information Policy to delete all documents inside the document library that are older than 180 days. It is applied to the content type, but is scoped to the document library itself. Other libraries on the site [...]

By |April 29th, 2014|Uncategorized|0 Comments|

Creating a WCF service on a SharePoint 2010 server in Visual Studio 2010 and “Type can not be found” error

If you get the “Type cannot be found” error after installing your WCF service, go to the section about unloading your project below.

Here are the main steps to creating a WCF service and installing it on a SharePoint 2010 server:

Open Visual Studio 2010
Create an Empty SharePoint 2010 project to get the packaging files
Change your namespace in the Project Properties.
Add a new Item, WCF Service with a new file name
Add the following lines above the class declaration that implements the “IService” file:

[BasicHttpBindingServiceMetadataExchangeEndpointAttribute]

[AspNetCompatibilityRequirementsAttribute(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]

public
class
PricingRequestService : IPricingRequestService

{

Add the following references to your project:

C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions14ISAPIMicrosoft.SharePoint.dll
C:WindowsassemblyGAC_MSILMicrosoft.SharePoint.Client.ServerRuntime14.0.0.0__71e9bce111e9429cMicrosoft.SharePoint.Client.ServerRuntime.dll

Add a mapped folder to the “_Layouts” folder
Inside the _Layouts folder create a text file with a .svc extension such as PricingRequestService.svc

Add the following sample: <%@ServiceHost
Language=”C#” Debug=”true”

Service=”PricingRequest.PricingRequestService, $SharePoint.Project.AssemblyFullName$”

Factory=”Microsoft.SharePoint.Client.Services.MultipleBaseAddressBasicHttpBindingServiceHostFactory, Microsoft.SharePoint.Client.ServerRuntime, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c”
%>

Change the namespace and service name to your own. Leave [...]

By |January 10th, 2013|Uncategorized|0 Comments|

Migrate Alerts from old SharePoint url to new SharePoint url

Here’s a handy powershell script to migrate all alert url’s.

 Problem: When you perform a content database migration to a new SharePoint farm with a different url, the alerts will not fire as the url’s are stored from the previous farm.
For example, migrating from “Intranet” to “IntranetQA” will not work as the old url’s are stored.
Here’s the script:
http://gallery.technet.microsoft.com/ScriptCenter/877d2abd-fce9-4545-b223-7637936dd888/

By |September 12th, 2012|Uncategorized|0 Comments|

SharePoint Error in Visual Studio Debugging a workflow: Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))

Leave it to Microsoft to break every SharePoint Dev server in the world in one fell swoop.

When you go to debug a workflow from Visual Studio 2008, it builds fine, but on deploy, it fails while trying to attach to the list with this error:

Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))

Causing the Error: Security patch KB2493987

If you have automatic updates set on your dev servers (which many people do), you will automatically get this security patch.  And, it will break all your custom visual studio debugging abilities on all dev servers.

Solution: = Running the SharePoint Products and Technologies Configuration Wizard and doing an IISRESET.

For a full explanation, see this helpful post: http://deinfotech.blogspot.com/2011/09/sharepoint-2007errors-creating-site-and.html

How to find which version of SharePoint 2010 is installed

http://msdn.microsoft.com/en-us/library/ff721969.aspx

Go to the registry key:

Regedit

HKEY_LOCAL_MACHINE -SOFTWARE-MICROSOFT

   SHARED TOOLS-Web Server Extensions – 14.0

           WSS-Installed Products

Then, match the key that is installed in the list below.
              
“BEED1F75-C398-4447-AEF1-E66E1F0DF91E”, “SharePoint Foundation 2010”
“1328E89E-7EC8-4F7E-809E-7E945796E511”, “Search Server Express 2010”

“B2C0B444-3914-4ACB-A0B8-7CF50A8F7AA0”, “SharePoint Server 2010 Standard Trial”
“3FDFBCC8-B3E4-4482-91FA-122C6432805C”, “SharePoint Server 2010 Standard”

“88BED06D-8C6B-4E62-AB01-546D6005FE97”, “SharePoint Server 2010 Enterprise Trial”
“D5595F62-449B-4061-B0B2-0CBAD410BB51”, “SharePoint Server 2010 Enterprise”

“BC4C1C97-9013-4033-A0DD-9DC9E6D6C887”, “Search Server 2010 Trial”
“08460AA2-A176-442C-BDCA-26928704D80B”, “Search Server 2010”
“84902853-59F6-4B20-BC7C-DE4F419FEFAD”, “Project Server 2010 Trial”
“ED21638F-97FF-4A65-AD9B-6889B93065E2”, “Project Server 2010”
“926E4E17-087B-47D1-8BD7-91A394BC6196”, “Office Web Companions 2010”

By |October 18th, 2011|Uncategorized|0 Comments|

Stupid attachments in Sharepoint, adding email attachments

You would think taking  attachments from a  Sharepoint list and adding them to a mail message would be easy.  Well, not that easy.  They make you jump through hoops and stream the attachment with the file name.  Would have been nice to just take an attachment off a list and then add it to an email using the same attachment object.  Oh well.  Here’s the code I use to take an attachment off a list item, look at the file name, then attach it to an email using System.Mail.

 MailMessage mail = new MailMessage(); 
 SmtpClient smtp = new SmtpClient this.workflowProperties.Web.Site.WebApplication.OutboundMailServiceInstance.Server.Address); 
 mail.Subject = “Subject”

mail.To.Add(wfConfig.EmailTo);
mail.CC.Add(wfConfig.EmailCC);
mail.From = new MailAddress(wfConfig.EmailFrom);
mail.Body =”body”:
mail.IsBodyHtml = true;

 

 //Attachment(s)  
 
 if (workflowProperties.Item.Attachments.Count > 0)
{
      foreach (string fileName in workflowProperties.Item.Attachments)
     {
      SPFile file = workflowProperties.Item.ParentList.ParentWeb.GetFile(
          workflowProperties.Item.Attachments.UrlPrefix + fileName);
    
          if (file.Name.ToUpper().Contains(DocNameToCheck))
          {
            Attachment attachment = new Attachment(file.OpenBinaryStream(), fileName, string.Empty);
           [...]

By |January 25th, 2011|Uncategorized|4 Comments|