Microsoft Technology, .Net, BizTalk, Sharepoint & etc.

Liedong(Ken) Zheng, Senior SharePoint Developer at SIMPLOT

Archive for November 4th, 2009

xxx does not implement IReportServerConnection or could not be found at Microsoft.Reporting.WebForms.ConfigFilePropertyInterface in SharePoint

Posted by ken zheng on November 4, 2009

If you create a custom viewer and add in your web.config.

<add key="ReportViewerServerConnection" value= ...>

You will find your Site Ussage report will not working and throw error with your assembly does not implement IReportServerConnection or could not be found. After searching the net and I found Steve’s blog. Although the error is different, the fix is the same.

“The problem is that web config’s are inherited in IIS therefore the reporting services web service web config settings are inherited from the report manager web config which means that the setting you removed is needed for report manager but breaks the web service.”

So to fix the problem, go to C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\TEMPLATE\LAYOUTS and open web.config, add:

<appSettings>
    <add key="ReportViewerServerConnection" value="" />
</appSettings>

Posted in Sharepoint | Tagged: | Leave a Comment »

Easiest Way To Add Custom Page to SharePoint

Posted by ken zheng on November 4, 2009

I found the easiest way to add custom page to SharePoint is to create a host aspx page and embed usercontrol inside, so next time if you have any update you can just update the usercontrol.

Below is the aspx inline page and I upload to Pages library

<%@ Page Language="C#"  EnableSessionState="true"  MasterPageFile="~masterurl/default.master"%>
<%@ Register src="~/_controltemplates/TestUserControl.ascx" tagname="TestUserControl" tagprefix="uc1" %>

<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderMain" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"/>
      <uc1:TestUserControl ID="JDEGLSearch" runat="server" />
</asp:Content>

The TestUserControl.ascx just a User Control created in the visual studio. You can add the ui into 12\TEMPLATE\CONTROLTEMPLATES

or you can add into _\12\TEMPLATE\LAYOUTS folder but which means everyone can access the page

<%@ Page language="C#" MasterPageFile="~/_layouts/application.master" Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" %>

<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderMain" runat="server">
  <b>Hello</b>
</asp:Content>

Posted in Sharepoint | Tagged: | Leave a Comment »

Use Session in Custom Page: Session state can only be used when enableSessionState is set to true

Posted by ken zheng on November 4, 2009

If you received this error when use session in your custom aspx page deployed to SharePoint:

Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the \\ section in the application configuration.

If you add “EnableSessionState=”true” “ to your it should enable it but also you need to modify you web.config

The problem is that by default, Sharepoint does not allow server side code in .aspx pages by default. You need to enable this using PageParserPath. Add the PageParserPath inside of the PageParserPaths node of the web.config file, changing the virtual path to the path you want to enable. Or you can use /Pages/* as the value if they are in the same folder

Posted in Sharepoint | Tagged: , | Leave a Comment »