Java Report Tool parameter hardening

Source: Internet
Author: User
Parameter hardening usually refers to defining a dataset SQL statement such as SELECT * from [TableName] where [colname] = ${para}, where the contents of ${} are variables and the report tool will ${} After the content is computed, the resulting string is stitched into SQL to form the final executable query statement, which is sent to the database side for execution. ${} You can use the functions in the report to manipulate the parameters, which is the hardening of the parameters. When users use the Java reporting tools to deploy, often need to use the parameter hardening, the following Finereport report tool as an example, a simple description of the parameters and date parameters of the format processing. There are many kinds of representations of dates, and sometimes the form that we are accustomed to filling out may be different from the form of database storage, when the report is downloaded, it needs to be formatted with the date. For example, the Java reporting software, the "2010-02-24" form of the date into the form of "20100224". 1. Create a new report 2. Define a DataSet definition database query, the SQL statement is: SELECT * from sales_basic WHERE date = ' ${format (date, Report company, "YyyyMMdd")} ' parameter date is dated as 2010-02-24, on that day The period is formatted as YYYYMMDD and assigned to the date as the final value. 3. The template design is as follows Design report 4. Define parameter Interface Click parameter design, use default parameter interface, define date control, return value set to date, such as 5. Save template Save template, click the designer Page Preview, select the date, query data as follows

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.