On SharePoint Solutions and Features

So back in July of last year (2007), I promised to post some tutorials and walk-throughs about creating SharePoint solution packages (also known as WSP files) using some extensions for Visual Studio 2005. Almost a year later, I haven’t done it. This is because I everytime I started working on a tutorial I found that there are so many options and decisions that need to be made to create a proper package. I still plan on posting about it soon, however, I think I will start with some simpler tutorials to explain how to organize and scope the features that are contained in the solution. In any case, I just wanted to let everyone know that I haven’t forgotten about my promise and why it has taken so long to get around to it.

Microsoft SQL Server 2005 Reporting Services Add-in for Microsoft SharePoint Technologies

The Microsoft® SQL Server™ 2005 Reporting Services Add-in for SharePoint Technologies is a Web download that provides features for running a report server within a larger deployment of Microsoft Windows® SharePoint® Services 3.0 or Microsoft Office SharePoint Server 2007. The Reporting Services Add-in provides the following functionality:

  • A Report Viewer Web Part, which provides report viewing capability, export to other rendering formats, page navigation, search, print, and zoom.
  • Web application pages so that you can create subscriptions and schedules, set model item security, and manage reports, models, and data sources.
  • Support for standard Windows SharePoint Services features including document management, collaboration, security, and deployment with report server content types. You can use alerts, versioning (check in/out), and Filter Web Parts with reports. You can add the Report Viewer Web Part to any page or dashboard on a SharePoint site and customize its appearance. You can use SharePoint permission levels and roles to control access to report server content. You can also use SharePoint forms authentication to support access over Internet connections.
  • Support for additional languages. The Web application pages, Report Builder, and ReportBuilder.chm are available in the standard SQL Server languages (Chinese Simplified, Chinese Traditional, English, French, German, Italian, Japanese, Korean, Russian, and Spanish), and the following additional languages: Czech, Danish, Dutch, Finnish, Greek, Hungarian, Norwegian (Bokmal), Polish, Portuguese (Portugal), Portuguese (Brazilian), Swedish, and Turkish.

The Reporting Services Add-in works together with updated program files that are in SQL Server 2005 Service Pack 2 (SP2). SP2 is required on the report server and provides the following functionality for a report server that is configured for SharePoint integrated mode:

  • Synchronization from SharePoint content databases to the report server database.
  • A custom security extension that uses SharePoint permissions to control access to report server operations.
  • A new delivery extension that you can use in subscriptions to deliver reports to SharePoint libraries.
  • A revised Reporting Services Configuration tool that you can use to configure a report server for SharePoint integrated operations.
  • Publish reports and models from Report Designer and Model Designer to a SharePoint library.
  • Open reports and models in Report Builder from a SharePoint library, and save reports to SharePoint libraries across the site.
  • A new SOAP endpoint for managing report server content in SharePoint integrated mode.

The add-in is available as a download from Microsoft.

SPFolder and Content Approval

Question:How do I approve a folder in a document library that requires content approval using the SharePoint object model?

Answer:It may seem like a trivial question. After working with the SharePoint object model to create and approve files, it would make sense that any item or folder object would also contain methods needed to check in, publish, and approve them. Well after checking the members of the SPFolder and SPListItem classes on MSDN, I found that they don’t contain properties or methods to intuitively check in, publish, and approve them.

At first, I figured I could use the approve method from SPFile class since the folder object has a property to access the underlying item which has a a property to access the underlying file. Well, it turns out that file property of the item property of the folder object returns a null reference. So, I was back to square one.

As it turns out, the solution to this problem lies in working with the underlying item object. The underlying item object has a property that allows you to access the moderation information object (SPModerationInformation) which contains information about the approval status of the folder. You can then check the status and change as it needed by manipulating the moderation information object directly. Below is a method that I wrote to solve my problem (which was just to approve the folder):

private void ApproveFolder(SPFolder spFolder, SPDocumentLibrary spDocumentLibrary)
  if (spFolder.Exists && spDocumentLibrary.EnableModeration)
    SPModerationInformation spModerationInformation = spFolder.Item.ModerationInformation;
    switch (spModerationInformation.Status)
      case SPModerationStatusType.Pending:
        spModerationInformation.Status = SPModerationStatusType.Approved;
        spModerationInformation.Comment = "Got approval?";
    spModerationInformation = null;

Obviously there is a lot more that you can do with the moderation information object. Hopefully, you will find my experience useful.

So You Want to Develop Custom SharePoint Workflows

Elaine Hao, Program Manager of SharePoint Workflow @ Microsoft, put together a really nice series of blog posts on developing MOSS2007 workflows on the Microsoft SharePoint Products and Technologies Team Blog. At the end of the series, she attached a little mini whitepaper that covers everything she covered in her series. I found it extremely useful as I worked on some custom workflow for a client and decided to keep a copy of So You Want to Develop Custom SharePoint Workflows for myself.