Node that opens a HTML report

I have been asked to integrate some code of mine into KNIME so that it can be reused in flows.

This code generates a HTML report on the input data. I would love to be able to browse the generated report from within KNIME, without having to open an external web broswer manually.

Is that possible?

Carlos J. Gil Bellosta
http://www.datanalytics.com

We have a few nodes that open views which display HTML - the statistics node for instance.
Maybe this could serve as an example for your problem?

Michael

Dear Michael,

Thank you for your note. Would it be possible to see how it does it so that I can replicate it? Do you know if the HTML browser the node uses supports CSS?

Best regards,

Carlos J. Gil Bellosta
http://www.datanalytics.com

Hello Carlos,

actually, it’s just a JEditorPane:
JEditorPane mypane = new JEditorPane(“text/html”, “”);
StringBuffer buffer = new StringBuffer();
buffer.append("\n");
buffer.append("\n");
buffer.append("

&nbsp

");

buffer.append("\n");
buffer.append("\n");
buffer.append("");
mypane.setText(buffer.toString());

Hmm the editor screwed up my html tags, but I hope it is clear that the corresponding html-tags should go into the StringBuffer.

Hello,

I tried a different approach. I found an embeddable HTML renderer: check the Cobra HTML layout engine at http://lobobrowser.org/java-browser.jsp.

Now, if I import

import org.lobobrowser.html.gui.;
import org.lobobrowser.html.test.
;

then, in my NodeView class, I can do as follows:

super(nodeModel);
HtmlPanel panel = new HtmlPanel();
super.setComponent( panel );

A final call to

new SimpleHtmlRendererContext( panel, new SimpleUserAgentContext()).navigate(“http://uriofmyreport.com/my_report.html”);

does the trick. I can use relatively complex layouts, CSS, javascript and the like.

What do you think about this?

Carlos J. Gil Bellosta
http://www.datanalytics.com