Archive for SharePoint

MOSS 2007 Document Library PDF Upload Error-File Size Issue

Problem: I have a MOSS 2007 farm (on Windows 2008 Service Pack 2) that is 5 years old, and i’ve never had problems uploading a PDF document until [Today]. My freaking Document Library wouldn’t let me upload a pdf that is 44 MB in size. The default file size limit for web applications is 50 MB. I changed the limit to 500 MB in Central Administration, but it still wouldn’t upload!

Solution: I found a couple blogs that said this is a MS bug for MOSS 2007 farms on Windows 2008, and that the solution is to add this code below to the web.config file. I did it and it worked for me.

  • Remote into WFE
  • Open IIS 7
  • Right-click on site in question (Extranet39979 in my case), click ‘Explore’
  • This will open up a window at this location: inetpub\wwwroot\wss\VirtualDirectories\Extranet39979 and you should see your web.configuration file
  •  Make copy of web.configuration file
  • Open web.configuration file in Notepad and paste this code at the end of the file after the <system.net> tags:
<system.webServer>
  <security>
    <requestFiltering>
      <requestLimits maxAllowedContentLength="52428800"/>
    </requestFiltering>
  </security>
</system.webServer>

 

<system.net>
    <defaultProxy>
      <proxy autoDetect="true" />
    </defaultProxy>
  </system.net>

  <system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="52428800"/>
      </requestFiltering>
    </security>
  </system.webServer>

    <location path="_vti_bin/ReportServer/ReportServiceAuthentication.asmx">
      <system.web>
        <authorization>
          <allow users="*" />
        </authorization>
      </system.web>
    </location>
<spSolutions><dataZoom><providers /></dataZoom></spSolutions>
</configuration>

SharePoint 2010 SPD Workflow if Date is Empty

Problem 1: I need to build a SPD workflow where If ‘completed date’ is empty and ‘status’ field is ‘completed’, then fill in ‘completed date’ field with ‘modified’ field (‘when an item is created’, and ‘when an item is changed’).

Problem 2: SPD Workflows do NOT have the ‘is empty’ option on date fields. Whaaaattt?

Solution:

  • In Step 1, use the ‘Set Workflow Variable’ action to create a variable called ‘CompletionDate’. Set this variable to Current Item:Completed Date, Return field as: As String.
  • Then in Step 2 you will have a string variable that has the ‘is empty’ option …. see picture below:
  •  

 

Excel Services Stops Working – Whaaaattt?

Problem: I have a brand new SharePoint Server 2010 farm, only a few months old and up until today my Excel Services was working flawlessly. Today, however, I noticed that my dashboard pages were all displaying error messages in my Excel Access web parts. All of them displayed the pop-up error box with the message: “Unable to process the request. Wait a few minutes and try performing this operation again.”

Solution: I did an IIS Reset on my WFE and my Apps servers, and it magically fixed everything.

SharePoint 2010 Branding Options: Master Pages vs. Themes: Part 3

Adding a sticky footer to your custom master page using SharePoint Designer 2010

Adding a sticky footer to your master page is one of those basic things that takes a lot longer in SharePoint than it should. My first attempt at sticking a footer to the bottom of my page ended unsuccessfully with the footer always being about 100-200 pixels above the bottom of the page. I took a deep breath and asked my good friend Google for help. Google introduced me to Elio Struyf’s most excellent posts straight out of Belgium.

Struyf, Drisgill and other experts note that the javascript used to control scrolling in the Ribbon Positioning System (docked by default at the top of each SharePoint 2010 page) is the main culprit causing all of this footer kerfuffle. They offer advice on how to disable the Ribbon Position System (RPS) so that it is undocked, but I like having it docked. Fortunately, Struyf has a master page for the default docked ribbon (I use this one) as well as the undocked ribbon.

By adding some new div tags to the html of the master page, some new CSS, and tweaking some attributes in the V4.masterpage, Struyf has built a master page that sticks the footer to the bottom of the page while keeping the RPS docked at the top of the page.

Here are the steps and screenshots I took to add his master page to my farm:

  1. Downloaded his master page from his web site: V4.Master_Footer_Docked_Ribbon to my desktop
  2. Navigated to the Master Page Gallery in my Site Collection and uploaded the master page
  3. Opened site in SharePoint Designer 2010, and opened new master page for editing
  4. Copied and pasted the CSS from his header to my custom style sheet
  5. Added a line of code in the header to attach my custom style sheet (see Part 2 for instructions)
  6. Saved, Checked-In, Published, Approved Master Page
  7. Refresh browser to view footer (screenshot)!

