2/20/2012

SharePoint: Group by Year or Month in a View

 

The following is for SharePoint 2007, SharePoint 2010 and SharePoint Online.

 

Grouping by Year

Grouping by year is pretty straight forward, just add a calculated column to your list to display the year and then group on that column in a view.

Steps:

  1. Add a new column to your list or library
    1. 2007: Click Settings and then Create Column
      2010: In the ribbon click the List or Library tab and click Create Column
    2. Select “Calculated column (calculation based on other columns)”
        image
    3. Enter this formula: 
        =YEAR([yourdatecolumn])      example: =YEAR([Due Date])
        image
    4. Create or edit a view and in the Group By section select your new calculated column
        image
    5. Set the return type to text:
        image
    6. Save the view and test

        image

 

Two Problems!

What’s with the 1899 year and why the commas? The commas are because SharePoint, in spite of our selecting “Single line of text”, still thinks the digits are a number. The 1899 year is from items with no date entered.

Fixing the commas…

Easy, just force the result to be text by prefixing the year with an empty string:   “”
=  “”  &  YEAR([Due Date])

    image

Fixing the 1899 / no date problem…

Just add an ”IF” to the formula to test for the date.

    =IF(  [Due Date]="" ,  "No Due Date",  ""&YEAR([Due Date])  )

    image

The result:

image

 

If you want the “No Due Date” listed first, then just add a space before “No”:

  image

 

  image

 

Grouping by Month

The Group By option in a view groups on the entire field. There is no way to group on a part of a field, such as just the month and the year of a date. We can get there by creating a calculated column or two and then grouping on the calculated columns.

We can pull the Month using a formula similar to the one above by using MONTH(). You will need both the year and the month and as SharePoint will sort from left to right you will need to build a string that looks something like “2012/02”, “2012 02” or “2012 / 02”.

When we combine this with the “empty date IF” from above you will get something like this:

  =IF([Due Date]="","No due date",YEAR([Due Date])&"/"&RIGHT("0"&MONTH([Due Date]),2))

 

The final view:

    image

 

Both Year and Month?

If you wanted to group on Year and then on Month you can:

  1. Create both columns described above
    Month:  =IF(  [Due Date]="", "No due date", YEAR([Due Date])&"/"&RIGHT("0"&MONTH([Due Date]),2))
    Year:     =IF(  [Due Date]="", "No Due Date", ""&YEAR([Due Date])  )
  2. Create a view and first group on Year and then group on Month

The result:

    image

 

Year, Month and Day?

Sorry, but SharePoint views only support two levels of grouping. If you really need to do this then you can use SharePoint Designer to create a Data View Web Part to group to any number of levels. See here: http://techtrainingnotes.blogspot.com/2011/01/sharepoint-group-by-on-more-than-2.html

 

 

Group Headings

If you want to get rid of the group heading then see this article:

http://techtrainingnotes.blogspot.com/2009/06/sharepoint-removing-group-headings-from.html

That article is for SharePoint 2007. There are both 2007 and 2010 versions available in my book.

     image

.

SharePoint Customization for the Site Owner – The Class!

 

This Wednesday I will be offering a class and hands-on lab based on my book,  SharePoint 2007 and 2010 Customization for the Site Owner, at MAX Technical Training.

In the morning we will see how these customizations are done, what you can and cannot do, and do a few hands-on walk troughs. In the afternoon you can use our lab computers, or if you have remote access to your SharePoint site you can use your own site, to follow step by step labs to apply what you have learned. You may also use the lab time to apply anything in the book to your site while I’m there to help.

The class and the book apply to SharePoint 2007, SharePoint 2010 and SharePoint Online / Office 365. The lab computers will include access to all three versions!

 

And of course, you will get a free copy of the book!

 

Click here to sign up: http://www.maxtrain.com/Classes/ClassInfo.aspx?Id=33292

 

MS-SPFP SharePoint Customization for the Site Owner - Enhancing the User Interface and Productivity

A one day, hands on, quick way to enhance your SharePoint sites presented by MAX's own Microsoft SharePoint MVP. You can choose to do your customizations (labs) in SharePoint 2007, SharePoint 2010 or SharePoint Online / Office 365. The morning will get you the tips and background info you need while the afternoon will be all hands on labs!

