tags:

views:

123

answers:

3

Hello Friends,

I need a reporting framework that would allow me to create reports with dynamic structure.

Unlike Jasper Reports working mode in which you create a template for how your report will look like, I need exactly the opposite: I need a framework that will allow me to create reports with varying structure (Programmatic). The report is a table showing by which factors some result was calculated. The number of factors can vary, thus the number of columns in the table varies accordingly.

I would please like to know what reporting library can be used in the above described working mode.

Thank you for your time, Maxim.

+1  A: 

DynamicJasper may help you, here is an example extracted from tutorial:

        FastReportBuilder drb = new FastReportBuilder();
    DynamicReport dr = drb.addColumn("State", "state", String.class.getName(),30)
                    .addColumn("Branch", "branch", String.class.getName(),30)
                    .addGroups(2)
                    .setTitle("November 2006 sales report")
                    .setSubtitle("This report was generated at " + new Date())
                    .setPrintBackgroundOnOddRows(true)                      
                    .setUseFullPageWidth(true)
            .build();       

    JRDataSource ds = new JRBeanCollectionDataSource(TestRepositoryProducts.getDummyCollection());   
    JasperPrint jp = DynamicJasperHelper.generateJasperPrint(dr, new ClassicLayoutManager(), ds);
    JasperViewer.viewReport(jp);    //finally display the report report
Benoit Guerout
This is actually a correct answer, yet I find BIRT to be an order of magnitude better then Jasper Reports.
Maxim Veksler
A: 

BIRT Design Engine API was the tool I was looking for.

Maxim Veksler
A: 

Docmosis is a reporting engine that uses templates, but you can conditionally drop columns, choose different tables, or include different sub-templates. Depending on HOW variable your layouts are it might be better to control it via a template than code.

jowierun