February 12, 2010

MOSS Access Denied when trying to view workbook using Excel Services

Filed under: Sharepoint — Tags: , — Tim Lefler @ 2:03 pm

When trying to open a sample workbook using SharePoint Excel Services I got a nasty error:

You do not have permissions to open this file on Excel Services.

Make sure that the file is in an Excel Services trusted location and that you have access to the file.

Access Denied Message

In my case I had an Excel workbook in a ReportLibrary on my site.  And yes I had added the library to the SSP Trusted File locations using Central Administration.  Took me a bit of tinkering to figure out what was going on….

The URL to my ReportLibrary that contained the Excel spreadsheet was:  “http://sharepoint/Reports/ReportLibrary/Forms/current.aspx”

So I used this as the Trusted File Location.  Turns out that SharePoint doesn’t want the “/Forms/current.aspx” part of the URL identifying the Windows SharePoint Services Location….. AND the other trick is that the “Windows SharePoint Services” location has to end with a “/“.  So the URL I needed to use for the Trusted File Location is:  “http://sharepoint/Reports/ReportLibrary/”

Windows SharePoint Service Location ends with a "/"

Hope this helps to keep others out there from pulling there hair out and cursing SharePoint!!

January 12, 2010

How to turn off the “MySite” and “MyLinks” in MOSS 2007

Filed under: Sharepoint — Tags: , , , — Tim Lefler @ 4:08 pm

So if you don’t want to implement MySites and its dependent MyLinks, how do you turn it off?

Below are the steps to remove the two links:

  1. Log into Central Administration.
  2. Click on the link for Shared Services Administration
    –If you have more than one SSP, select the one that is running the MySites functionality
  3. In the “User Profiles and My Sites” group, click on the “Personalization services permissions” link.
  4. Select the group you want to limit the functionality for.  More than likely you will just have NTAuthority\Authenticated Users.
  5. On the “Modify Permissions: Shared Service Rights” page
    –To disable MySites uncheck “Create Personal Site”
    –To disable MyLinks uncheck “Use Personal Features”

December 24, 2009

How to Customize a SharePoint Theme

Filed under: SharePoint Designer,Sharepoint — Tags: , , , , — Tim Lefler @ 10:27 am

Not much going on in the office today, so I figured I’d document a SharePoint theme customization technique. This example was taken from this excellent SharePoint blog post. I just wanted to make sure I had this captured so I wouldn’t loose it.

A SharePoint theme is a set of fonts, graphics, and colors that make up the appearance of the site. An approach to develop a new theme is to customize an existing theme. This allows you to start with a working theme and then make modifications, shortening the amount of time it takes to develop a new theme.

A SharePoint site to which a theme has been applied will have a _themes folder when viewed within SharePoint Designer. When the _themes folder is expanded the theme that has been applied will appear as a sub folder. When a theme is applied to the a SharePoint site a copy of all the files that make up the theme are copied into the content database in the _themes sub folder.

Note: This is an important point. Because a copy is made of the theme’s folder ohn the web server and placed in the content database, any changes you make to the CSS of theme files within SharePoint designer will not be used on anything except the site you are currently working with. You have to manually make the same changes in the theme’s folder on the web server if you want the theme modifications to be used when a new site is created.

In addition to all the files from the theme’s folder, the theme.css and the mossExtension.css files are merged to create a new file that is stored in the content database. The file is named XXXX1011-65001.css, where the XXXX represents the first four letters of the theme’s name.

The XXXX1011-65001.css style sheet is the only CSS file applied to the site by the theme. It is applied right after the CORE.css style sheet is applied by the default.master page. Any core styles redefined in the theme’s style sheet will override the styles defined in the CORE.css. This gives you the designer complete control over the CSS applied to the pages on your site.

So to customize a theme, the first step is to examine the themes that come with SharePoint and find one that closely matches the theme you want to create.   For this example, a new theme will be created called “My Theme” based on the Classic theme in SharePoint. In the new theme the Search area gradient will be changed to gray instead of yellow.


(more…)

Hide the Top Global Navigation Breadcrumb in MOSS

Filed under: SharePoint Designer — Tags: , , , , , , , — Tim Lefler @ 9:45 am

I hate the pesky top Global Navigation breadcrumb “home” Link.

There are a couple of techniques to get rid of this Global Navigation Breadcrumb.

Technique 1: Modify the Master Page

