Вывод HTML отчета на экран

Добрый день!
Есть следующая задача:
Есть экран, где есть только одна кнопка и текстовое поле.
Требуется при нажатии кнопки генерировать строго определенный HTML отчет, а затем результат его работы выводить в текстовое поле.
Реализацию генерации определенного отчета планирую по следующей логике, взятой из другой темы:

private ReportGuiManager reportGuiManager = AppBeans.get(ReportGuiManager.class);

    public void runReport() {
        Map<String, Object> reportParams = new HashMap<>();
        reportParams.put("entities", libraryDepartmentTable.getSelected());

        LoadContext<Report> lContext = new LoadContext<>(Report.class);
        lContext.setQueryString("select r from report$Report r where r.code = 'departments' ");

        Report report = dataService.load(lContext);
        reportGuiManager.printReport(report, reportParams, "DEFAULT", "Report for selected departments");
    }

Теперь нужно как то передать результат вывода в некоторое текстовое поле. В документации нашел информацию по BrowserFrame (https://doc.cuba-platform.com/manual-7.1-ru/gui_BrowserFrame.html), но не очень понятно, как связать результат HTML Отчета с выводом фрейма. Какие есть возможности для реализации?

Здравствуйте @michaelkruglov17,

Для создания отчёта, воспользуйтесь ReportService.

Пример:

screen.xml:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://schemas.haulmont.com/cuba/screen/window.xsd"
        caption="msg://caption"
        messagesPack="com.company.reporttest.web.screens">
    <layout>
        <vbox>
            <button caption="Show report"
                    id="printBtn"/>
            <browserFrame id="browserFrame"
                          height="500px"
                          width="500px"/>
        </vbox>
    </layout>
</window>

Controller:

    @Inject
    private BrowserFrame browserFrame;

    @Inject
    private ReportService reportService;

    @Inject
    private DataService dataService;

    @Subscribe("printBtn")
    public void onPrintBtnClick(Button.ClickEvent event) {
        browserFrame.setSource(StreamResource.class)
                .setStreamSupplier(() -> {
                    LoadContext<Report> lContext = new LoadContext<>(Report.class);
                    lContext.setQueryString("select r from report$Report r where r.code = 'code' ");

                    Report report = dataService.load(lContext);
                    ReportOutputDocument reportOutputDocument = reportService.createReport(report, new HashMap<>());
                    return new ByteArrayInputStream(reportOutputDocument.getContent());
                })
                .setMimeType("text/html");
    }
}

С Уважение,
Никита