Problems encountered in the development of Ireport reports

Problems encountered in iReport report development:

1. T in the toolbar of the report
: will not become text
F: text field passed from the program

2. Preview the report on the web page and nothing is displayed.
Solution:
Edit->Report Properties->More...->In "If there is no data: select All sections, no detail in the drop-down menu behind"
If there is no data: behind The meaning of several options in the drop-down menu are:
No pages [when there is no data in Detail]
Blank page [when there is no data in Detail] A blank page appears]
All sections, no detail [when there is no data in Detail] The data will show things other than detail]
No-date section [] I don't know for the time being, huh, huh.

3. There is always a blank space between Detail and columnFooter
Solution: From iReprot Toolbar Settings [Preview] -> [Report Properties]
, open [More...] -> [Floating column footer] If you check the columnFooter, it will be in the same position as Detail. together.

4. The display format of the content of the
Detail loop in the report The display format of the content of the Detail loop in the report is related to the size of the report properties -> Page Margin -> lower border

For example, there are two columns in the detail. When the first column is filled with data [according to the detail page size] , the
data will be automatically filled into the second column [the detail page size can determine when the first column can be filled with data]

When multiple pieces of data are filled in Detail, they are filled according to the size reserved for the displayed data on the page. When
controlling how many rows of data are displayed, the judgment is made strictly according to how many pieces of data can be displayed on the page
. The controls displayed according to the conditions still occupy when they are not displayed. page location.

5. Common tab in the text box:
Print when expression property is of Boolean type, indicating whether the field is displayed or not. The content is generally:
new Boolean (the result is an expression of boolbean type)


6. The font selection of the Font tab in the text box is a complete set to display correctly:
[1] Font Name: select Song
Dynasty PDF Font Name: select STSong-Light
Last PDF Encoding: select UniGB-UCS2-H (Chinese Simplified)
[2] Refer to external Fonts such as official script
Put the font file in the fonts folder of the iReport installation directory, such as official script [D:\iReport-3.0.0\fonts\SIMLI.TTF]
Font Name: select official script
PDF Font Name: select external font file official script (SIMLI .TTF)
Last PDF Encoding: select Identity-H (Unicode with horizontal writing) [select it for external files]

7. The Text Field tab in the dynamic text box:
there is a [checkbox Blank when null] in the middle, indicating whether to display null when the content of this text box is empty.
It will be better to display blank when the hook is represented as null, and it will be better to display null if it is not hooked.

8. $V{PAGE_COUNT} indicates the current record of this page [used in the detail loop related area]
$V{PAGE_NUMBER} indicates the current page
$V{COLUMN_NUMBER} indicates how many fields in the detail

9. The number of fields, that is, the number of columns, is set in the tool Edit->Report Properties->Number of Fields.
The number of fields divides the detail into these corresponding columns. When the first column on a page cannot be displayed, it will automatically jump to the second column of this page and so on.

10. Data conversion type in the report:
$V{PAGE_COUNT}.intValue() The V property in the report is converted to int
Integer.valueOf($P{pageCount}).intValue() The P property in the report is converted to int
Double.valueOf($F{ realSum}) The F type in the report is converted to Double
($V{realSums}.doublue()+$V{realSumMs}.doublue()) The double type is added and summed
Boolean.valueOf(((List)$F{mentalState} ).contains("02")) converts boolean value to Boolbean

11。 报表中数据的操作:
文字框中的加法操作时:加号左右必须是数值类型如不是,加号就变成连接作用,而不是做加法操作了。
(($V{realSums}!=null?$V{realSums}:Double.valueOf(0)).doublue()
 +
 ($V{realSumMs}!=null?$V{realSumMs}:Double.valueOf(0)).doublue())+" 元"

12。 报表中用到的一些方法:
contains()方法:((List)$F{mentalState}).contains("02") 从List类型的mentalState中查找 02 返回boolean值
equals()方法:用于两个String类型之间的比较
valueOf()方法括弧中间方的值只能是String类型的,不然编译会报错

13。 报表区域结构说明:
title 报表头[只在第一页的最上面显示]
pageHeader 页头[每一页都会显示]
columnHearder [和columnFooter作用差不多,columnHearder在detail之前显示]
detail [需要循环显示的东西在此处写]
columnFooter [展示在循环显示的下面]具有循环的$V{PAGE_COUNT}当前记录
pageFooter 报表尾[最后一页的最下方显示]
summary [此处用于做统计,显示的话用处不大]

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326701404&siteId=291194637