Loading HTML into Task Pane - InfoPath Dev
in

InfoPath Dev

Loading HTML into Task Pane

Last post 10-08-2007 05:57 AM by Kalyan Gaddam. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 10-03-2007 12:14 PM

    • djay
    • Top 500 Contributor
    • Joined on 06-06-2006
    • Posts 35

    Loading HTML into Task Pane

     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.

  • 10-08-2007 05:57 AM In reply to

    Re: Loading HTML into Task Pane

    Thanks for sharing this

    Kalyan G Reddy
    Infopath MVP 2007 and 2008
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.