As part of this class you will also receive a copy of Mike's book, SharePoint 2007 and 2010 Customization for the Site Owner. While we can only explore a handful of these customizations in a day, there are over 75 customizations in the book to further enhance your sites.

 

.

2/18/2012

PowerShell Saturday! -- Interested in a PowerShell user group in Cincinnati?

 

PowerShell Saturday in Columbus

The first ever PowerShell Saturday will be held in Columbus, OH on March 10th. If you have not already registered, then it’s too late! It’s a sell out! But you might want to check the link below to see if they open up any more tickets.

    Tickets: http://www.eventbrite.com/event/2860436643/eorg

    I got my ticket!

 

PowerShell in Cincinnati?

So… would you be interested in either a Cincinnati area PowerShell user group and / or a Cincinnati PowerShell Saturday? Post a response below and let me know. (All posts are moderated, so if you don’t want your post public, just say so.)

 

Mike

 

.

2/13/2012

SharePoint: Finding the Site GUID

 

Had a nice quite evening planned, and then someone sends me in search of a wild goose... 

Because of a security issue they could not use my little GUID getter tool on their site and they were looking for some other way of getting a site GUID.

The wild goose hunt paid off as I found two…

For those who have bought my book, you may want add a note on page 307 to see this article.

 

1) Wiki home page:
Works for SP 2010 only: Display a Team Site home page (a wiki home page, home.aspx) that has at least one list web part, view the source of the page (right-view source) and search for "RelatedWebId"  (you could temporarily add an Announcements or library web part to the page)

    WebPartWPQ2_RelatedWebId="{f70832a4-5d0d-4265-a344-ea10a0007160}"

2) Tree View:
Works for both SP 2007 and SP 2010: Go to Site Actions, Site Settings, Tree View and enable Tree View. Then go to any page, view source and search for "ListNode:"

   spNavigateHierarchy(this,'','30:ListNode:f70832a4-5d0d-4265-a344-ea10a0007160:740...

 

Here's one for the PowerShell users that requires admin access to the servers:


Open "SharePoint 2010 Management Shell"  (PowerShell for SharePoint)
Enter:
  $site = Get-SPSite  http://yourserver/sites/yoursitename
  $web = $site.AllWebs["yoursubsitename"]     or  $site.RootWeb   for the root site
  $web.ID
    Guid
    ----
    f70832a4-5d0d-4265-a344-ea10a0007160

 

I guess the wild goose chase at least got me another blog article.  :-)

 

.

2/09/2012

SharePoint Error: This item is no longer available. It may have been deleted by another user

 

Error: “This item is no longer available.  It may have been deleted by another user.  Click 'OK' to refresh the page.”

image

 

A Missing Permission

This error is caused by either out of date pages that need to be refreshed, as you would expect from the message, or from a missing permission. If the user does not have the “View Application pages” then they cannot get to “forms, views and application pages”. Although not listed in the permission page, they also are not allowed to see dropdown menus from list items displayed in a web part.  I.e. they can see the web part, they can see the list item or document, but they can’t display that item through a form, view or dropdown. In a library they can click the document and open it.

   image

 

The “View Application pages” Permission

You might uncheck this permission when you want users to visit a home page of a site, but not navigate directly to lists and libraries. To give these users access to content you would add web parts to the home page for these lists.

 

The “View Application pages” Permission and the Access Denied error

Important! When disabling this permission you should create your list web parts to only display data. Do not display links to the item’s forms. If they click a link they will get this error:

    image

 

When Creating a Web Part View

For list web parts:

When creating list web part views for users without the “View Application Pages” permission always select one of the options without a link.

    image

 

For library web parts:

When creating library web part views for users without the “View Application Pages” permission always select one of the options with a “linked to document”.

image

The document will then open, be opened in an Office Web App or be downloaded. The user will not be able to get to a form (or get the error messages).

 

.

SharePoint: How to add JavaScript to a Content Editor Web Part

 

The following may be a bit redundant as it has been part of many of my “JavaScript hacks” posts, but I’m asked so often I thought I would put it in a article by itself.

 

The Content Editor Web Part (CEWP)

SharePoint 2007 gave us a nice little web part to insert HTML, CSS, JavaScript, and even just some text, in any web part page. SharePoint 2010 “broke” this web part a bit by trying to “fix up” our code. Add a little JavaScript to a CEWP and you will get this message:

    clip_image002

