Usage and examples of common functions of Java report Tools Finereport

Source: Internet
Author: User
Tags eval lowercase rowcount

In this paper, TableName or viewname are used as parameter factors. Functions are called in the order in which they are looked up from the private data source before they are looked up from the public data source.

CLASS

Class (object): Returns the class to which the object belongs.


Cnmoney

Cnmoney (Number,unit) returns capital in renminbi.

Number: Numbers of numeric types that need to be converted.

Unit: Units, "S", "B", "Q", "W", "SW", "BW", "QW", "Y", "sy", "by", "QY", "WY" respectively represents "pick up", "Bai", "Thousand", "Million", "Collect million", "Hundred Million", "Thousand Million", "billion", "pick billion", "Hundred billion" , "Thousand billion", "trillion".

Note:

The unit can be empty, if it is empty, convert number directly to renminbi, or the number is multiplied with the unit, and then the result of the multiplication is converted to renminbi capitalization.

Example:

Cnmoney (1200) is equal to one thousand hundred round whole.

Cnmoney (12.5, "w") equals to the rounding of the Thousand thousand Wu.

Cnmoney (56.3478, "bw") equals million, Thousand thousand Ba Bai round.

Cnmoney (3.4567, "Y") equals three billion, Wu Bai Lu qi million round the whole.


COL

COL () Returns the column number of the current cell.

Example:

If the current cell is A5, writing "=col ()" In A5 returns 1.

If the current cell is C6, writing "=col ()" In C6 returns 3.


ColCount

ColCount (Tabledata): Returns the number of columns in Tabledata.

Tabledata:tabledata's name, in string form.

Note:

Look in the private data source first, then from the public data source, and return the number of columns in the first found Tabledata.

Example:

Take the data source we provide Frdemo as an example

ColCount ("Check") equals 6.

ColCount ("Country") equals 5.


ColName

ColName (Tabledata,colindex) returns the column name colindex the column ordinal in Tabledata.

Tabledata: Represents the Tabledata name, a string form.

Colindex: Represents the column ordinal.

Note:

Tabledata first find from the private data source and then from the public data source.

Example:

ColName ("Check", 3) equals Accename.

ColName ("Country", 4) equals area.


Eval

EVAL (exp): Returns the result of an expression exp calculation.

Exp: An expression in the form of a string.

Note:

As long as the parameter exp in Eval can eventually be converted into a string in the form of an expression, such as "sum (2,4)", "2+7", and so on, then it can be computed.

Example:

EVAL ("2+5") equals 7.

EVAL ("Count (2,3)") equals 2.

EVAL ("Sum" + "(2,3,5)") equals 10.

EVAL (IF (True, "sum", "count") + "(1,2,3,4)") equals 10.

EVAL (IF (False, "sum", "count") + "(1,2,3,4)") equals 4.


FIELDS

FIELDS (Connectionname,tablename): Returns all the field names in this table tablename.

Example:

The contents of a table named task in database base are as follows:

Namestart End

A2008 2009

B2009 2012

Then fields ("BASE", "task") equals [Name,start,end].


FORMAT

Format (Object,format): Returns the Format form of object.

Object: You need to format objects, string, number, object (commonly used with date, time).

Format: the formatted style.

Note:

The format in this case must be in strict accordance with the rules in the example above, month: uppercase mm, Year lowercase: yyyy or yy, days: lowercase dd.

The format used here as a parameter factor can be referred to as "" or "".

Example:

Format (Today (), ' yyyy-mm-dd ') results are 2008-11-01


Inmap

Inmap (Key,value, mapname): Determines whether the data dictionary mapname contains key values and values of the data pairs. The return value is a Boolean. There is return true, no return false.

Key: Key detected.

Value: The value of the detection.

Mapname: The name of the specified data dictionary.

Note:

The mapname must be of type string.

Example:

Inmap (1,2, "Customerdic") returns Boolean.true (Boolean).


ISNULL

ISNULL (object): Determines whether all the values in an object are all primitive.null.


MAP

MAP (Key,mapname): Returns the value corresponding to the key in the data dictionary whose name is mapname.

Key: Key in the data dictionary corresponding to the return value.

Mapname: The name of the specified data dictionary, note that the data dictionary name should be quoted

Example:

MAP (1, "CustomerName") equals "Yixing Hongdafood Co."


RECORDS

RECORDS (Connection,table,field): Returns all the elements under Field name fields in the database tables table.

Example:

The contents of a table named task in database base are as follows:

Namestart End

A2008 2009

B2009 2012

Then records ("BASE", "task", "End") equals [2009,2012].

RECORDS (Connection,table,field,row) returns the record of row rows under the Field field in the table, which can either be column names or column numbers.

RECORDS ("BASE", "task", "End", 2) equals 2012.

RECORDS ("BASE", "task", 2,2) equals 2009.


REVERSE

REVERSE (value): Returns the logical value contrary to value.

Example:

REVERSE (true) is equal to false.


ROW

Row () Returns the row number of the current cell

Example:

If the current cell is A5, writing "=row ()" In A5 returns 5.

If the current cell is B8, writing "=row ()" in B8 returns 8.


RowCount

ROWCOUNT (Tabledata) returns the number of rows Tabledata.

Tabledata:tabledata's name, in string form.

Note:

Look in the private data source and then from the public data source, returning the number of tabledata rows.

Example:

Take the data source we provide Frdemo as an example

RowCount ("Check") equals 3.

RowCount ("Country") equals 18.


Tabledatafields

Tabledatafields (Tabledata): Returns all the field names in Tabledata.

Note:

Look in the report dataset and then from the server dataset, returning an array of tabledata column names.

Example:

Tabledatafields ("Country") equals [name, capital, continent, area, population


Tabledates

Tabledatas (): Returns the name of the report dataset and the server data set. ]

Example:

The server DataSet has: DS1,DS2,DS3, and the report data set has DSR1,DSR2.

Tabledatas () equals [DSR1,DSR2,DS1,DS2,DS3].

Tabledatas (0) returns the name of the server dataset, Tabledatas (1) Returns the name of the report dataset;

Tabledatas (0) equals [DS1,DS2,DS3]; Tabledatas (1) equals [DSR1,DSR2].


TABLES

Tableas (ConnectionName): Returns all the table names in the database named ConnectionName.

Example:

Suppose that in Frdemo this database, there are 3 tables: a,b,c;

Then tables ("Frdemo") equals [A,b,c].


VALUE

Value (Tabledata,row,col) returns the Tabledata row number row and the column number Col.

Tabledata:tabledata's name, in string form.

Row: line number.

Col: column number.

Note:

Find from a private data source and then look up from a public data source, returning a tabledata value.

Example:

VALUE ("Country", 5, 3) equals South America.

VALUE ("Simple", 8, 3) equals Jonnason.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.