Screenshot 1: V4.master Head (click image for larger view)

Screenshot 2: V4.Master_Footer_Docked_Ribbon Head (click image for larger view)

Screenshot 3: V4.master footer (no footer yet) (click image for larger view)

Screenshot 4: V4.Master_Footer_Docked_Ribbon footer (click image for larger view)

Screenshot 5: CSS from V4.Master_Footer_Docked_Ribbon (I moved this code from Elio’s master page to my custom style sheet)


Featured Series of Posts on Branding Options in SharePoint 2010:

0. SP 2010 Branding Options: Master Pages vs. Themes: Overview
Why I prefer custom master pages over custom themes in SP 2010

1. SP 2010 Branding Options: Master Pages vs. Themes: Part 1
Attaching an alternate style sheet to the master page using the browser’s UI

2. SP 2010 Branding Options: Master Pages vs. Themes: Part 2
Attaching an alternate style sheet to the master page using SPD 2010

2.1 SP 2010 Branding Options: Master Pages vs. Themes: Part 2.1
How to edit the master page to add a custom logo and a favicon with SharePoint Designer 2010

3. SP 2010 Branding Options: Master Pages vs. Themes: Part 3
Adding a footer to your custom master page using SharePoint Designer 2010

4. History of SharePoint Branding: 2007 to 2010
A tribute to Heather Solomon’s legendary blog posts on MOSS 2007 themes and master pages

5. SharePoint 2010 CSS: List of Useful Styles

SharePoint 2010 Branding Options: Master Pages vs. Themes: Part 2.1

How to edit the master page to add a custom logo and a favicon with SharePoint Designer 2010…

Favicon and Custom Logo

Favicon and Custom Logo

Follow the first few steps (1-5) in the previous post, Part 2, to open your master page and show the Code view in SharePoint Designer 2010.

Here is the code to edit the existing Favicon code in the tags (screenshot):

<SharePoint:SPShortcutIcon runat="server" IconUrl=" http://yourServer.com/images/favicon.ico"/>

There are at least 3 options to add a custom logo (Drisgill et al., pg 227):

  1. Use an HTML image tag: <img src=”customLogo.gif” alt=”Happy face”/>
  2. Use a CSS background-image property:
    .s4-title  {
    background-image:url('customLogo.gif');
    }
  3. Use the SharePoint control. I chose this option since it allows you to “set a default image for the master page that can be overridden by the SharePoint web interface from the Title, description, and icon Site Settings page (Drisgill et al., pg 227).” Here is the code I used in the Body to set the default custom logo and the link URL, and a screenshot of where I put it in the master page:

<SharePoint:SPLinkButton runat="server" NavigateUrl="~site/"                                     id="onetidProjectPropertyTitleGraphic">
<SharePoint:SiteLogoImage                                                     LogoImageUrl="http://yourServer/images/customLogo.gif" runat="server"/>
</SharePoint:SPLinkButton>

Note: I have found it easiest to keep my custom site logos, favicon, and custom CSS externally (external from the SharePoint farm) on one of our web servers. That way I can just paste in an absolute URL for the custom logo, favicon and CSS where needed, and I can go to one place to update these files. For example, after a quick update to the CSS file I just have to save it there in one place, rather than re-deploying to the various Style Libraries. I don’t like to access the SharePoint server if I don’t absolutely need to, I am superstitious that way. We are in a relatively small work environment with under 500 users and I am the main SharePoint person. We don’t do any custom coding, we have a codeless environment with no Visual Studio action for custom features or solutions to deploy this stuff for me, so this has been the best solution for me so far. What do you think, is there a better way? Here is busy blog post about putting CSS files in _layouts folder or a document library such as the Style Library: http://sharepoint.stackexchange.com/questions/2219/css-files-in-layouts-or-document-library/16253#16253


Featured Series of Posts on Branding Options in SharePoint 2010:

0. SP 2010 Branding Options: Master Pages vs. Themes: Overview
Why I prefer custom master pages over custom themes in SP 2010

1. SP 2010 Branding Options: Master Pages vs. Themes: Part 1
Attaching an alternate style sheet to the master page using the browser’s UI

2. SP 2010 Branding Options: Master Pages vs. Themes: Part 2
Attaching an alternate style sheet to the master page using SPD 2010

2.1 SP 2010 Branding Options: Master Pages vs. Themes: Part 2.1
How to edit the master page to add a custom logo and a favicon with SharePoint Designer 2010

