-
It looks like there's a bug in Microsoft's code sample.
They have this line:
InfoPathAttachmentEncoding.Encoder myEncoder = new InfoPathAttachmentEncoding.Encoder(fileName);
But the class is called InfoPathAttachmentEncoder, not just Encoder. Try this instead:
InfoPathAttachmentEncoding.InfoPathAttachmentEncoder ...
-
[quote user="kcoakley"]What are the offending items in this code?[/quote]
Every single one of them, I'm afraid :-)
The corresponding code for IP 2007 would be:XPathNavigator row = MainDataSource.CreateNavigator().SelectSingleNode("//my:repeatingtable[last()]", NamespaceManager);
// I don't think you need ...
-
What happens if you remove this part?:
field = doc.CreateElement("field3", NamespaceManager.LookupNamespace("my"));
node = group.AppendChild(field);
node.InnerText = "Cell 3";
The button is part of the repeating table control. It's not something you manually add to each row from the code.
-
What happens if you use "//my:repeatingtable[last()]" in that first line?
-
I don't know of any function that's available for doing this (InfoPath has a built-in function called xdFormatting:formatString(), but it doesn't seem to be directly accessible in expression boxes.
However, you can accomplish this with some substring() functions and a secondary XML data source. Have a look at the attached ...
-
my:SectionA[count(../my:SectionA)] should do the trick, but for this purpose, my:SectionA[last()] should work just as well.
-
Try removing the spaces before and after the slashes. What's the exact formula you see when you click the Show XPath checkbox in the formula builder?
-
If my:GroupA is the name of your repeating group and my:FieldB is the name of the field you want to target, then the path to FieldB in the second row of GroupA would bemy:GroupA[2]/my:FieldB
-
I also don't understand why you would suggest using a separate textbox to perform this validation. That would give the user a confusing textbox with all the spaces converted to as.
This pattern should work:[a-zA-Z]([ ]*[a-zA-Z])*The pattern above will approve strings that meet all of the following criteria:Contains one or more ...
-
You need to pass the NamespaceManager to SelectSingleNode(). You're already doing that correctly in this line: XmlWriter writer = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:SomeGroup", NamespaceManager).AppendChild();