Developing Infopath 2003 Forms with Infopath 2007(with code behind) ... is not possible

15 04 2009 Software-Development

You might want to develop a form with InfoPath 2007 (because it's more comfortable) and then use it in InfoPath 2003. Therefore you can save the form in the 2003-format in InfoPath 2007. However, when you try to open your form in 2003 you'll get the error message:

Error - InfoPath cannot open the selected form because of an error in the form's code. A floating attribute may not be passed as the context node for an XSLT transform or an XPath query.

The german error message is:

Das ausgewählte Formular kann aufgrund eines Fehlers im Code nicht geöffnet werden.
Ein unverankertes Attribut kann nicht als Kontextknoten für eine XSLT-Transformation oder eine XPath-Abfrage weitergegeben werden.

The form you just developed can only be opened under the following conditions:

Have InfoPath 2003 and .NET 2.0, BUT NOT InfoPath 2007 installed on the machine.

So you have the following possibilties to develop a InfoPath 2003 with

  • With InfoPath 2003, VSTA in JScript/VBScript
  • With InfoPath 2003, Visual Studio 2003, Infopath 2003 SDK (which comes with a template for VS 2003) in C#/Visual Basic
This is what I figured out, corrections welcome!


Infopath: Iterating through a repeating table that is bound to a Sharepoint-List

12 11 2008 Software-Development
this is how you do it with Infopath 2007 and Microsoft Office Server 2007 (MOSS2007) or Windows Sharepoint Server 3.0. It's not valid for Infopath 2003. I've added comments to the code, so if you are a little familiar with c# it should be quite self explanatory. If you have questions just ask.

public void test1()
      {
          //We're creating a XpathNodeIterator here. Each Node in the XpathNavigator-Collection nodes1 represents one row of the sharepoint list
          XPathNodeIterator nodes1 = DataSources["string-name of the sharepointlist-data-connection";, NamespaceManager);         


          foreach (XPathNavigator n in nodes1)       
	  {   	// The field/column of each single row of the list you want is represented as an attribute
    	  MessageBox.Show(n.GetAttribute("field-/column-name", nodes1.Current.NamespaceURI));
	  }

Replace the Messagebox.Show with any action that you need to.

cronjob