The message may mean that it did nothing to your code, reformatted your code (in strange ways), or completely removed your code!

Here’s a before and after of a “reformat”: 

clip_image002  clip_image002[4]

 

Link to your custom code, don’t add it directly to the CEWP

For both 2007 and 2010 the best practice is to link from the CEWP to a text file with your content. To avoid the problem with the random edits made by 2010 just upload a text file containing the code to a library. Then in the CEWP just click the Edit Web Part option in the dropdown and add the link to the code file. This has added benefit of using any HTML, CSS and JavaScript editor such as Visual Studio or SharePoint Designer to edit your code.

 

Steps:

  1. Create your HTML, CSS and/or JavaScript in a text file, Notepad will do, and save it with any file extension.
    Tip: Name your file with a .HTM extension and then the SharePoint libraries will add a “Edit in SharePoint Designer” link in the file’s dropdown menu!
        image

    Notes: Your JavaScript should be enclosed in <script> tags and your CSS should be enclosed in <style> tags.

     
  2. After uploading to a library, right-click the file’s name and copy the shortcut
        image
  3. Go go your SharePoint and insert a Content Editor Web Part
    (2010 on the left, 2007 on the right)
        image clip_image002[9]
     
  4. Click the web part’s dropdown menu and click Edit
        image
     
  5. Paste the URL to the Notepad file in the Content Link box
         image
     
  6. Save your changes and test

    And if you have any errors, just open the HTM file in SharePoint Designer, make your changes and save, and then go back to the browser and click refresh!  Much faster than constantly editing and save the web part.

 

Hide the title area

If the CEWP only contains HTML, CSS and/or JavaScript then you may want to hide the web part’s title bar. In the properties editor, expand Appearance, click the Chrome Type dropdown and select None.

    clip_image002[5]

Tip: Don’t “hide” the web part. Just turn off its title bar.

 

.

2/01/2012

What do you call that? How do you capitalize this? The Microsoft Manual of Style

 

How do you…

If you write in the world of technology, whether blogs, books, training manuals, or even PowerPoint slides for your local user group, then you are often asking things like:

  • Is it “sub-folder” or “subfolder”?
  • What is that thing at the bottom of the screen called?
  • Is it an “Application Menu” or an “App Menu”?
  • Is it a “Status Bar” or a “status bar”

In the old days we would often refer to the Chicago Manual of Style for general writing guidelines, and over the years for Microsoft related writing, the Microsoft Manual of Style. The problem with the Microsoft manual is that is was getting quite dated, it was last updated in 2004, and in technology, that’s the dark ages!

The Microsoft Manual of Style as finally been updated, and what an update! I’ve only browsed though it picking up things here and there, and I’ve got to put it down and get back to work! They have included everything I need and even added coverage for Windows Phone. 437 pages of good stuff.

