If the main report dataset uses a connection, such as a JDBC connection, you see the following options:
如果主报表数据集使用诸如JDBC连接之类的连接,则会看到以下选项:
Don't use any connection or Data Source
Select this if you do not want to specify any data for the
dataset run. You can set this if you have set a data adapter via properties view, and want JasperReports
Library to use that adapter. This setting can be used when you want to publish a report with multiple
connections to JasperReports Server.
如果您不想为数据指定任何数据,请选择此选项
数据集运行。 如果您已通过属性视图设置了数据适配器,并且需要JasperReports,则可以设置此设置
使用该适配器的库。 当您要发布包含多个报表的报告时,可以使用此设置
与JasperReports服务器的连接。
Use another connection
Select this and enter a connection expression to use a connection that is different from the connection in the main dataset. You can use this for any connection, such as a JDBC connection or big data connection.
选择此选项,然后输入连接表达式以使用与主数据集中的连接不同的连接。 您可以将其用于任何连接,例如JDBC连接或大数据连接。
Use a JRDatasource expression
Select this and enter a data source expression if you want to use a
data source. Note that, even when the main report uses a data source, such as a CSV file or JSON data
source, you cannot simply reuse the data source from the main report. Instead, you must define a subdataset
and create a dataset run that accesses the data source. This is because, unlike a connection, a data source is
consumed when JasperReports iterates through it to fill the element. This means that when you use the same
data source in two different elements, you must access the data source twice.
选择此选项,然后输入数据源表达式(如果要使用
数据源。 请注意,即使主报表使用数据源,例如CSV文件或JSON数据,
源,您不能简单地重用主报表中的数据源。 相反,您必须定义一个子数据集
并创建访问数据源的数据集运行。 这是因为,与连接不同,数据源是
JasperReports遍历它以填充元素时消耗的。 这意味着当您使用相同的
数据源位于两个不同的元素中,则必须两次访问数据源。
Use same JDBC connection used to fill the master report
If the report uses a connection, such as a
JDBC connection or a Hibernate connection, select this to have the dataset run use the same connection as
the main report. You can optionally enter a different query from the query in the main report.
如果报告使用连接,例如
JDBC连接或Hibernate连接,选择此项以使数据集运行时使用与以下相同的连接
主要报告。 您可以选择输入与主报告中的查询不同的查询。
Use same JDBC connection used to fill the master report
When Use same JDBC connection used to fill the master report is selected, the connection
expression uses the built-in parameter for the report's JDBC connection, $P{REPORT_CONNECTION}.
当用于填充主报告使用相同的JDBC连接选择,连接
表达式对报表的JDBC连接$ P {REPORT_CONNECTION}使用内置参数。
Use an empty Data Source
Select this to fill the dataset using an instance of JREmptyDataSource,
that is, a data source that contains a specified number of records, where the field values are all NULL.
选择此项以使用JREmptyDataSource实例填充数据集,
即,包含指定数量记录的数据源,其中字段值均为NULL。
If the main report uses a data source, the menu and options are slightly different.
- Don't use connection or data source – Select this if you do not want to specify any data for the dataset
run
- Use a Connection expression – Select this to use any connection, such as a connection to a JDBC
database or a big data store.
- Use a DataSource expression – Select this to connect to a non-JDBC data source, for example, a JSON
or XML data source.