Showing posts with label SharePoint 2007. Show all posts
Showing posts with label SharePoint 2007. Show all posts

Wednesday, September 5, 2012

Cannot make a cache safe URL for "styles/~/SampleProject/StyleSheet.css", file not found. Please verify that the file exists under the layouts directory.

Hi All,

While trying to register a CSS file in SharePoint using CSSRegistration class as:

// Register CSS File
CssRegistration.Register("~/_layouts/SampleProject/StyleSheet.css");

We got the following error:

"Cannot make a cache safe URL for "styles/~/SampleProject/StyleSheet.css", file not found. Please verify that the file exists under the layouts directory".






One of the benefits of using SharePoint:CSSRegistration is that it prevents multiple loading of same CSS file. For Example, if we try to register a CSS file multiple times as:


// Register CSS File
 CssRegistration.Register("/_layouts/SampleProject/StyleSheet.css");
 CssRegistration.Register("/_layouts/SampleProject/StyleSheet.css");
 CssRegistration.Register("/_layouts/SampleProject/StyleSheet.css");
 CssRegistration.Register("/_layouts/SampleProject/StyleSheet.css");

The final rendered Page will have only one instance of this style sheet.

Ok. Coming back to the problem, the Resolution is to remove ~ in the URL. Hence, the correct statement would be:


// Register CSS File
 CssRegistration.Register("/_layouts/SampleProject/StyleSheet.css");

Here is a good source to know more about SharePoint:CSSRegistration:
http://tommdaly.wordpress.com/2012/05/02/sharepoint-cssregistration-or-link/

Thanks !

Sunday, May 20, 2012

No report servers were found on the specified machine - SharePoint 2007

Hi All,

We got the below error in "Grant Database Access" step when trying to configure reporting services in SharePoint 2007 server.

Error:
"No report servers were found on the specified machine"











Background:
SharePoint 2007 and Database are on seperate machines. Hence, to install reporting services, we have first installed Microsoft SQL Server 2008 R2 Developer Edition with Reporting services database configured in SharePoint Integrated Mode.

We also installed Microsoft SQL Server 2005 Reporting Services Add-in for SharePoint on SharePoint 2007 server. Then, when trying to grant database access in Central Administration, we got the above error.

Resolution:
To resolve this error, we have installed latest version of "Microsoft SQL Server 2008 Reporting Services Add-in for Microsoft SharePoint Technologies" from here.

Once this was done, we were able to render the SSRS reports properly.

Cheers !