Report bursting is a technique which enables running a page report once and distributing the report results to multiple users who each will receive a subset of the results related only to them. It is useful in handling both large amounts of data as well as a large number of users. JReport can distribute any report result to multiple recipients with each receiving a subset, subject to security rules. Report bursting allows you to burst the report to multiple levels of grouping, for example, you may want to give individual salesmen a report of just their sales, the sales manager a report for all salesmen in his division and a complete report with all the data for all salesmen in the company for the VP Sales.
Bursting report results can be distributed to any destination, including email, FTP, and JReport’s versioning system, among others. Multiple criteria and rules can act simultaneously to perform multiple distributions from a single report run.
Report bursting is only supported in page reports that are created using query resources.
A bursting schema defines how data is split and who receives each subset of the split data. The most important part for a bursting schema is that there should be a recipient query to contain these data fields:
For example, to send salary report to the employees in the company by e-mails and to make each employee see his own salary information only, you can use Employee ID as the bursting key. Then you need to create a recipient query and add at least these two data fields in it:
Bursting key is one or more distinguishing fields according to which report data is split. For example, sending a credit card bill to every consumer according to the credit card ID. The credit card ID here is the bursting key. When multiple fields are used as bursting key, JReport will split the data according to each unique combination of the fields.
Bursting key fields should come from a dataset used in the current page report.
Bursting recipients are data fields that contain recipient information in a query. The following types of recipients are supported:
If JReport finds that there is a file with the same name as the generated bursting result file, it will not send the result file into the path and will record a message into the log.
A page report that can do bursting should contain one or more bursting schemas and is called a bursting report. A bursting report cannot run in Page Report Studio, it only supports exporting to formats that can be viewed by an external viewer such as PDF and Excel.
To create a bursting report:
Make sure the data fields used for the bursting key are sortable in the DBMS, otherwise the bursting results may be unpredictable.
The following data types can be used for a bursting key:
Tip: When you finish designing a bursting report, you may want to check it with data. However, when you preview bursting report in JReport Designer, JReport runs the bursting report with all of the data, and if a large dataset is involved it may take a long time or run out of memory before completing. To avoid this from happening, you can limit the number of records by setting the Maximum Rows property of the query.
Reference: A sample report containing a bursting report tab named Sales Statistics by Region Report.cls is provided in <install_root>\Demo\Reports\SampleReports
.
Two built-in functions are added in formulas for controlling bursting report result.
Note: Formulas referring either of the two functions are not allowed to be used in queries or datasets.
The following example shows the usage of the functions. It is supposed that a report is first grouped by VP, and next by Manager as follows:
Group by VP,
Group by Manager,
detail
To distribute relative results to all VPs and managers, you can define two schemas as follows and apply them together in a task:
Bursting Schema | Bursting Key | Recipient |
---|---|---|
VP | VP | VPs |
Manager | VP, Manager | Managers |
Then write a formula:
if ( isRunBursting() && currentBurstingSchema() != "VP" )
return true
else
return false;
Next use the formula to control the Suppress property of the group headers and group footers in the VP group panel.
Then all results to the managers will hide the VP level.