.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Problem to open infopath form : The file cannot be opened because it is not a valid InfoPath form

Posted By:      Posted Date: September 14, 2010    Points: 0   Category :SharePoint
Hi i have a winform app which host of infopath forms. form templates and data stores in database and when user want to open/edit an existing infopath form data, it must be extract from database, save on disk and then open it to display it in formControl. my problem is that when i open form data, after it has been extracted on disk, i got this error : InfoPath cannot open the following file: C:\Users\Hamed\Documents\Visual Studio 2008\Projects\InfopathFormTest2\InfopathFormTest2\bin\Debug\d00d73e8-cf5c-4b12-b9a6-591c4ade83aa.xml. The file cannot be opened because it is not a valid InfoPath form.  The processing instruction in the file is missing or invalid. here is my code : this._fullPath = System.IO.Path.Combine(Application.StartupPath, this._dataRow.FormID.ToString() + ".xml"); this._templatePath = System.IO.Path.Combine(Application.StartupPath, this._templateRow.TemplateID.ToString() + ".xsn");if (HelperClass.ExtractToDisc(_fullPath, ASCIIEncoding.Unicode.GetBytes(this._dataRow.FormContent))) { this.formControl1.Open(_fullPath); this.txtFormName.Text = this._dataRow.FormName; } where is my problem and how to solve this ? thanks in advancehttp://www.codeproject.com/KB/codegen/DatabaseHelper.aspx

View Complete Post

More Related Resource Links

There has been an error while loading the form - The following file is not a valid InfoPath form tem



We’re experiencing quite an odd issue with opening forms within a SharePoint form library. These are the symptoms;

We recently published a newer version of an InfoPath form, and have since received some feedback that the form no longer opens in the “View Properties” view of SharePoint.

Rather interesting though, within the standard view all form instances can be opened with no problem.

The reason this has to work within the “View Properties” view of SharePoint is because we have a workflow that is sent, with a link to this particular page.

This is the error message that is displayed;


There has been an error while

Problem with InfoPath 2007 Form opened with InfoPath 2010 - whole number integer not coming into dat


I found an issue when testing existing InfoPath 2007 forms via the Infopath 2010 Designer client.  Integer fields in the form template are publishing to a SharePoint Forms Library and show in the default view.  However, if that library is then used as a Data Connection in another or same form template those integer fields are not displaying or available for selection. 

This is not a problem using the InfoPath 2007 client.  It is not an option to convert the field to text as it could affect existing forms in existing libraries.  Also, existing integer fields are no longer appearing in previously defined SharePoint-based secondary data connections.  Only the ID field still appears.  But, those existing fields still work in the form and are selectable for functions, etc.

Is there a solution to this?

Thanks much!  Mike - www.ProgramNetInc.com


Insert image into Infopath form and save to SharePoint as PDF file


I have an InfoPath web-enabled form in MOSS 2007, that is integrated with a K2 blackpoint process for an approval workflow.

Once the form (a Purchase Order request form) has been approved in the K2 workflow process, I switch the form view to a "print-friendly" view for the requestor to view from the browser.  However, now I need to go one step further with this scenario:

1) I need to somehow insert/embed an image with the scanned-in signature of the approver (likely stored in a SP doc library) at the signature line section of my form.  Also, what are the security requirements for storing such images, but not granting all users access to these (e.g. only services accounts that need to access this for embedding into the form, etc.)?

2) Then I need to convert this final "print-friendly" view of the form (with the signature image) to a PDF document so that I can store it in SharePoint (and email it to the requestor using K2's email event capabilities).

Can anyone help me with a solution to both of these requirement, or point me to some resources for this (even 3rd party components are open-game).



display icon or colum for inserted file in infopath form

i have a list with infopath form and in this form i have insert file now i need naythin in the view say there is attached or insert file in this record like the icon for attachment or column display file name or his path ,somthink can i know in this record there is attachmentThanks for any help :) my blog is: http://www.waelk.com

Expense Reimbursement Approval template cant open infopath form

hi, i just created a site using the template Expense Reimbursement Approval. but when i click on the Expense link and click new it try to open infopath form but it gives me this error: The form template was created with a newer version of InfoPath. This form template was created by InfoPath version 12.0.0. do i have to use infopath 2007 to open this form? thnx

The URL is not valid error while publishing InfoPath form to MOSS 2007 server

Hi All,   When I try to publish the form onto a SharePoint Team site it throws the error: The following URL is not valid : http://tcs037288:6543/sites/projectmanagement   I have checked the comaptibility, trust and everything looks fine. Also, I tried to upload this template from Central Admin but there it is failing with browser-compatibility errors.       Regards,

Can i Start Workflow on Infopath form open?

HI, I Have a Scenario where when i open a Infopath 2010 form in Sharepoint 2010 as XML Form View Webpart, Custom workflow must be enabled, can i do this? If Yes, Please tell me steps to configure or code for starting a workflow. Thanks you all in Advance

Problem to save infopath form data in database.

