Class ReportDocument
java.lang.Object
io.leandev.appfuse.report.ReportDocument
與 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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classReportDocument建構器;不可重複使用於多份文件以外的用途,但ReportDocument.Builder.build()可呼叫多次static final classSection建構器;摘要的線、間距及文字預設沿用文件 PageSummary。static final classTable建構器 -
Method Summary
-
Method Details
-
builder
- Returns:
- 建構器,預設 A4、20mm 邊界、
DocumentStyles.standard()
-
metadata
- Returns:
- metadata
-
page
- Returns:
- 頁面設定
-
header
- Returns:
- 頁首
-
pageSummary
- Returns:
- 隨內容排列的每頁摘要
-
styles
- Returns:
- 文件樣式
-
body
-