It’s not 100% complete as it does not have a product by product focus. SharePoint is not in the index! But, the book has to be light enough to carry, and there are other resources for products like SharePoint. (SharePoint glossary: http://msdn.microsoft.com/en-us/library/ie/ee556558.aspx)

 

There’s no excuse not to get it!

The paper back version is only $16.35 at Amazon and the Kindle version is only $9.95. You should get both… I’ve already dog-eared my paper copy and filled it with “stickies”, and I want the Kindle version to have with me everywhere I go. 

And, no you can’t borrow my copy!

(But I will bring it to the SharePoint User Group meeting Thursday night if you like to take a peek.)

 

 

Chapter 1: Microsoft style and voice

Chapter 2: Content for the web

Chapter 3: Content for a worldwide audience

Chapter 4: Accessible content

Chapter 5: The user interface

Chapter 6: Procedures and technical content

Chapter 7: Practical issues of style

Chapter 8: Grammar

Chapter 9: Punctuation

Chapter 10: Index and keywords

Chapter 11: Acronyms and other abbreviations

 

(and yes, they did their chapter titles with lower case words! I’ll have to look that one up too…)

 

.

1/30/2012

Cincinnati SharePoint User Group Lightning Round this Thursday Evening!

 

Below is my post from last week about the “Lightning Rounds” presentations for this Thursday’s Cincinnati SharePoint User Group meeting.  (and yes… I did mistype it as “Lighting Rounds”… oh well…)

So far we have presentations lined up for these topics: (exact titles TBD)

  • Do you need a File Upload Web Part to allow uploading of files without giving access to the Document Library?
  • Tricks for personalizing content to users
  • Enable consistent deployment from the development environment to the production environment using PowerShell to create easily maintained code that SharePoint admins can trust
  • SharePoint & SQL Reporting Services
  • How to Give Back to the SharePoint Community with a Blog and the MSDN Forums

We still have room for one or two more presentations!  Send us a one paragraph topic proposal and your estimate of presentation length. Send it to point2share@gmail.com or just post a reply to this article with your email address and I’ll get back to you. Don’t worry about your email address as I will keep your reply unpublished and private.

 

Mike

 

 

 

=========================================================

 

The Cincinnati SharePoint User Group meets the first Thursday of every month at 6:00 PM at MAX Technical Training in Mason, Ohio (directions). The next meeting is 2/2/2012.

 

Lighting Round!

February  is our "Lighting Round" meeting where everyone is welcome to submit a proposal to speak for anywhere from 5 to 15 minutes. These have been a lot of fun in the past and no matter your interest in SharePoint, there will be something interesting!  (Think “SharePoint Saturday in 90 minutes”)

If you have never spoken at a SharePoint user group meeting before, this is just about the easiest way to get started. Pick your favorite aspect of SharePoint, or the latest cool SharePoint related thing you have done, and tell us about it. You don't even need slides, and if you do create slides, you probably won't need more than five or so. Keep it short, keep it interesting and have fun! (And when you are done, you can put "User group speaker" on your resume and be well on your way to SharePoint Saturday fame!)

We are looking for topics like these:

  • administrator
  • developer
  • best practices
  • worst practices / war stories / don’t try this at home
  • end user
  • site owner
  • customization tricks
  • SharePoint Online / Office 365
  • SharePoint for small groups and / or non-profits
  • or anything interesting about SharePoint!

But… no sales pitches!

 

To get the ball rolling I will start us out with this little presentation...

How to Give Back to the SharePoint Community with a Blog and the MSDN Forums
In 10 minutes we will create a blog site, do a little customization, setup an automatic Twitter feed and configure Google Analytics so you will know if anyone is reading your blog.
In the next 5 minutes we will setup an MSDN Forums account and start answering questions!

 

Now it’s your turn!

 

Send us a one paragraph topic proposal and your estimate of presentation length. If you don’t know how to reach me or someone in the user group then just post a reply to this article with your email address and I’ll get back to you. Don’t worry about your email address as I will keep your reply unpublished and private.

 

Mike

 

p.s. If there’s anyone reading this from “vendor land” and you would like to make a door prize donation to the Cincinnati SharePoint User Group, or even sponsor a meeting, please contact me.

 

.

A New SharePoint Designer 2010 Class

 

SharePoint Designer 2010 Class

This week I will deliver a new SharePoint Designer 2010 class at MAX Technical Training. We reviewed all of the existing classes we could find, and none met our requirements. The problem with most SharePoint Designer classes is that they focus on SharePoint Designer the program rather than what you can do with SharePoint Designer to customize your SharePoint sites. This class focuses on getting things done!

The first offering for this class is this Thursday, 2/2/2012 and covers both SharePoint 2010 and SharePoint Online / Office 365.

Not sure if this class is for you? Email me at image with any questions.

Here’s a partial list of the modules:

  • How SharePoint uses HTML, CSS and JavaScript
  • How SharePoint Uses ASP.NET and SharePoint Controls and how you can tweak them
  • Creating and Customizing Pages
  • Customizing SharePoint Navigation
  • Working with SharePoint Master Pages
  • The Data View Web Part – Creating Custom Views
  • The Data View Web Part – Working with XSLT
  • The Data View Web Part – Accessing External Data
  • JavaScript and CSS Tricks!

Except for the last bullet, this list does not hint at all of the tricks and tips I’ve included from playing working with SharePoint all of these years.

Here’s a few of those tips:

  • Convert Quick Launch to a pop out menu to save space
  • How remove the Quick Launch area from a page, or put it back in those pages where Microsoft hid it
  • Customize the page’s title area to display a banner, and as a bonus, get the 2007 style full crumb trail back
  • Create custom data entry forms for lists
  • Create a custom RSS web part to display RSS feeds from other SharePoint sites
  • Show or hide content and customizations based on permissions
  • Make the Tree View useful – show only libraries, or only show subsites etc
  • and more…

 

Register Now!

So, if you’d like to learn how to take the next level of control of your SharePoint site, click http://www.maxtrain.com/Classes/ClassInfo.aspx?Id=32766 and pop over to the MAX web site and sign up for this class.

Tell them Mike sent you and I’ll get you a free copy of my book or a SharePoint Designer book like this one.

 

MA-1083 - Sharepoint Designer 2010 - Customizing and Branding SharePoint

February 2, 2012 as MAX Technical Training

 

.

1/29/2012

SharePoint 2010: Cannot find ContentPlaceHolder 'PlaceHolderLeftActions' in the master page '~masterurl/default.master' #sharepoint #sp2010

 

A simple error caused by a minimal problem   ;-)

