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.