Use Jasper report to calculate opening balance and jasperopening

Source: Internet
Author: User

Use Jasper report to calculate opening balance and jasperopening

Source: http://community.jaspersoft.com/questions/850400/how-create-report-opening-balance-using-jasper-reports.

When calculating the balance at the initial stage based on the access amount, cross-row calculation is required. The Jasper expression can be used, but the steps are complex and difficult. It is easy to use the set calculator to assist Jasper, the following is a simplified example.

Data.csv stores the fund access information for each period of an account. You need to calculate the initial balance based on the file. Some source data is as follows:


Code of the Set calculator:


A1: reads files using commas (,) as the delimiter.

A2: Calculate the initial balance and return the calculation result to the report. The initial value of the account is 43, and the calculation result of the last comma is returned, as follows:


The assembler provides a JDBC interface. The report tool recognizes the assembler as a common database.

The following uses Jasper to design the simplest list table. The template is as follows:


After previewing, you can see the report results:

The method of the report call set calculator is the same as that of the call stored procedure. For example, save this script as balance. dfx, you can use call balance () in the SQL designer of Jasper to call and pass in parameters.




Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.