jasperreport生成pdf_jasperreport 导出excel_jasperreport json(47)

电脑杂谈  发布时间:2017-02-04 10:28:36  来源:网络整理

to will be also stretched.

Evaluating Text Fields

Normally, all the report expressions are evaluated immediately, using the current values of all the

parameters, fields and variables at that particular moment. It is like making a photo of all data, for

every iteration in the data source, during the report filling process.

This means that at any particular time, you won't have access to values that are going to be calculated

later, in the report filling process. It perfectly makes sense, since all the variables are calculated step by

step and reach their final value only when the iteration arrives at the end of the data source range they

cover.

For example, a report variable that calculates the sum of a field for each page will not contain the

expected sum until the end of the page is reached. That's because the sum is calculated step by step,

The JasperReports Ultimate Guide

Page 55

when iterating through the data source records, and at any particular time, the sum will be only partial,

since not all the records of the specified range have been processed.

If this is the case, how to display the page sum of a this field, on the page header, since this value will

be known only when the end of the page is reached. At the beginning of the page, when generating the

page header, our sum variable would contain zero, or its initial value.

Fortunately, JasperReports has a very interesting feature that lets you decide the exact moment you

want the text field expression to be evaluated, avoiding the default behavior which makes this


本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/ruanjian/article-30468-47.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    • 卢象
      卢象

      但怎么就是觉着哪里不太对

    热点图片
    拼命载入中...