Showing posts with label Infopath 2007. Show all posts
Showing posts with label Infopath 2007. Show all posts

Wednesday, January 06, 2010

Request for the permission of type 'System.Security.Permissions.FileIOPermission failed

Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral,PublicKeyToken=b77a5c561934e089' failed

In case you receive security issue when executing the managed code infopath form , solution is to make the infopath form Full Trust.

To make form full trust , in Office Infopath design mode, go to Tools -> Form Options -> Security and Trust -> Full Trust (Change Security level to full trust ).

Publish theform .

Tuesday, December 04, 2007

Infopath cannot add the event handler

While working in Infopath 2007 managed code when i tried to attach managed code to existing
form i got the following error:

Error :

Infopath cannot add the event handler

Infopath cannot create the visual basic or C# project

The location for the visual basic or C# project cannot be found or cannot be accessed


So next steps is to search internet , well no luck in that too . Then i decided to try different things with my form settings and shazam!!! got the form working .

Solution in my case :
  • Go to Tools -> Options ->Design Tab
  • Check the language for programming /select the desired language
  • Go to Tools -> Form Options -> Programming Section
  • Select the programming language which you selected in previous settings

That should be good enough to make you go forward.

In my case there was difference in language settings which caused all these errors, which might be in your case too.

Happy Infopath Programming!!!!

Friday, November 30, 2007

Writing Managed Code for Browser based Infopath 2007 Form

Ever wondered how to write managed code for Browser based infopath form , check this out :

http://www.microsoft.com/downloads/details.aspx?familyid=db1d99d9-0a31-45de-8efb-16c75e194dc3&displaylang=en

Steps in Nutshell :

  • Change the form security to full trust

Tools -> Form Options -> Security and Trust -> Full Trust

  • Publish Infopath Form to Network Share

  • Upload form to the server

Central Administration > Application Management > Manage Form Templates

  • Active form for desired site collection

  • Access the form using url of following format :

http://"server name"/_layouts/formserver.aspx?xsnlocation="site collection address "/formservertemplates/"form name".xsn&openin=browser&QueryParametername="value"

Wednesday, May 23, 2007

People Picker Control for Infopath 2007

Ever wanted to have a people picker kind of control in Infopath form and that too in browser mode. Did i heard yes :) , well there is a Active-X control which takes care of this part named "Contact Selector Control".

Just follow the steps to get it working :

Add Contact Selector to Controls Pane

  • Click the "Add or Remove Controls " from the Control Task pane as shown in figure





  • Click ADD
  • Select Active-X
  • This will display a list of controls , select "Contact Selector" ,click Next
  • Select "Don't include a .cab file"
  • From drop down select "Field or Group(any data type) and click finish

DataSource for the Contact Selector control

  • Add non Repeating group named "group1"
  • Add a repeating Group names "Person"
  • Add following test field to the "Perosn " group (DisplayName,AccountId,AccountType)


Add Secondary datasource XMl file with details about the SharePoint Server , this is required by the form in order to validate the user against a particular sharepoint server .

  • Open Notepad and add the following Tag <Context siteUrl="http://<servername>"/>
  • Save the file as Context.xml
  • Add new connection as "Receive Type" and source of data as "XML"
  • Option “Include the data as a resource file” shoule be enabled


Drag control to the form and you are all set .


Best of Luck !!!!

Gray Failures: What is it and how to detect one?

If you are reading this article , i guess you are curious to know about gray failures and different methods to detect gray failures.  Hopefu...