I uncovered this problem on 2004-08-18 while hard at work creating a form. It caused me quite a headache at first until I was able to narrow and then finally track down the problem. I've reported it to Microsoft.
DESCRIPTION:
The problem seems to stem from inserting a non-repeating group into the view that is contained within repeating group, which is not inserted into the view. The non-repeating group is inserted as a non-repeating Section.
Here's the walkthrough to reproduce the problem:
- Launch InfoPath.
- Create a new blank form
- Open the Controls task pane.
- Insert a Repeating Section in the view.
- Insert a Section in the Repeating Section.
- Insert a Text Box in the Section.
- Select everything in the view and delete it.
- Open the Data Source task pane, and then expand the data source tree.
- Insert group2 as a Repeating Table in the Section.
- Insert group1 as a Section at the bottom of the view. This section would ultimately have conditional visibility added to it.
- Click inside the Section to set the insertion point.
- Right-click on group2 and then choose More | Section (i.e. non-repeating section)
- Drag and drop field1 into the group2 Section.
- Preview the form.
Note that when clicking on the Section that it gets highlighted blue just as the Repeating Table does. We need to eliminate this blue highlighting.
- Close the preview.
- Delete the group2 Section.
- Click inside the Section to set the insertion point.
- Right-click on group3 and then choose More | Section (i.e. non-repeating section)
- Drag and drop field1 into the group3 Section.
- Preview the form.
Note that when clicking on the Section that it no longer gets the blue highlighting. This worked!
- Close the preview.
- Choose Extract Form Files from the File menu, choose a folder and then save.
- Close InfoPath.
- Open the folder you extracted the form files to.
- Right-click on the manifest.xsf file and choose Design.
An error message appears with the following message:
InfoPath cannot open the following form: {Folder_Path}\manifest.xsf
Microsoft Office InfoPath cannot open the selected form.
- Click OK, and exit InfoPath.
- Edit the view1.xsl file in a text editor, such as NotePad.
- Search for [1]. You'll find the following line:
<xsl:apply-templates select="my:group2[1]/my:group3" mode="_13"/> |
Note that the [1] means to select the first instance of group2. This indicates that we chose a non-repeating section when we inserted group3 in the view.
- Delete [1], save and then close the view1.xsl file.
- Right-click on the manifest.xsf file and choose Design.
InfoPath opens the form template, but now there are red errors on the group3 Section and on field1.
When we used a non-repeating Section using group2, it worked, but we had the blue highlighting. The apply-templates in the view for that scenario looked like this:
<xsl:apply-templates select="my:group2[1]" mode="_12"/> |
So why does InfoPath work when selecting only the first instance of a group, but not when selecting a field within that first instance? Why can you preview the form, but once you save it, you can no longer open it?
WORKAROUNDS:
I currently do not know of a workaround for this.
©2004 Greg Collins. All rights reserved. Licensed to Autonomy Systems, LLC for display on InfoPathDev.com.