JasperReport:详细信息频段的目的 [英] JasperReport: Purpose of the Details Band

查看:94
本文介绍了JasperReport:详细信息频段的目的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为这将成为JasperReports的核心主题,但是我无法在任何地方找到答案。

I figured this would be something that would be fairly-well documented as its a central theme to JasperReports, however I can't find an answer for this anywhere.

细节带的目的/功能/意图是什么?它应该只是报告的核心部分还是核心部分?

What is the purpose/function/intention of a details band? Is it supposed to just be the central or core part of a report?

从另一个问题可以看出,细节之间存在1:1的关系band和JRDatasource提供的记录/ bean。这个启示揭示了一些切线问题:

From another question it was pointed out to me that there is a 1:1 relationship between a details band and a record/bean provided by the JRDatasource. This revelation brings to light a few tangential questions:


  • 可以用Java编程方式添加细节带;如果您指定更多/更少的细节带(以编程方式)而不是JRDataSource返回的记录/ bean会发生什么?

  • 细节带之间的关系是什么,比如内部页面导出的PDF文档? 1个详细信息频段是否转换为1页?

  • 如果您传递 JasperFillManager a null 数据源?是否仍然可以有详细的乐队?

  • It is possible to add detail bands programmatically in Java; what happens if you specify more/less detail bands (programmatically) than there are records/beans returned by your JRDataSource?
  • What is the relationship between a details band, and say, a page inside an exported PDF document? Does 1 details bands translate to 1 page?
  • What happens if you pass the JasperFillManager a null data source? Is it possible to still have detail bands?

我不想一次提出多个问题,但这些都是如此相似相关的,我宁愿一次性完成,也不要因为多个几乎相同的问题而混乱。在此先感谢。

I don't like to ask multiple questions at a time, but these are so similarly-related I'd rather do it all at once than clutter SO with multiple nearly-identical questions. Thanks in advance.

推荐答案

详细信息带确实是报告数据源的每个元素的频段。报告引擎自动遍历数据源,并使用数据源的相应元素将数据插入到详细信息带的模板中。

The details band is indeed the band where each element of the data source is reported. The report engine automatically iterates over the data source and inserts data into the template of the detail band with respective element of the data source.

您当然可以在一个页面上拥有多个元素。根据乐队的属性(允许分割,高度等),分页将由Jasper Reports自动处理,因此引擎将决定每页上打印的元素数量,何时转到以下内容页面等。

You may of course have several elements on a single page. According to the properties of the band (split allowed, height, etc.), the paging will be handled by Jasper Reports automatically, and it's the engine that will thus decide how many elements are printed on each page, when to go to the following page, etc.

如果数据源中没有任何内容,则不会打印详细信息带。其他频段的打印取决于报告的参数。

The details band is not printed if you have nothing in the data source. The printing of the other bands depend on the parameters of the report.

这篇关于JasperReport:详细信息频段的目的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