天天看点

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模式