Class ReportDocument

java.lang.Object
io.leandev.appfuse.report.ReportDocument

public final class ReportDocument extends Object

與 renderer 無關的報表文件:資料已套入、尚未分頁

不可變,只能經 builder() 建立;ReportDocument.Builder.build() 會執行建構時驗證,任何 ERROR 都丟出 ReportValidationException。延遲開啟的列來源由 renderer 在讀取時逐列驗證。

ReportDocument doc = ReportDocument.builder()
        .metadata(m -> m.title("銷售明細").createdAt(clock.instant()))
        .page(PageSetup.of(Paper.A4))
        .footer(f -> f.right(Text.of("第 "), new PageNumber(), Text.of(" 頁/共 "), new PageCount(), Text.of(" 頁")))
        .heading(1, "銷售明細")
        .paragraph("資料範圍:2026-01-01 至 2026-03-31")
        .table(t -> t.column("orderNo", "訂單編號", 2).column("amount", "金額", 1, Align.RIGHT)
                .rows(RowSource.lazy(() -> repository.streamRows(query))))
        .build();
Since:
4.0.0