问题描述
当我将主 report.jasper 添加到jasperstudio 6.2.2中的报告书籍内容时,页面配置对话框将打开并要求建立连接。我选择第一个使用相同的JDBC ... 。
When I add my main report.jasper to report books content in jasperstudio 6.2.2, the page configuration dialog opens and asks for a connection. I choose the first one which is Use same JDBC ....
现在,当我在此步骤中单击预览时,我得到文档为空消息。如果我为包含主报表的 wave_Book.jrxml
编写查询,然后单击预览中的运行,它可以工作但是会添加来自此查询的数据字段从主报告查询,因此我将获得冗余数据。
Now when I click preview at this step I get Document is Empty message. If I write a query for wave_Book.jrxml
, which contains the main report, and then click run in preview, it works but the data fields which are from this query will be added to those from main report query and hence I will get redundant data.
我没有JasperReports服务器。是否有必要生成一份报告书?我认为报告书采用了填充数据的编译报告,并添加了内容表,封面和封底。我按照第19章的jasper书中的步骤进行了操作。我在这里缺少什么?
I do not have a a JasperReports server. Is it necessary to have one for generating the report book? I thought the report books takes the compiled report which is filled with data and adds table of content, cover and back cover to it. I went the steps according to the jasper book at chapter 19. What am i missing here?
我已经问了一个关于冗余数据的问题,但那时我想问题是因为我的JDBC驱动程序或连接。您可以在此处查看源代码:
I had already asked a question about redundant data, but at that time I thought the problem is because of my JDBC driver or connection. You can see the source code here: Duplicate data in jasper
推荐答案
背景
Wave Book
是一种更灵活的方式,可以将一些其他报告添加到一个包含目录和其他津贴的报告中。
The Wave Book
is a more flexible way of adding several other reports into one report with a Table of Contents and other perks.
您可以想象通常的结构。每个 Wave Book
子部分都是一个报告。
You can imagine the usual structure like this. Each Wave Book
sub-part is a report.
Wave Book
\---- Wave Book Cover (1 page)
\---- Wave Book ToC (1 - n pages)
\---- Wave Book Chapter One (1 - n pages)
\---- Wave Book Chapter Two (1 - n pages)
\---- Wave Book Backcover (1 page)
在根 Wave Book
中,您可以建立数据库连接。此外,如果提供参数, Wave Book
root将获取它们。
In the root Wave Book
you can establish a database connection. Also, if parameters are provided, the Wave Book
root gets them.
现在您可以在 Wave Book
root以选择特定数据。例如。将客户名称获取为参数 CustomerID
。现在, Wave Book第一章
和 Wave Book第二章
将得到相同的 $ P { REPORT_CONNECTION}
但会使用他们自己的数据源
,这意味着他们自己的 SELECT
。
Now you can provide a query in the Wave Book
root to select specific data. E.g. get the customer name to a parameter CustomerID
. Now, Wave Book Chapter One
and Wave Book Chapter Two
will get the same $P{REPORT_CONNECTION}
but will use their own Data Source
, meaning their own SELECT
.
因此可以将 CustomerID
提供给 Wave Book Chapter One
和 Wave Book第二章
和相同的报告连接
。所述报告现在可以使用参数 CustomerID
来实现自己的 SELECT
。
So it is possible to provide the CustomerID
to Wave Book Chapter One
and Wave Book Chapter Two
and the same Report connection
. Said reports can now fulfil their own SELECT
with the parameter CustomerID
.
结论
所以不,报告不以前填充了数据。数据始终为 SELECT
ed(或您使用的任何其他数据源)并在报告中使用。 Wave Book
添加的唯一内容是可以相对轻松地添加封面
, ToC
和 Backcover
到报告中。
So no, the reports are not previously filled with data. The data will always be SELECT
ed (or whatever other datasource you use) and used in the report. The only thing the Wave Book
adds is the possibility to add relatively easy a Cover
, ToC
and a Backcover
to the report.
含义:每个子报告( Wave Book Chapter One
例如)应该可以在其上运行拥有(假设您使用相同的数据源)。如果运行 Wave Book
root,则技术上与直接调用子报表不同。只有你不需要运行,例如手动6个子报告并将它们一起添加。 Wave Book
将执行此操作。
Meaning: Each and every "subreport" (Wave Book Chapter One
e.g.) should be able to run on its own (provided you use the same data source). If the Wave Book
root is run, nothing technically will be different from calling the subreport directly. Only that you don't need to run e.g. 6 subreports manually and add them together. The Wave Book
will do this.
这篇关于将报告添加到报告书后,数据会多余的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!