天天看點

pentaho report designer 系列之子報表(subreport)-inline模式

pentaho report designer 系列之子報表(subreport)-inline模式

本文介紹子報表(subreport) 的參數inline.

inline的英文意思是行内,内聯,内聯元素. 表明了這個參數是在行内放置的. 這個可以用來實作行内資料的擴充. 如下圖的樣式.

pentaho report designer 系列之子報表(subreport)-inline模式

下面以銷售訂單統計為例說明訂單的資料内聯

首先建立一個正常的訂單報表.

pentaho report designer 系列之子報表(subreport)-inline模式

點選子報表按鈕, 彈出子報表選擇窗體. 選擇inline參數.

pentaho report designer 系列之子報表(subreport)-inline模式

進入子報表,建立資料連接配接,編輯SQL語句,設定變量名${order_code}.

pentaho report designer 系列之子報表(subreport)-inline模式

如何從主報表接收這個參數呢? 需要設定參數. 點選Parameters. 在Import Parameter欄的outer Name選擇order_code字段, 對應的在Inner Name中也選擇order_code. 這樣就可以傳參了.

pentaho report designer 系列之子報表(subreport)-inline模式

在子報表的設計界面放置好相應的内聯字段. 比如産品名稱,價格,數量…

pentaho report designer 系列之子報表(subreport)-inline模式