Saturday, April 9, 2011

InfoPath 2010–resolving “There has been an error while processing the form” error

I got this error message when submitting my InfoPath 2010 form via web browser. But it worked pretty fine when I submit the same form through the InfoPath filler.

image

In my form there were several text box controls and a rich text box. In my SharePoint error logs I found the following entry that lead me to the correct path

There was a form postback error. (User: Domain\spadmin, Form Name:
Cash Advance Chit,IP:,Request: http://domain.com/sites/workflow/Page.aspx,
Form ID: urn:schemas-microsoft-com:office:infopath:Cash-Advance-Chit
:-myXSD-2011-02-18T03-28-33, Type: InvalidCastException, Exception Message:
Unable to cast COM object of type 'HTMLCHECKERLib.XMLPProcessorClass'
to interface type 'HTMLCHECKERLib.IHTMLtoXHTML'. This operation failed
because the QueryInterface call on the COM component for the interface with
IID '{A260B372-BC78-441B-8764-D0B83F4004F4}' failed due to the following
error: No such interface supported (Exception from HRESULT: 0x80004002
(E_NOINTERFACE)).)


It states that the error has occurred due to a form postback. So it should’ve caused by the rich text box, because when moving focus from the rich text box automatically causes a postback to the server. I did some research on that issue where some experts mentioned that this error may have occurred due to issues with the InfoPath installation. This suggestion was reasonable to me because the same form submitted fine when I used in the staging environment. the issue occurred only in the production environment. So I completely uninstalled InfoPath and reinstalled it.. but with no luck !! the error appears in the same way.

Finally I managed to get hold with the problem. A dll required for the operation hasn’t registered in the registry. the culprit was “htmlchkr.dll” (Microsoft Markup Analysis Processor). By executing the following command I managed to resolve the problem.

regsvr32 "C:\Program Files\Common Files\Microsoft Shared\OFFICE14\htmlchkr.dll"

That dll ruined few days of my life Smile

Tuesday, April 5, 2011

ASP.Net Session State in SharePoint 2010

Although we have State Service service application running in our SharePoint farm, it doesn’t mean that it directly support ASP.Net session state. State service is more towards facilitating session information for office internal components such as InfoPath form services, Visio services, etc.…

If we need to maintain ASP.Net session state for SharePoint 2010 pages we have to enable it manually. Recently I wanted to enable ASP.Net sessions in one of my Visual Web Parts.

There are two ways that you can use to enable ASP.Net sessions.

1] Using PowerShell command

Use following command to enable the ASP.Net session state service

Enable-SPSessionStateService –DefaultProvision

After that you can see a new service application “SharePoint Server ASP.Net Session State Service” running in the service application section

image

that’s all !!

2] Session State Managed module using IIS Manager

You have to use this method if you are using SharePoint Foundation. You can use this for SharePoint 2010 Server versions also. but you will not get a separate service application. For SharePoint 2010 server versions, recommended best practice is to use the 1st method which is to use PowerShell command.

First we have to modify few settings in the web.config file of the respective SharePoint 2010 web application

<pages enableSessionState="true" …… >

Then add session state module within system.web section

<httpModules>
<
add name="Session" type="System.Web.SessionState.SessionStateModule" />
</
httpModules>

After that we have to add the Session state module in IIS7 for the web application.

Go to IIS Manager, select the relevant SharePoint web application and open the Modules section

image

Inside the modules section click on Add managed module link to add the Session State module

image

Input a name for the module and select following for the module type from the dropdown


System.Web.SessionState.SessionStateModule,System.Web,Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

image

That’s it !!. now you can use ASP.Net Sessions in your SharePoint 2010 pages

Friday, April 1, 2011

Presentation-Introduction to Excel Services 2010

Sri Lanka SharePoint forum March 2011 offline meeting happened on Wednesday 9th of March. Seminda Rajapaksha did the first session on Introduction to SharePoint 2010. He described history,features and carrier opportunities of SharePoint.

SharePoint-Forum-March-2011-Ofline-Session

I did the second session on Introduction to Excel Services 2010. I described about features of Excel Services, architecture of the excel services and presented few demos. from the following links you can access the presentation and a demo that accesses the Excel Web Service (EWS) which is a component of Excel Web Services 2010.

Excel Web Service Demo

Any comment on this session will be greatly appreciated.