2012-12-11 60 views
0

我想知道如何判断在iReport中创建的表的列数。变量COLUMN_COUNT返回行数,但我想知道列数。查找表中的列数

有谁知道该怎么办?

+0

什么是有列号的原因是什么?我有什么重要的原因,有通过命名列字段为数字等它的解决方法... – martinnovoty

回答

1

JasperReports Ultimate Guide的报价:

BUILT-IN REPORT VARIABLES

COLUMN_NUMBER
This variable contains the current column number. For example, on a report with three columns, the possible values are 1, 2, and 3. The variable restarts from 1 and runs up to the defined number of columns for each page in the generated document.

COLUMN_COUNT
This variable contains the number of records that were processed when generating the current column.

PAGE_NUMBER
This variable’s value is its current page number. At the end of the report-filling process, it will contain the total number of pages in the document. It can be used to display both the current page number and the total number of pages using a special feature of JasperReports text field elements, the evaluationTime attribute. You can see this happening in most of the samples. Check the /demo/samples/jasper sample for an example.

REPORT_COUNT
After finishing the iteration through the data source, this report variable contains the total number of records processed.

PAGE_COUNT
This variable contains the number of records that were processed when generating the current page.

GroupName_COUNT
When declaring a report group, the engine automatically creates a count variable that calculates the number of records that make up the current group (that is, the number of records processed between group ruptures). The name of this variable is derived from the name of the group it corresponds to, suffixed with the _COUNT sequence. It can be used like any other report variable, in any report expression, even in the current group expression, as shown in the BreakGroup group of the /demo/samples/jasper sample).