image

 

The odds are you or someone on your team was playing with master pages and set the minimal.master as the default master page. As the minimal master is not a complete master page, some of the place holders needed by many pages are missing.

 

SharePoint Designer

To fix, just go to SharePoint Designer and reapply the v4.master (or which ever master you normally use.)

    image

 

Site Actions, Site Settings

The Settings page has a fall back master page (Simplev4.master) to use whenever there is an error loading a master page. So if you don’t have SharePoint Designer available, and you are using a site based on a publishing template, then you can just navigate to the Site Settings page and pick a master page there.

http://yourserver/sites/yoursitecollection/_Layouts/settings.aspx

or just go directly to:

http://yourserver/sites/yoursitecollection/_Layouts/ChangeSiteMasterPage.aspx

Note, this only works with sites with the publishing features enabled.

.

1/22/2012

Cincinnati SharePoint User Group Lightning Round in February!

 

The Cincinnati SharePoint User Group meets the first Thursday of every month at 6:00 PM at MAX Technical Training in Mason, Ohio (directions). The next meeting is 2/2/2012.

 

Lighting Round!

February  is our "Lighting Round" meeting where everyone is welcome to submit a proposal to speak for anywhere from 5 to 15 minutes. These have been a lot of fun in the past and no matter your interest in SharePoint, there will be something interesting!  (Think “SharePoint Saturday in 90 minutes”)

If you have never spoken at a SharePoint user group meeting before, this is just about the easiest way to get started. Pick your favorite aspect of SharePoint, or the latest cool SharePoint related thing you have done, and tell us about it. You don't even need slides, and if you do create slides, you probably won't need more than five or so. Keep it short, keep it interesting and have fun! (And when you are done, you can put "User group speaker" on your resume and be well on your way to SharePoint Saturday fame!)

We are looking for topics like these:

  • administrator
  • developer
  • best practices
  • worst practices / war stories / don’t try this at home
  • end user
  • site owner
  • customization tricks
  • SharePoint Online / Office 365
  • SharePoint for small groups and / or non-profits
  • or anything interesting about SharePoint!

But… no sales pitches!

 

To get the ball rolling I will start us out with this little presentation...

How to Give Back to the SharePoint Community with a Blog and the MSDN Forums
In 10 minutes we will create a blog site, do a little customization, setup an automatic Twitter feed and configure Google Analytics so you will know if anyone is reading your blog.
In the next 5 minutes we will setup an MSDN Forums account and start answering questions!

 

Now it’s your turn!

 

Send us a one paragraph topic proposal and your estimate of presentation length. If you don’t know how to reach me or someone in the user group then just post a reply to this article with your email address and I’ll get back to you. Don’t worry about your email address as I will keep your reply unpublished and private.

 

Mike

 

p.s. If there’s anyone reading this from “vendor land” and you would like to make a door prize donation to the Cincinnati SharePoint User Group, or even sponsor a meeting, please contact me.

 

.

1/19/2012

What Time is it in SharePoint Land? (I missed your meeting because of the time listed in the calendar!)

 

Luis is SharePoint user working on a SharePoint installation installed in the corporate headquarters in Los Angles. The server there is setup on Pacific Time (UTC-08:00). Sam is a team member based in the Atlanta office who has changed his Regional Settings to Eastern Time (UTC-05:00).

Sam schedules a Team Meeting for 10:00 AM.

image

Luis checks the team calendar as sees:

image

