B
Bryan
I am trying to copy specific data from a SharePoint list into a repeating
table in InfoPath 2003. I have found articles all over the web that specify
how to do this very easily in IP2007 using XPathNavigator, however I have
been unable to achieve the same thing in 2003 compatability.
(unfortunately my company is somewhat backwards, they will not upgrade to
2007 for some time yet).
This is using c#
What I have so far (please note, I am not a programmer and so really have no
idea what I am doing)
IXMLDOMDocument2 domXML =
(IXMLDOMDocument2)thisXDocument.GetDOM("STM Questions");
domXML.setProperty("SelectionNamespaces",
"xmlns:dfs=\"http://schemas.microsoft.com/office/infopath/2003/dataFormSolution\"");
IXMLDOMNodeList tblQuestions =
(IXMLDOMNodeList)domXML.selectNodes("dfs:myFields/dfs:dataFields/dfs:STM_Questions");
IXMLDOMNodeList tblFormQuestions =
thisXDocument.DOM.selectNodes("/my:formFields/my:Questions");
IXMLDOMNode lstFormQuestion =
thisXDocument.DOM.selectSingleNode("/my:formFields/my:Questions/my:Question");
for (int i = 0; i < tblQuestions.length; i++)
{
IXMLDOMNode strQuestion =
domXML.selectSingleNode("dfs:myFields/dfs:dataFields/dfs:STM_Questions/@Title");
thisXDocument.UI.Alert(strQuestion.text);
lstFormQuestion.text = strQuestion.text;
IXMLDOMNode templstFormQuestion =
lstFormQuestion.cloneNode(true);
templstFormQuestion.appendChild(lstFormQuestion);
lstFormQuestion.appendChild(templstFormQuestion);
}
Any help is appreciated.
table in InfoPath 2003. I have found articles all over the web that specify
how to do this very easily in IP2007 using XPathNavigator, however I have
been unable to achieve the same thing in 2003 compatability.
(unfortunately my company is somewhat backwards, they will not upgrade to
2007 for some time yet).
This is using c#
What I have so far (please note, I am not a programmer and so really have no
idea what I am doing)
IXMLDOMDocument2 domXML =
(IXMLDOMDocument2)thisXDocument.GetDOM("STM Questions");
domXML.setProperty("SelectionNamespaces",
"xmlns:dfs=\"http://schemas.microsoft.com/office/infopath/2003/dataFormSolution\"");
IXMLDOMNodeList tblQuestions =
(IXMLDOMNodeList)domXML.selectNodes("dfs:myFields/dfs:dataFields/dfs:STM_Questions");
IXMLDOMNodeList tblFormQuestions =
thisXDocument.DOM.selectNodes("/my:formFields/my:Questions");
IXMLDOMNode lstFormQuestion =
thisXDocument.DOM.selectSingleNode("/my:formFields/my:Questions/my:Question");
for (int i = 0; i < tblQuestions.length; i++)
{
IXMLDOMNode strQuestion =
domXML.selectSingleNode("dfs:myFields/dfs:dataFields/dfs:STM_Questions/@Title");
thisXDocument.UI.Alert(strQuestion.text);
lstFormQuestion.text = strQuestion.text;
IXMLDOMNode templstFormQuestion =
lstFormQuestion.cloneNode(true);
templstFormQuestion.appendChild(lstFormQuestion);
lstFormQuestion.appendChild(templstFormQuestion);
}
Any help is appreciated.