How to use
The default implementation creates a CSV output. Exporting the table is simple:
TableExporter exporter = new TableExporter(tableViewer); exporter.print(outputStream); // exporter.toString() // serializes into a StringThe export uses sorting, filtering and column ordering so your output matches to what you see on the screen.
Other output formats
If you are interested in other output formats, have a look at HTMLTableExporter, which renders the same data into an HTML table. You can easily extend the base class to adapt the output format to your own needs.
Examples
rendered as CSV text:
First,Last,City Obi-Wan,Kenobi,Tatooine Leia,Organa,Alderaan Luke,Skywalker,Tatooine Han,Solo,Corellia
...or as HTML table
First | Last | City |
---|---|---|
Obi-Wan | Kenobi | Tatooine |
Leia | Organa | Alderaan |
Luke | Skywalker | Tatooine |
Han | Solo | Corellia |
No comments:
Post a Comment