Luis is in Chicago, knows that Sam is in Atlanta and is wondering why Sam scheduled a meeting for 7:00 AM! Which… is 6:00 AM in Chicago!

 

So What Time is it in SharePoint Land?

Sam did schedule the meeting for 10:00 AM, his time, which is 9:00 AM in Chicago. The problem here is that Luis has never set his Regional Settings and is seeing the server’s default time, which is Pacific.

 

How do we fix this?

If most of the site’s users are in the Chicago area, then we could change the site’s regional settings to Central time. This won’t bother Sam as he has set his preference for time zone in his regional settings. This solves the problem for Luis and other members of the team in the Central time zone. But… it may confuse users back in the home office where they are in Pacific time.

 

What to do?

A) Tell everyone that all times will be in headquarter’s time (Pacific)
  or

B) Train everyone on how to set their time zone preference
  or

C) Create some automation (PowerShell) to update everyone’s time zone based on the region they work in

 

How to change the time zone for the server

Central Administration –> Application Management –> select your application –> in the Ribbon click General Settings, and General Settings and then change the time zone.

How to change the time zone for a single site

Site Actions –> Site Settings –> Regional Settings –> Time Zone

How to change the time zone for a single user

Ask the user to visit any site, click their name at the top right of the page (the Welcome menu) –> click My Settings –> Click My Regional Settings –> uncheckmark Always follow web settings –> Time Zone

 

Note that user settings will override site and application settings and that site settings will override application settings.

 

.

1/17/2012

SharePoint Cincy 2012 Early Bird Discounted Registration Now Available

 

 

Need I say more!

Go here http://www.sharepointcincy.com/ and click Register Now before 2/29/12.

 

image

 

.

Adding JavaScript to a SharePoint 2010 Wiki, and other Wiki Tips and Tricks

 

The SharePoint 2010 Wiki has a few interesting changes… some I personally think are oversights, some are SharePoint trying to keep you “out of trouble”.

Some of things I will look at here:

  • Why can’t I see a list of all of the Wiki pages?
  • The Rename Page button in the Ribbon is grayed out!
  • How can I insert JavaScript and other content not supported by the Ribbon? 

 

Why can’t I see a list of all of the Wiki pages?

Well… you can, if you know where to look! To see all of the pages you must:

  • Display any Wiki page (“Home” for example)
  • Click the Page tab in the Ribbon
  • Click View All Pages

              image

You could also just navigate directly to the AllPages page:

http://yourserver/sites/Training/YourWiki/Forms/AllPages.aspx

As neither of the above is going to be intuitive to your Wiki users you may just want to add a hyperlink to the home page of your Wiki called Index or Table of Contents.

image

 

 

 

The Rename Page button in the Ribbon is grayed out!

You have to be in the Edit mode before you can rename a page.

  • Display the Wiki page
  • Click the Page tab in the Ribbon
  • Click Edit
  • then click Rename Page

Warning: Exiting Wiki links to this page will get updated. For example, my original link was “Other Resources”. When I renamed the page to “SharePoint Blogs” the other pages where updated from [[Other Resources]] to [[SharePoint Blogs|Other Resources]].

 

 

Adding JavaScript to a Wiki Page

Let’s say you wanted to add a hyperlink to you wiki that links to an external page, and your corporate policy says that you must warn users that by clicking the link they are leaving the safety of your site. Just about every way of adding JavaScript to a Wiki page gets intercepted by SharePoint and the “offending code” is striped out.

     image

I even got creative and tried:

  • Editing the page in the browser and using the HTML button in the Ribbon
  • Editing the page in SharePoint Designer
  • Opening the page source from SharePoint Designer using Notepad, and then saving directly to the Wiki library

In all of these, SharePoint stripped out <script> blocks and converted hyperlinks with JavaScript to useless tags. For example:

   <a href="JavaScript:alert ('hello')"> say hello</a>

got converted to:

   <a>say hello</a>

 

The solution, like so many JavaScript tricks, uses the Content Editor Web Part.

In the example below I have a Wiki page for SharePoint blogs. For each blog I want to have a link to Bing to search for articles from each blog. These links must also display a warning about leaving the site.

The hyperlink looks like this:

Go search <a href="javascript: if ( confirm('This web site is external to the company and may not be safe!') ) { document.location='http://www.bing.com/search?q=site:techtrainingnotes.blogspot.com'; }">Bing</a> for more on this blog!

 