A technique to remove it is to make the changes to the Master Page using SharePoint Designer.

  1. Launch SharePoint Designer
  2. Click File->Open Site.  Enter your site.
  3. In the folder list pane, expand the _catalogs folder.  Then expand the masterpage folder.
  4. Open the “default.master” page.
  5. Locate the content placeholder for the breadcrumb…. look for the following lines in the HTML of the master page.
    1
    2
    3
    
    <asp:ContentPlaceHolder id="PlaceHolderGlobalNavigationSiteMap" runat="server">
              <asp:SiteMapPath SiteMapProvider="SPSiteMapProvider" id="GlobalNavigationSiteMap" RenderCurrentNodeAsLink="true" SkipLinkText="" NodeStyle-CssClass="ms-sitemapdirectional" runat="server"/>
    </asp:ContentPlaceHolder>
  6. Leave the Content placeholder in place but remove the navigation breadcrumb by replacing the lines above with the following:
    1
    
    <asp:ContentPlaceHolder id="PlaceHolderGlobalNavigationSiteMap" runat="server" />

Technique 2: Modify the Theme CSS

The second technique to remove it is to make the changes to the CSS for the Theme using SharePoint Designer. This removes it from the Site Navigation breadcrumb also so make sure this is what you want:

  1. Launch SharePoint Designer
  2. Click File->Open Site.  Enter your site.
  3. In the folder list pane, open the _themes folder.  Then expand the current theme folder.
  4. Open the .css file associated with the theme.  It will have the first four characters of the theme name followed by 1011-65001.css
  5. To hide the Top Navigation bread crumb add the following:
1
2
3
.ms-sitemapdirectional,.ms-sitemapdirectional a{
display:none;
}

December 2, 2009

How to setup SharePoint 2007 with SQL 2008 Reporting Services in Integrated Mode – Distributed 3 Server Deployment

Filed under: Sharepoint — Tags: , , , , , , , — Tim Lefler @ 8:15 pm

In this post I’m going to go through the steps I used to setup SQL Server 2008 Reporting Services in Integrated Mode with SharePoint 2007.  Most of the examples on the web walk through installation of Reporting Services in a standalone server deployment of SharePoint.  A single computer with Reporting Services, SharePoint, and SQL installed.

Standalone Server Deployment

Standalone Server Deployment

With all of the components installed on one machine, the typical example glosses over many of the challenges faced when integrating Reporting Services in a production environment.  See this article for more information on Deployment Topologies for Reporting Services in SharePoint Integrated Mode.  In our production environment we try to follow the best practices and want to make use of a three computer deployment.  A SharePoint web front end (WFE), a dedicated Reporting Services Machine, and a dedicated database server.

Three-Computer Deployment

Three-Computer Deployment

We also try to follow the principle of least privilege and have separate service accounts for the different components.  Another caveat for our environment is that we have Kerberos enabled, so I need to make sure Reporting Services supports Kerberos and is configured appropriately.  So my three computers are as follows:

Machine 1 Name: MOSSSQLSBX
Operating System: Windows 2003 Server x64
Server Role Dedicated Database Server
Deployed products: SQL Server 2008 (Database Engine, Full Text, Basic Management Tools, Management Tools Complete)
Topology: one instance (no named)

.

Machine 2 Name: MOSSRPTSBX (for SQL Server Reporting Services 2008 SharePoint Integrated Mode)
Operating System: Windows 2003 Server x64
Server Role: Reporting Services Server
Deployed products: SQL Server 2008 Reporting Services, MOSS 2007
Topology: SQL Server 2008 Reporting Services

.

Machine 3 Name: MOSSWEB01SBX
Operating System: Windows 2003 Server
Server Role: SharePoint WFE, Application Server
Deployed products: MOSS 2007
Topology: simple Farm

(more…)

September 24, 2009

SharePoint Lookup Field Restricted to “Single Line of Text” Items

Filed under: Sharepoint — Tags: , , , , , , , — Tim Lefler @ 5:28 pm

OMG (A little Blog texting I guess)  Is Microsoft serious!  As usual SharePoint seems to get you 80% of the way there and then leaves you hanging or leaves you deeply involved in the complex mysticism that is Visual Studio!  It seems to me that a commonly required technique would be to reference other fields from a different SharePoint list…. these fields might be date time, single line of text, multi-line, number, etc….  For me, in particular, I want to reference a Date and Time column from another list!

Unfortunately Look up fields in a SharePoint list will only reference fields that are of type “Single Line of Text”.

