public interface AQHtmlWriter extends AQDataWriter
Example:
var d = aqua.data.newDataSet( [ 'column1','column2','column3' ] ); d.addRowWithValues("a","b","<html>"); d.addRowWithValues("1","2","3"); var w = aqua.io.newHtmlWriter(); w.setTitle("Example"); w.setTableStyle("width:50%;"); w.setRowStyle("background-color:#808080;"); w.write("Table"); w.write(d); print(w.toHtml()); w.saveToFile('c:/test.html','utf-8');
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this writer and releases any system resources associated with it.
|
void |
saveToFile(String filename)
Save the generated HTML to a file using UTF-8 encoding.
|
void |
saveToFile(String filename,
String encoding)
Save the generated HTML to a file using the specified encoding.
|
void |
setCellStyle(String style)
Sets the style of subsequent table cells (<TD> elements).
|
void |
setEmbeddedStyleSheet(String styleSheet)
Sets embedded style sheet.
|
void |
setRowStyle(String style)
Sets the style of subsequent table rows (<TR> elements).
|
void |
setTableStyle(String style)
Sets the style of subsequent <TABLE> element.
|
void |
setTitle(String title)
Sets document <TITLE> tag.
|
String |
toHtml()
Returns generated HTML.
|
void |
writeLink(String text,
String url)
Writes a hyperlink (<A HREF> element).
|
void |
writeText(String text)
Writes arbitrary text.
|
write, write, write, write
void setTitle(String title)
title
- Document title.void setEmbeddedStyleSheet(String styleSheet)
styleSheet
- the style sheetvoid setTableStyle(String style)
style
- the stylevoid setRowStyle(String style)
style
- the stylevoid setCellStyle(String style)
style
- the stylevoid writeText(String text) throws Exception
AQDataWriter.write(Object)
method.text
- Text to be written.Exception
- On errorvoid writeLink(String text, String url) throws Exception
text
- User-visible text.url
- Link URL.Exception
- On errorString toHtml()
void saveToFile(String filename) throws Exception
filename
- the filenameException
- On errorvoid saveToFile(String filename, String encoding) throws Exception
filename
- the filenameencoding
- the encodingException
- On errorvoid close() throws IOException
close
in interface AQDataWriter
close
in interface AutoCloseable
close
in interface Closeable
IOException
- On error
Copyright © 2017 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.