I am trying to display one of my views in the task pane. So I am running the forms XML through the views xsl code like this:
IXMLDOMDocument2 xslIPDoc;
xslIPDoc = (IXMLDOMDocument2)thisXDocument.CreateDOM();
MSXML2.IXSLTemplate TPTmp = new MSXML2.XSLTemplate50Class();
MSXML2.IXMLDOMDocument2 xslDoc = new MSXML2.FreeThreadedDOMDocument50Class();
MSXML2.IXMLDOMDocument2 inputDoc = new MSXML2.FreeThreadedDOMDocument50Class();
xslIPDoc.load("test.xsl");
xslDoc.loadXML(xslIPDoc.xml);
TPTmp.stylesheet = xslDoc;
MSXML2.IXSLProcessor TPProc = TPTmp.createProcessor();
inputDoc.loadXML(thisXDocument.DOM.xml);
TPProc.input = inputDoc;
TPProc.transform();
It would be nice t use the infopath IXSLTemplate object instead of the MSXML2 one. But I can't seem to create a new one to use...
Anyway, after running that I have HTML in TPProc.output that I want to display in th task pane.
Is there any way to load the entire page directly into the TaskPane HTMLDocument?
Or is there a way to write to an InfoPath resource file which I can then redirect the TaskPane to?
The only way I can find to do this is to write the HTML to an external file and point the TaskPane to that, but I don't want to start writing files all over the users hard-drive.
Thanks.
Fixed It--------------------------------------------------
Found what I needed. Added this to the end of above:
string sTemp = (string)TPProc.output;
object[] psa = {sTemp};
((HTMLTaskPane)thisXDocument.View.Window.TaskPanes[0]).HTMLDocument.write(psa);
((HTMLTaskPane)thisXDocument.View.Window.TaskPanes[0]).HTMLDocument.close();
That writes the output HTML directly to the TaskPane HTML document.
Now all I need to do is figure out how to make a new IXSLTemplate in InfoPath so I don't need all that MSXML2 messyness.