Report output in text


I have a question which i think is very simple, but i can’t seem to find the answer for. Please help.
I have a report which output is in .docx format. Now i want the output of that same report in .txt format. The solution seems so far for.

Can anyone please help?



There is no ability to set output report format for .txt, check Output format compliance matrix

This is an example of the output i want to generate, so i can be opened with notepad.
${account.accoutnumber}/${account.amount} Salary for ${account. month} ${account.year}/${account.voornaam} ${account.familienaam}

There is a CSV output format, it is very similar to TXT and can be opened by both Notepad and spreadsheet programs.

If you need custom format, you could generate the document without using reporting module.

Thanks Alexander i will look into that.

I’ve been looking for a solution, but still no luck. Is there an example i can use?


To create a TXT content, use StringBuilder class from the Java standard library.
To download a file, inject ExportDisplay class to the screen controller.


    private CollectionContainer<Deck> decksDc;
    private ExportDisplay exportDisplay;

    public void onDecksTableExportText(Action.ActionPerformedEvent event) {
        List<Deck> decks = decksDc.getItems();
        StringBuilder text = new StringBuilder();
        for (Deck deck: decks) {
        } ExportDataProvider() {
            public InputStream provide() {
                return new ByteArrayInputStream(text.toString().getBytes(StandardCharsets.UTF_8));
        }, "report.txt");

Resulting file:

Many thanks Alexander.