Steps:

  1. Edit the Wiki Page (display the page, click the Page tab in the ribbon and then click Edit)
     
  2. Click where you need the link, and then from the Insert tab in the ribbon click Web Part
     
  3. Click the edit dropdown on the web part and click Edit Web Part
     
  4. Click in the Content Editor’s text area and then click the HTML button in the ribbon
     
  5. Add your JavaScript, save and test

The Content Editors:

image

 

The resulting page after the user clicked the hyperlink:

image

 

.

1/13/2012

SharePoint: Hide List and Library Column Headings

 

I have updated the “Hide List and Library Column Headings” article to add notes for SharePoint 2010 and Office 365!

Go here for the details: http://techtrainingnotes.blogspot.com/2009/06/sharepoint-hide-list-and-library-column.html

 

Before (2007):

image

After (2007):

image

 

Before (2010):

image_thumb[3]

After (2010):

image_thumb[1]

Note: after this customization the checkbox column disappears, at least until you mouse over a document. Bug? I think it’s a bonus!

 

 

.

1/07/2012

SharePoint: Move the “Add New” Link to the Top of the Web Part

 

When you display a long list in a web part you will find that the “Add new” link is often out of sight at the bottom of the page. Your users will have to scroll to the find the link. This article takes a look at some JavaScript to change the order things are displayed in a web part.

 

The before and after:

image

 

Note: This has been tested on only one SharePoint 2010 installation, so use at your own risk and test, test and test.

 

Steps to make this change on only one page:

  1. Open Notepad and paste in the JavaScript from below
     
  2. Save the Notepad file with a name like "MoveAddNewItem.html"
     
  3. Upload this Notepad file to a library such as "Site Assets", "Site Files" or other library
     
  4. Go to that library, right-click this file and copy the Shortcut (the URL to the file)
     image
     
  5. Add a Content Editor Web Part below the last web part on the page, edit this web part, and paste the URL you just copied into the Content Link box.
    image
     
  6. Save your changes and test the result

 

Steps to make this change for all pages:

  1. Using SharePoint Designer, edit your master page
  2. Add the JavaScript below just before the </BODY> tag

 

The JavaScript

Notes:

  • The Try Catch is to deal with the picture library and the calendar, which do not add the “add new” links
  • If you are modifying the code, you will want to remove the Try Catch during your testing
  • The test for "ms-bottompaging" is for long lists that are displaying a previous / next links
  • The line that starts with “theTable = x” is one long line  ( theTable = x[i]…… )
<script>
// CEWP trick from techtrainingnotes.blogspot.com! 
// techtrainingnotes.blogspot.com/2012/01/sharepoint-move-add-new-link-to-top-of.html
// Find all tables
var x = document.getElementsByTagName("TABLE"); 
var ListList = "";

for (var i=x.length-1; i>0; i-- ) 
{
  // find just the tables that are list web parts (have a "summary" element)
  if (x[i].summary)
  {
    try {
      // Now find the "add new" rows
      var theTable = x[i].parentNode.parentNode.parentNode.parentNode.nextSibling;
      // but if the table is the paging table (next / previous) then get the next table
      if (theTable.innerHTML.indexOf("ms-bottompaging") > 0)
      {
        theTable = x[i].parentNode.parentNode.parentNode.parentNode.nextSibling.nextSibling.nextSibling;
      }

      // hide the unneeded horizontal line
      theTable.rows[0].style.display="none";
      // hide the extra blank space
      theTable.rows[2].style.display="none";

      // move the table    
      var theContainer = x[i].parentNode.parentNode.parentNode.parentNode.parentNode;
      theContainer.parentNode.insertBefore(theTable,theContainer);
    }
    catch (err123) {}
  } 
}

</script>

 

.

My Blog’s Year in Review…

 

I’ve seen that a number of bloggers have posted a “year in review” article, and someone asked where mine was, so…

 

2011?

 

79 blog posts

Spoke at 7 events including user groups, SharePoint Saturdays and SharePoint Cincy

Volunteered at TechEd in Atlanta

Wrote a book!

Wrote a magazine article

Taught way too many classes (my day job!)

Updated two courses we have in the Microsoft Courseware Library (CWL)

Got about 3000 points answering questions in the MSDN forums (but I still don’t know what a point is)

Even got in about 100 flights on my R/C airplanes!

 