Hi i have a win application which host infopath forms. i want to save infopath form data in database. to do this, in my table, i have xml dataType which store infopath form data. my problem is when i load xml form into string variable and save to database, i got this exception : XML parsing: line 1, character 38, unable to switch the encoding Here is my sample infopath form data in xml format : <?xml version="1.0" encoding="UTF-8"?><?mso-infoPathSolution solutionVersion="" productVersion="12.0.0" PIVersion="" href="file:///C:\Users\Hamed\Documents\customForm1.xsn" name="urn:schemas-microsoft-com:office:infopath:customForm1:-myXSD-2010-09-11T10-56-47" ?><?mso-application progid="InfoPath.Document" versionProgid="InfoPath.Document.2"?><my:myFields xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2010-09-11T10:56:47" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003" xml:lang="en-us"> <my:txtFirstName>b</my:txtFirstName> <my:txtLastName>c</my:txtLastName> <my:txtFatherName>d</my:txtFatherName> <my:txtNationalCode>e</my:txtNational

File upload in infopath form put in xmlformview webpart MOSS2007


Hi all,

Is there any workaround involed in the infopath form when it has file upload control in it.

This is called in the  xmlformview webpart of an aspx page. While submitting the form the file upload diesn't happen.

And I'm using Infopath 2007 and MOSS 2007.

Any solution for this ?

Thanks in advance


sharepoint development

InfoPath cannot open the selected form


I have been working on an InfoPath 2007 form for a week. It is actually a form I started from scratch to replace an existing form that had some weird stability issues for which there was no hope of a fix. The new form was working and previewing great until this morning when, for no apparant reason, it decided to start giving me the infamous "InfoPath cannot open the selected form" error when run from Visual Studio.

I clicked the "Was this information helpful?" link and responded "No", so I am sure that Microsoft has its best people scrambling for a fix; however, in the meantime, has anyone ever actually successfully fixed this error without starting over when clearing the cache (http://msdn.itags.org/microsoft-office/78856/) doesn't help?

Converting an Infopath form to a doc or pdf, attaching that file to an email that is then sent to an


Hi, we are looking to have internal users submit a browser based Infopath form hosted on our internal Sharepoint 2010 portal, have that submission start a workflow that converts the form to a .doc or .pdf, attaches the converted form to an email and then sends the email to different external addresses depending on the value of 1 field in the form.  Is this possible?

We are running Sharepoint 2010 Enterprise and I have Infopath 2010 and Sharepoint Designer 2010.  Thank you in advance for any help!


How to add Quick AccesToolbar or Ribbon or TaskPane in browser when open InfoPath web browser form?



I would like to add my own ToolBar or Ribbon in browser when user open web browser form which was designed in InfoPath2010. My be a smth look like TaskPane will the best way?(I know how to add it in InfoPath, but how to show it in browser?) I want to show a list of views, so users will have an opportunity to navigate between form views.

How is it possible to do ?

error while openning infopath file + "The Form has been closed."



I have restored the "Infopath" library from production to staging server

and when i tried to open the InfoPath form template(i.e TestFile.xsn file), but i am getting below error "The Form has been closed."

Actaully when i saw the log in 12\log folder, the error is given below

"10/07/2010 06:20:59.47  w3wp.exe (0x1A10)                        0x1740 Forms Server                   Forms Services Runtime         8ged Medium   MetaInformationByUrl:CrossSite check failed for site URL=http://mysitestaging/teamsites and file URL=: http://mysite/teamsite/formservertemplates/research%20request.xsn "

Please help me to solve this issue

Infopath 2007 form error - Selected file is too large


We are using Inforpath form to capture some metadata along with couple of file attachments. We implemented that and its working fine

When we tested by trying to upload file more than 5 MB we got the following error

"The selected file is too large and is causing the form to exceed the amount of allowable resources. Select Another File"

During its analysis we found that this can be resolved by changing one of the "Infopath forms service " configuration named "Maximum size of form session state".

Is there any issue (like performance issues) in increasing this limit to allow us to upload the large attachment


In other words

In the Maximum size of form session state text box, type the maximum session state size in kilobytes. Form-filling sessions that exceed this value will terminate, an error message will be generated, and all form data entered during the session will be lost. The default value is 4096 kilobytes.

If I make this value to 10240 kilobytes (10 MB) ; will this cause any performance issues ??

How can I open an InfoPath Form in a modal Windows or Popup from inside another InfoPath Form


Hey guys, I need some help, please. How can I open, in a modal windows or pop up, an InfoPath form from inside another InfoPath form using a button or maybe a link. I need to be able to have both forms on the screen.

How can I do that? Can I use jQuery?

Help, please.

Thanks in advanced!

Published InfoPath Form will not open from AAM URL


We have a couple InfoPath Forms that work great when accessed from the Local Intranet.  However, after configuring the site for Internet access as well, using Alternate Access Mappings, the InfoPath Form will not load.

For example, when attempting to create a new instance of one of the Forms from a Library where the Form is setup as a Content Type, it forwards to an address using the Local Intranet URL - obviously not accessible from outside the network.

ie. Secure "https://site.domain.com/" site is connected to from the internet, but when trying to create a new Form, it forwards to a "http://server/" address and results in a Page Cannot be Displayed error.

Am I missing something in the AAM, or what could be causing this behavior?

Problem opening an attachment from Infopath 2007 form in SharePoint 2010

I have an InfoPath 2007 form that is opened as a web based form in SharePoint 2010 that has an attachment control.  In Windows XP with IE 7 when you double click the attachment there is a warning message presented and after you click OK you get a prompt that asks if you want to open or save the file or cancel.  In Windows 7 with IE 8 when you double click the attachment there is a warning message presented and after you click OK you get a prompt that asks if you want to save the file or cancel, no open option.  I already set the SharePoint browser permission to permissive for the site and it doesn't help.  How can I get this to work in Windows 7 and IE 8?
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend