Archive for December, 2010

InfoPath Form not Loading in SharePoint 2010

Something weird going on here…

I’ve a URL to an InfoPath form which renders in the browser. Here is the URL

http://sp2010/_layouts/FormServer.aspx?XsnLocation=http://sp2010/TestForm/forms/template.xsn&OpenIn=browser&SaveLocation=http://sp2010/TestForm&Source=http://sp2010/TestForm

If I start IE and paste in this URL, it works fine.

If I create a desktop icon and click on it, it works fine.

But, if I paste the URL into Word 2010 or Excel 2010 and then click on it, I get the following:

The form never loads. The Javascript error is

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; InfoPath.3; .NET4.0C; .NET4.0E)

Timestamp: Fri, 31 Dec 2010 17:08:08 UTC

Message: Syntax error

Line: 380

Char: 90

Code: 0

URI: http://sp2010/_layouts/FormServer.aspx?XsnLocation=http://sp2010/TestForm/forms/template.xsn&OpenIn=browser&SaveLocation=http://sp2010/TestForm&Source=http://sp2010/TestForm

Message: ‘g_objCurrentFormData_Error’ is undefined

Line: 549

Char: 3

Code: 0

URI: http://sp2010/_layouts/FormServer.aspx?XsnLocation=http://sp2010/TestForm/forms/template.xsn&OpenIn=browser&SaveLocation=http://sp2010/TestForm&Source=http://sp2010/TestForm

Here is line 380

var g_objHasFormPostedBack_FormControl=false;var g_objCurrentFormData_FormControl = [[],[1,[[[2,[0,["","","",-1],[[3,["",["","","",-1],[],false,false,false],-1,false,false,3]],false],-1,false,false,3]],false,[0,0],[1],false],-1,false,false,3],0,”25f04190a0d34663b6ddd45e1bf7966e_ba7c22eb533544e8b20b16a243729ec2″,”AHYXKHSEFSKL2R5RS2PME3RRTJ2RYL2UIVJVIRSPKJGS6RSPKJGVGL2UIVGVATCBKRCS4WCTJYVWE5TIPFDGC4KJOBYVU4DZNNBG2NKCKJWFQSSUIFSTMTTFIZLDEUKMGZLVQ5DQOMZE2S3TA”,1033,”2010-12-31T17:05:57″,”2010-12-31″,["0","","http:\u002f\u002fsp2010\u002fTestForm\u002fforms\u002ftemplate.xsn","http:\u002f\u002fsp2010\u002fTestForm\u002f","http:\u002f\u002fsp2010\u002fTestForm\u002fforms\u002ftemplate.xsn","http:\u002f\u002fsp2010\u002fTestForm",1,0,"FormControl",0,false],”View 1″,0,false,”TestForm – New Form”,1,”",”http:\u002f\u002fsp2010″,”ltr”,”http:\u002f\u002fsp2010″,6.34294119577127E+17,”0″,”",false,1033,”http:\u002f\u002fsp2010″,[],false,true,”",”",”0″,false,”",true,2,”",”",”",”puN2wNKuBBJ\u002fcJfi\u002fht858J7Kvg5lmIm3Ab\u002foyQb9bCuc13KdA2g5VC5SATX4mcEeMyOPR8V5fq6oC0bSAFFAQ==|634294119576971096″];

Some pretty weird looking characters after the second equals sign. If I refresh the page (F5) it works.

Line 380 now a more healthy looking

var g_objHasFormPostedBack_FormControl=false;var g_objCurrentFormData_FormControl = [[],[1,[[[2,[0,["","","",-1],[[3,["",["","","",-1],[],false,false,false],-1,false,false,3]],false],-1,false,false,3]],false,[0,0],[1],false],-1,false,false,3],0,”25f04190a0d34663b6ddd45e1bf7966e_dab1b19fd5bd43229c497a0710468307″,”AHYXKHSEFSKL2R5RS2PME3RRTJ2RYL2UIVJVIRSPKJGS6RSPKJGVGL2UIVGVATCBKRCS4WCTJYVWE5TIPFDGC4KJOBYVU4DZNNBG2NKCKJWFQSSUIFSTMTTFIZLDEUKMGZLVQ5DQOMZE2S3TA”,1033,”2010-12-31T17:17:07″,”2010-12-31″,["0","","http:\u002f\u002fsp2010\u002fTestForm\u002fforms\u002ftemplate.xsn","http:\u002f\u002fsp2010\u002fTestForm\u002f","http:\u002f\u002fsp2010\u002fTestForm\u002fforms\u002ftemplate.xsn","http:\u002f\u002fsp2010\u002fTestForm",1,0,"FormControl",0,false],”View 1″,0,false,”TestForm – New Form”,1,”",”http:\u002f\u002fsp2010″,”ltr”,”http:\u002f\u002fsp2010″,6.34294126273283E+17,”0″,”",false,1033,”http:\u002f\u002fsp2010″,[],false,true,”",”",”0″,false,”",true,2,”",”",”",”ye\u002fl3NLOSE8tEEvuHJw\u002bV8BbPew9HmxiavUkjgd\u002b\u002bkYa\u002f1J82qWX\u002bpwjlvGijygad0J6I7Vkp3onbQv56VLbwA==|634294126273282857″];

So why should clicking a link in Word 2010 or Excel 2010 be any different to following any other hyperlink? Over to Microsoft on this one I think! Anyone any ideas?

UPDATE: It seems a bit intermittent. Also setting the regional settings of the SharePoint site to “English (UK)”, the same as my client computer, seems to fix the problem.

 

Back to PointBeyond web site

PointBeyond Christmas Party

We braved the cold weather to make it out to an excellent Christmas meal at the Swan in Walton-upon-Thames. Here is a selection of the publishable photos.

 

Back to PointBeyond web site

Error Viewing Reports in Access Services

Here’s a common issue when trying to view a report in Access Services on SharePoint 2010.

You’ve published your database to SharePoint, and your forms work fine. However viewing a report results in the following error: This report failed to load because session state is not turned on. Contact your SharePoint farm administrator.

At first I thought this a little odd since in Central administration/Manage service applications I do have a State Service Application:

However the above application is used only internally. What Access Services actually wants is an ASP.net session state database.

A SharePoint Powershell cmdlet makes it easy to set this up. Start the SharePoint 2010 Management Shell and type

Enable-SPSessionStateService –DatabaseName YourChosenDBName

Note that is possible to specify –DefaultProvision as a parameter instead of explicitly specifying a database name, but if you use this parameter you will end up with a database name containing a GUID – yuk! With the approach shown above you instead get a nice database name:

Note also here that you can see the database we have just created as well as the State Service database used internally by SharePoint.

The article referenced below also mentions editing web.config but I have not found this to be necessary. Also as detailed in some of the comments on that article, it is important to consider the performance impact of ASP.net session state – fine for a low volume internal site, but more care needed on high volume sites. ASP.net session state is scoped to the web application so this could be a consideration when determining your web applications as part of your information architecture.

This detailed article by Mark Arend gives more information on setting up ASP.net session state.

http://blogs.msdn.com/b/markarend/archive/2010/05/27/using-session-state-in-sharepoint-2010.aspx

Back to PointBeyond web site

Excel Services – Unable to Open the File for an Unknown Reason

Error messages in the UI to Excel Services aren’t always the most helpful, take for example:

Excel Services is unable to open the file for an unknown reason.

Wait a few minutes and try to open the file again. If the problem persists, contact your administrator.

However, I am often finding that a quick check of the Windows application event log reveals the underlying problem, without the need to revert to the SharePoint log files.

In my particular case, the cause of the problem is revealed in the application log pretty clearly. The service account used to run Excel Services (more specifically the application pool identity that hosts Excel Services) does not have access to the content database containing the Excel file. The resolution is simply to grant the identity database owner rights on the content database. Excel services then works fine. It may be possible to get away with less than database owner rights – I may experiment with this in future, or would be interested to hear other experiences.

Ian

Back to PointBeyond web site



Follow

Get every new post delivered to your Inbox.

Join 279 other followers