What crap is that?  Once again something that seems very basic and should be handled, forces us to break out Visual Studio and develop our own solution!!  I hope 2010 will bring some improvements!!

There has been publicized on the internet a bit of a hack around this problem, you trick Sharepoint into looking up to a different field type. You create the column as a single line of text, create a look-up to it then change the target field from a single line of text to the data type you require. This is unsupported by Microsoft and I think it is a best practice to treat the column you are adding as the data type represented.  We are a production shop and don’t want to use hacks because of fears of breaking stuff on next release!!  So I have not verified this will work.

Sigh…. no solution yet but will keep you posted if I find one.

Javascript routine to fix paging problem where List View WebPart clears the Query String

Filed under: Development — Tags: , , , , , , — Tim Lefler @ 2:02 pm

The problem:

When you have a List View WebPart on a SharePoint page that has paging enabled, when you click on the paging button to move forward or backward in the List view, the webpart clears any existing query string parameters when posting back to get the next page of information.  This is a big problem if the page relies on the query string to display dynamic information.

So, if I have a custom aspx page that displays dynamic information about an item with ID=5, I would have a URL like this:

http://machine.domain.com/sites/somesite/CustomPage.aspx?ID=5

When you click on the “Next Page” button on the List View Webpart it wants to clear the query string and navigate to something that looks similar to this:

http://machine.domain.com/sites/somesite/CustomPage.aspx?Paged=TRUE&p_ID=38&View={5E53C811-1C34-4F1D-B1CB-E83E92712CEF}&FolderCTID=0×012001&PageFirstRow=9

Notice that my CustomPage.aspx  “ID=5″ parameter is missing!!

A Technique to Fix the Problem:

Rather than code a custom webpart the following javascript can be placed in the source of a Content Editing Web Part directly below the List View Webpart.  When it executes it will re-write all the URLs to include the original query string.
(more…)

How to Programatically Assign a Value to a SharePoint List’s Date and Time Field

Filed under: Development — Tags: , , , , , , , , , , — Tim Lefler @ 12:59 pm

To set a Date and Time field for SharePoint list items in your code you have to guarantee that dates are in invariant format or you will have problems. It is possible to assign value of DateTime type to this field or a string.

Invariant format is: MM/dd/yyyy HH:mm:ss

If you want to assign the date as a string to SharePoint’s DateTime type field then you must format this string as an invariant date. The following code snippet sets a workflow item’s Date and Time column to the current time.

Imports System.Globalization
 
workflowproperties.Item["TheDate"] = DateTime.Now.ToString(DateTimeFormatInfo.InvariantInfo)
workflowproperties.Item.SystemUpdate()

If you make sure dates are always in invariant format then assigning values to DateTime fields is easy.

September 18, 2009

Porting Content Databases between SharePoint Farms and how to deal with those tricky STS#? Options

Filed under: Sharepoint — Tags: , , , , , , , , , , , — Tim Lefler @ 8:05 pm

Recently I was trying to port a content database to a new farm and wanted to create a site on the farm that pointed to a restored SQL database on my SQL Server.

So my steps were as follows:

  1. Backup original SQL Content DB using SQL Management Tool
  2. Copy the Content DB backup up file to the other SQL DB Server
  3. Use SQL management tool on the new server to restore to a database that didn’t exist
  4. Run the following “stsadm” command to attach a new site to this SQL Content DB.
stsadm -o createsiteinnewdb -url http://sites/SomeSite -owneremail  SharePoint@Someplace.com
       -ownerlogin somplace\sharepointowner -sitetemplate STS#0 -title "Name of the site"
       -databaseserver mosssqlsvr
       -databasename Name_of_restored_DB

(more…)

Trick to Edit Sharepoint Web Pages within the Browser when the “Edit Page” is Greyed Out

Filed under: Sharepoint — Tags: , , , , , , , , , , , , — Tim Lefler @ 1:25 pm

This is a trick to Edit SharePoint Web Pages within the Browser when the “Edit Page” is greyed Out.  We like to add Java script to Content Editor Web Parts and not to the actual source of a page within SharePoint Designer.  For most pages this is not a problem, but for the pages associated with a List like “NewForm.aspx” the “Edit Page” selection under “Site Settings” is greyed out.

"Edit Page" Greyed Out

"Edit Page" Greyed Out

Since the source of a Content Editor Web Part can only be edited using the browser, this makes it hard for us to add Java script in our typical manor. (more…)

Older Posts »

Powered by WordPress