Jasper report

 

Author:

js

Module:

<Finrpt>

Summary:

Jasper report

Version/Date:

<10.6> / <10-May-2012>

 

Content:

1.    remove the blank line in the report

For e.g. there are 3 boxes and show 3 lines at the generated  report, now the user want remove the blank one,  when the second line is blank, the third one should up.

 

2.    Knowledge content

      We can use one box instant of 3 box, and use the linefeed character(\n) change the new line, but some time the fields type are different, we should convert the field type to String type,

                The expression of convert the Date type to String type:

                                new java.text.SimpleDateFormat("H:m:s").format(new java.util.Date())

                The expression of convent the BigDecimal type to String type:

                                new java.text.DecimalFormat("#,##0.00").format(122.00)

 

 

Attached:

1)      The meaning  of the String which in the SimpleDateFormat as below:

   Letter Date or Time Component Presentation Examples:

G Era designator Text AD

y Year Year 1996 96

M Month in year Month July Jul 07

w Week in year Number 27

W Week in month Number 2

D Day in year Number 189

d Day in month Number 10

F Day of week in month Number 2

E Day in week Text Tuesday Tue

a Am/pm marker Text PM

H Hour in day (0-23) Number 0

k Hour in day (1-24) Number 24

K Hour in am/pm (0-11) Number 0

h Hour in am/pm (1-12) Number 12

m Minute in hour Number 30

s Second in minute Number 55

S Millisecond Number 978

z Time zone General time zone Pacific Standard Time PST GMT-08:00

Z Time zone RFC 822 time zon

 

2)      The Expression of Change the String type to Date or BigDecimal type:

new java.text.SimpleDateFormat("H:m:s").parse(String text)           Parses text from a string to produce a Date.

new java.text.DecimalFormat("#,##0.00").parse(String text)           Parses text from a string to produce a Number.

JasperReport 是一个开源的报表生成工具,它提供了丰富的功能来创建和设计报表。在 JasperReport 中,可以使用分页来控制报表的布局和显示。 要实现分页,首先需要在报表的设计中定义一个分页区域。可以通过在报表模板中添加 Page Header(页眉)、Page Footer(页脚)以及 Detail(详细内容)等部分来定义报表的布局。 在 JasperReport 中,可以使用不同的元素和属性来控制分页行为。以下是一些常用的分页相关元素和属性: 1. Page Break 元素:可以将报表内容分隔到不同的页面上。可以在需要分页的地方添加一个 Page Break 元素,它会将内容分割到下一页。 2. Keep Together 属性:可以设置元素是否保持在同一页上。如果将元素的 Keep Together 属性设置为 true,则 JasperReport 会尽量将该元素保持在同一页上,避免被分割到不同页面。 3. Band Height 属性:可以设置各个 band(区域)的高度。通过适当设置 band 的高度,可以控制每页显示的内容量。 4. Print When Expression:可以使用 Print When Expression 来根据条件控制元素的显示。通过在元素上设置 Print When Expression,可以根据特定条件来决定元素是否显示在报表中,从而达到控制分页的目的。 通过合理地使用以上元素和属性,可以实现 JasperReport 的分页功能。需要根据具体的报表设计和需求来选择合适的方式来控制分页行为。希望对你有所帮助!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值