allow user to insert a row or reapeating section in secondary Data source

V

virgul

Hi,

I need to allow user to insert a row in a table but this table is in
the secondary data source, infopath say that is impossible.

But are there any way to do that with C# or in Jscript?

Or there is a possibility to copy to secondary data source in the
primary (I have found a Jscript code but I'm interested by a C# managed
code)? I have try to translate him in c# but I have a problem
Any help is appreciate
Thanks in advance
++

Thierry
 
V

virgul

Sorry I have press post by error

I have try to translate him in c# but I have a problem how to define a
variable type compatible with IXMLDOMNode In the jscript code they use
"var" but in C# what can I use?
This is on th onload events
My C# code:
XslTransform xslt = new XslTransform();

//Load the stylesheet.
xslt.Load("XSLTFile");

//Create a new XPathDocument and load the XML data to be transformed.
XPathDocument mydata = new XPathDocument("XMLFile");

XmlResolver ter = null;
//Transform the data and send the output to the console.
XmlReader reader = xslt.Transform(mydata, null, ter);

IXMLDOMNode oBookstore =
thisXDocument.DOM.selectSingleNode("/my:myAV");
IXMLDOMNode oBook_dest = oBookstore.selectSingleNode("my:myTIT");
IXMLDOMNode oBook_src = reader; //When I do that VS say that
impossible to convert
oBookstore.replaceChild(oBook_src, oBook_dest);

and the original in jscript is:
//Update the data in the secondary data source, and then
//get a reference to the DOM of the secondary data source.
XDocument.DataObjects.Item("XMLFile").Query();
var XMLFileDOM = XDocument.GetDOM("XMLFile");

//Get the transform that is stored as a secondary data source.
var XSLTFileDOM = XDocument.GetDOM("XSLTFile");

//Transform XMLFile by using the style sheet that is named XSLTFile.
var TransformedDOM = new ActiveXObject("MSXML2.DomDocument.5.0");
TransformedDOM.async = false;
TransformedDOM.validateOnParse = true;
TransformedDOM.loadXML( XMLFileDOM.transformNode(XSLTFileDOM));

//Get a reference to the node in the primary document where you want to
insert
//the secondary data.
var oBookstore = XDocument.DOM.selectSingleNode( "/my:myBookstore" );
var oBooks_Dest = oBookstore.selectSingleNode("my:myBooks");
var oBooks_Src = TransformedDOM.documentElement;

//Replace the node in the primary document with the data from the
//secondary data source.
oBookstore.replaceChild( oBooks_Src, oBooks_Dest );
So if anybody has an idea ?


Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top