SharePoint Blog - René Hézser

Anmelden  RSS Feed RSS Feed
Startet die Suche

Archive

Kategorien

Links

Andere Blogs



Add to Technorati Favorites

Feb 182008

Setting up Reporting Services with not default database name

Setting up the Reporting Services with a non default database name requires that you create a Script, and change the database names in this script, because otherwise the creation of the databases fails.

Before you can generate the Script, start up the Reporting Services Service in the first Dialog of the Wizard!

In the "Database Setup" Dialog of the Reporting Services Configuration Wizard hit the "Script" Button. (My Database Name is "ReportServer2005).

After the Script has been generated, open it with SQL Server Management Studio (or you favorit Editor), and replace [ReportServerTempDB] with your Database name ([ReportServer2005TempDB]). In my case this was in the lines 14036 and 14047.

INSERT INTO [ReportServerTempdb].[dbo].[ChunkData] (
needs to be changed to
INSERT INTO [ReportServer2005Tempdb].[dbo].[ChunkData] (

and

FROM [ReportServerTempdb].[dbo].[ChunkData]

to

FROM [ReportServer2005Tempdb].[dbo].[ChunkData]

After that, you can execute the script. It will generate the databases, and set them up for usage with Reporting Services.


Published: 2/18/2008  8:47 AM | 0  Comments | 0  Links to this post
Tagged as: Reporting Services

Feb 072008

Get default page Url

l know it is not a smooth approach, but a working one. How do you get the default Url from an SPWeb? If you have the publishing feature activated, you can use PublishingWeb.DefaultPage property. But not for WSS.

   1: internal static string GetDefaultWebUrl(string webUrl)
   2: {
   3:     WebRequest request = WebRequest.Create(webUrl);
   4:     request.Credentials = CredentialCache.DefaultCredentials;
   5:     using (WebResponse response = request.GetResponse())
   6:     {
   7:         return response.ResponseUri.LocalPath;
   8:     }
   9: }

Update:

There is a much easier way to get the default page. See “How To get the default page from a website


Published: 2/7/2008  7:16 PM | 0  Comments | 0  Links to this post
Tagged as: Development, SharePoint

Feb 072008

Error 0x80020009

I am sure you all know the Best Practices: Using Disposable Windows SharePoint Services Objects Guide from Microsoft. If not, read it :-)

Please be carefull what objects you dispose after you don't need them anymore. If you dispose the SPContext.Current.Site object, you might get strange behaviours. e.g. you might not be able to save Webpart properties. Doing so, will generate an error:

Cannot save the property settings for this Web Part. Exception occurred. (Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION))

   1: SPSite site = SPContext.Current.Site;
   2: // do something with it
   3: site.Dispose();

This code fragment will actually dispose the SPContext.Current.Site object!

   1: SPSite site = new SPSite(SPContext.Current.Site.ID);
   2: // do something
   3: site.Dispose();
The above sample will work!

Published: 2/7/2008  6:49 PM | 1  Comment | 0  Links to this post
Tagged as: Development, SharePoint

Feb 012008

Using the SharePoint SiteMapProvider

Did you ever wanted to create a Webpart for site navigation? Well, you can use the SPSiteMapProvider from SharePoint.

In your Webpart you could use this code to access the SPSiteMapProvider.

   1: SPSiteMapProvider sitemapProvider = (SPSiteMapProvider)SiteMap.Providers["SPSiteMapProvider"];
   2: SiteMapDataSource datasource = new SiteMapDataSource();
   3: datasource.Provider = sitemapProvider;

This Datasource can be the datasource for a regular ASP.NET Treeview Control:

   1: TreeView treeview = new TreeView();
   2: treeview.NodeIndent = 10;
   3: treeview.DataSource = datasource;
   4: treeview.TreeNodeDataBound += _TV_TreeNodeDataBound;
   5: treeview.DataBind();

In the DataBound Event we will make sure, that nodes within the current navigation path are expanded, and others are collapsed:

   1: void _TV_TreeNodeDataBound(object sender, TreeNodeEventArgs e)
   2: {
   3:     SiteMapNode node = (SiteMapNode) e.Node.DataItem;
   4:     if (_CurrentUrl.StartsWith(node.Url))
   5:         e.Node.Expand();
   6:     else
   7:         e.Node.Collapse();
   8:  
   9:     if (_CurrentUrl == node.Url)
  10:         e.Node.Select();
  11: }

 

If you like, you can set the styles for the selected node...


Published: 2/1/2008  3:59 PM | 0  Comments | 0  Links to this post
Tagged as: Development, SharePoint