Tuesday, March 11, 2014

DynamicReports in java (3) - Concatenating reports

The concatenating function of DynamicReports allow multiple reports to be included into one single document. Each report starts on a new page with its own page dimension.


import java.io.File;
import net.sf.dynamicreports.jasper.builder.export.Exporters;
import static net.sf.dynamicreports.report.builder.DynamicReports.concatenatedReport;
import net.sf.dynamicreports.report.exception.DRException;

public class ConcatenatedReportTest {
    public ConcatenatedReportTest() {
        build();
    }
 
    public void build() {
        try {
            concatenatedReport().setContinuousPageNumbering(true)
                .concatenate(<JasperReportBuilder1>, <JasperReportBuilder2>)
                .toPdf(Exporters.pdfExporter(new File("C:/MyReport.pdf")));
        }catch(DRException e){
            e.printStackTrace();
        }
    }
}

            Previous<      >Next
       
--------------------------------------------------------------------------------------------------------------

                        
If you have ever asked yourself these questions, this is the book for you. What is the meaning of life? Why do people suffer? What is in control of my life? Why is life the way it is? How can I stop suffering and be happy? How can I have a successful life? How can I have a life I like to have? How can I be the person I like to be? How can I be wiser and smarter? How can I have good and harmonious relations with others? Why do people meditate to achieve enlightenment? What is the true meaning of spiritual practice? Why all beings are one? Read the book free here.

References:

1. DynamicReports in Java (1) - Using defined data type and the steps for a basic report
2.DynamicReports in Java (2) - Using adhoc data types
3. DynamicReports in java (4) - Setting/formatting the title
4. DynamicReports in java (5) - subreport and page break
5. Getting started
6. Reporting In Java Using DynamicReports And JasperReports

No comments:

Post a Comment