Posts

Displaying PDFs from a Dropdown Menu

Image
  Browsing the MSDN SharePoint forums can really bring up some interesting ideas. Recently there was a question about how to display collections of PDF files in a web page. The question included a link to an article on embedding PDFs in SharePoint 2007 by Sharon Richardson. Sharon’s approach used an tag. The tag’s SRC attribute is not updateable by JavaScript and I did not want a hard coded PDF file. I got to playing around with this and worked up a solution that uses an  and borrows some JavaScript from an article I wrote a while back. The JavaScript was used to convert a Links List into an HTML dropdown list. Here I will use it to convert a library into a dropdown list and a PDF viewer. Note: Displaying PDFs in SharePoint requires two things: Your users must have a PDF viewer installed that can display PDFs in a browser For SharePoint 2010 your server administrator much change “Browser File Handling” from Strict to Permissive for your web application (see her...

Open SharePoint 2010 modal dialog and refresh the parent page from custom form

Objective: 1) Open a SharePoint 2010 popup and refresh the parent page when one closes it. 2) Build a custom form that at “submit event” closes the popup and refreshes the parent page. Solution : -            Open a Popup using “Javascript” and “ SP.UI.$create_DialogOptions();” -            Add the method “CloseCallback” using the “dialogReturnValueCallback” property -            Add some JavaScript code inside the CloseCallback to reload the parent page, like the following example: < a   href ="javascript:openModalDialog('form.aspx');"> Open My Custom Form a > < SharePoint : ScriptLink   ID ="ScriptLink1"   Name ="sp.js"   runat ="server"   OnDemand ="true"   Localizable ="false"   /> < script   type ="text/ecmascript">      var...

SharePoint: Group By on more than 2 columns in a view (SP 2010)

Image
An expanded version of this article, along with many other customization examples and how-tos can be found in my book,  SharePoint 2007 and 2010 Customization for the Site Owner . This is an update of an  article written for SharePoint 2007 . Many of the steps are the same in both 2007 and 2010, but both the SharePoint Designer steps and the default web part used for views have changed. Group By on more than 2 columns in a view In my SharePoint classes I have often been of asked how to group on more than two levels in a view. I have always given the quick answer of "use SharePoint Designer"!  But, some of you have asked "How?". You may be sorry you asked… but here goes…  Goals:  Create a view with nested groups deeper than just 2 levels Put the counts and totals at the bottom of each section. Do the above with no custom web parts, custom XSLT or anything that has to be deployed to the server. Sample:       Secrets and Tricks needed:...

SharePoint: Hide a web part for selected users

Image
"Out of the box" there are no "deny permission" features in SharePoint, only grant permissions. If you have a group called Sales with 1000 users, and you would like to use the SharePoint Audience feature to display a web part for everyone in Sales except for Sam, Susan and Bob, you will have to create a new group with 997 users named "Sales except for Sam, Susan and Bob" (and then maintain two groups going forward. But there is a way… Here's a trick that starts by using a Content Editor Web Part to hide another web part from everyone. By creating a group with our three problem people and using that as an Audience for this CEWP we can selectively hide another web part.  Before we start, Audiences are not available in WSS 3.0 (2007) or SharePoint 2010 Foundation. For this trick you need to do four things: Create the group or audience of people to hide things from Discover the ID of the web part you want to hide (see here for  2007  and  2010 ...

Windows Authentication Web Application Into FBA

The is a lot of dereference between windows Authentication and FBA Authentication .If you have done the project in classic Authentication and want to convert it into Claims in the middle of the project then you open the SharePoint 2010 powershell command as administratior and run the below command $ConvertApp=get-spwebapplication "URl" $ConvertApp.useclaimsauthentication="True" $ConvertApp.Update()

PROGRAMMING WITH EXTERNAL LISTS IN SHAREPOINT ONLINE

Image
SANDBOXED SOLUTIONS Especially using the sanboxed object model to program against  external lists in SPO  sounds promising. Just imagine, event receivers and workflow actions that can access external systems through an external list. I was really excited! But the disillusionment followed soon. It seems you can’t connect external systems in SPO via BCS from within sandboxed solutions!  If I try to programmatically access an external list within a sandboxed web part, I get an “The shim execution failed unexpectedly - Access is denied….” exception.  ? 1 2 3 4 5 6 7 8 SPList externalList = SPContext.Current.Web.Lists[ "Customers" ]; foreach (SPListItem externalItem in externalList.Items) {    writer.Write(externalList.Item[ "CustomerID" ] + ", " );    writer.Write(externalItem[ "CompanyName" ] + " "); } The sandbox stripes out the user’s security token and this means that the credentia...