3. SP 2010 Branding Options: Master Pages vs. Themes: Part 3
Adding a footer to your custom master page using SharePoint Designer 2010

4. History of SharePoint Branding: 2007 to 2010
A tribute to Heather Solomon’s legendary blog posts on MOSS 2007 themes and master pages

5. SharePoint 2010 CSS: List of Useful Styles

SharePoint 2010 Branding Options: Master Pages vs. Themes: Part 2

How to attach a custom style sheet by pasting code into the master page with SharePoint Designer 2010

This post assumes that you already have a custom style sheet, and that it is already in the Style Library – see Part 1. This post focuses on how to attach a custom, or alternate, cascading style sheet (CSS) to a master page by adding a line of code in SharePoint Designer 2010 (SPD 2010).

For those of you that just need the short answer, rather than the long answer below, this is the line of code to add in SPD 2010:

"<SharePoint:CssRegistration name="/Style Library/CoreOverride-Demo.css" After="corev4.css" runat="server" />"

Why would I ever want to attach CSS using SPD 2010 instead of the browser UI?

  • If you are customizing your master page anyway, i.e., layout changes, you may as well add the custom CSS in the code and save yourself the steps of adding it through the browser later, and you are also thereby ensuring that the custom style sheet and master page are always applied together.
  • If you have tried attaching the style sheet through the browser UI and you are seeing some evidence that your custom style sheet is being overridden by the main style sheet (corev4.css)… or you are just paranoid that this may happen to you 😉
  • If you have more than one custom style sheet and you need to specify which sheet comes ‘after’ the other

Here are the steps, the long answer, with screenshots to add the code to the master page via SPD 2010:

  1. Open the site (screenshot 1) in SharePoint Designer 2010 (screenshot 2)
  2. Expand the ‘Navigation’ panel in the left column, and click on Master Pages (screenshot 3)
  3. Click on v4.master to open the master page properties page (screenshot 4)
  4. Click ‘edit file’ to open file for editing, click ‘Yes’ when prompted to check-out file, and finally the master page is open (screenshot 5)
  5. Click ‘Code’ button on the bottom menu to show code view (screenshot 6)
  6. Paste the code between the <head></head> tags (screenshot 7)
  7. Save file (click ‘Yes’ when prompted about customizing the file) (screenshot eight)
  8. Right-click on master page file to Check-in the file (screenshot 9), Publish a Major Version (screenshot 10), then click ‘Yes’ when prompted to  approve the content (screenshot 11)
  9. Approve the content (screenshot 12)
  10. Refresh browser to confirm style changes (screenshot 13)
Note: If you now  decide that you need the original v4.master you can rename the customized version to something like custom.master. To fix this:
  1. Right-click on v4.master and select ‘Reset to site definition’ and the original v4.master will be restored, and SPD 2010 will automatically create a v4_copy(1).master page (screenshot 14).
  2. Rename v4_copy(1).master to something like custom.master
  3. Check-in custom.master, publish a major version, and approve the file
  4. Go to Site Actions > Site Settings > Master Pages and select the new master page, custom.master, for both Site Master Page and System Master Page, and select the checkbox for ‘Reset all subsites to inherit this alternative CSS URL’ (screenshot 15)
  5. Now if you have forgotten to activate the publishing feature for you new subsite with the Team Site template, it will not inherit the custom.master page yet, so go to Site Actions > Site Settings > Manage site features and activate the publishing feature (screenshot 16)
  6. As soon as the feature is activated you should see the new master page and its styles (screenshot 17)

Featured Series of Posts on Branding Options in SharePoint 2010:

0. SP 2010 Branding Options: Master Pages vs. Themes: Overview
Why I prefer custom master pages over custom themes in SP 2010

1. SP 2010 Branding Options: Master Pages vs. Themes: Part 1
Attaching an alternate style sheet to the master page using the browser’s UI

2. SP 2010 Branding Options: Master Pages vs. Themes: Part 2
Attaching an alternate style sheet to the master page using SPD 2010

2.1 SP 2010 Branding Options: Master Pages vs. Themes: Part 2.1
How to edit the master page to add a custom logo and a favicon with SharePoint Designer 2010

3. SP 2010 Branding Options: Master Pages vs. Themes: Part 3
Adding a footer to your custom master page using SharePoint Designer 2010

4. History of SharePoint Branding: 2007 to 2010
A tribute to Heather Solomon’s legendary blog posts on MOSS 2007 themes and master pages

5. SharePoint 2010 CSS: List of Useful Styles