2012?

 

The blog? I have a lot of started, but never finished blog articles left over from last year, so I’ve got plenty of topics

Speaking? Already scheduled to speak at SharePoint Cincy 2012 and at the SharePoint Summit 2012 in Toronto, with a few more events pending

Going to the MVP Summit in Redmond!

Planning on TechEd again this year in Orlando (fingers crossed)

Books? Two outlined, and one in progress…

Magazine articles? In the works…

Classes? I’m sure I’ll be busy. It’s my day job you know.

New courses? A new SharePoint Designer 2010 class scheduled for completion by the end of the month and probably five or six others by the end of the year.

MSDN forums? I’m in there almost every day so I’m sure I’ll get more “points”.

Definitely a lot of R/C airplane and helicopter flying in the plans.

 

 

There… I did my mandatory year in review, and even did a 2012 forecast…

 

.

1/05/2012

Cincinnati SharePoint User Group Meeting Tonight!

 

Last minute reminder…

Meeting agenda

Date:         January 5, 2012, Thursday
Time:         6:00 – 8:00 pm.
Where:       Max Technical Training, 4900 Parkway Dr. #160 Mason, OH.  
                  Click on the link for directions  http://www.maxtrain.com/directions/
Schedule:
6:00 – 6:25 - Socials and Networking - No Registration required
6:25 – 6:30 - Introduction of Agenda and Speakers
6:30 – 8:00 - Presentation

Creating SharePoint Designer Workflow Solutions End-to-End
Mark Tiderman Jr of MTech Solutions

8:00 – Door prizes!

 

.

1/02/2012

SharePoint: Not all column types can be used in Calculated or Lookup columns (plus a trick to add back four of them!)

 

A recent question in the MSDN forums got me to looking again at the limitations on the use of certain column types in calculations or lookups. The list of column types that can be used in lookups is quite limited, but with a trick using a calculated column we can add four more to the list.

 

For my test I added all of the following columns to a custom list. These include the basic columns plus a few variations of options including each type of calculated column.

image

 

Types that work for a Calculated column

I then added a Calculated column. This is the list of fields offered for use in a calculation:

    image

Not included in this list were these columns:

    image

 

Types that work for Lookups

I then added a lookup column to another list to see which column types could be used for lookups. Here’s what shows up:

    image

The only column types available for lookups are:

    image

And when a lookup has been selected, here is the list of columns that can also be displayed from the lookup list:

    image

Or, just these types:

    image

So, these are excluded from lookups:

    image

 

A workaround for some missing lookup column types!

If you look back at the types that did show up in the list for lookup columns you will find:

    image

And if you go back to the list of types that can be used in calculated columns you will see that we can create calculated columns for some of the missing lookup types, as long as the calculation returns “Single line of text”!

With a calculation we now get to:

  Yes / No

  Choice (Drop-down or Radio Buttons, but not checkbox)

  External Data (and external data additional columns)

  Currency (but without the currency ($) symbol)

The calculation for Choice and External data is pretty straight forward:

   =[fieldname]

The currency type will just return the value, with commas and decimal points. You may want to add the currency symbol.

   =[fieldname]

or

   =”$” & [fieldname]

The Yes / No is a bit of a problem as the simple calculation just returns a 0 or 1. To get the words Yes and No you will need to do just a little more work:

  = if( [yesnofieldname], “Yes”, “No” )

Remember for all of these you will still need to set the "data type returned" to "Single line of text".

 

A few additional resources for what column types work where…

 

SharePoint Columns – Features and limitations

http://www.sharepointusecases.com/index.php/2011/07/sharepoint-columns-features-and-limitations/

 

Create list relationships by using unique and lookup columns

http://office.microsoft.com/en-us/sharepoint-server-help/create-list-relationships-by-using-unique-and-lookup-columns-HA101729901.aspx

 

Column types and options

http://office.microsoft.com/en-us/sharepoint-online-enterprise-help/column-types-and-options-HA010302193.aspx?CTT=1

 

SharePoint 2007 Supported Lookup Column Types

http://sharepoint.nauplius.net/2010/09/sharepoint-2007-supported-lookup-column.html

 

.

Note to spammers!

Spammers, don't waste your time... all posts are moderated. If your comment includes unrelated links, is advertising, or just pure spam, it will never be seen.