문제

I am looking at the ColumnGridReport example for DynamicReports.

I would like to use the classic code syntax instead of the DSL used in the example, meaning creating

JasperReportBuilder report = DynamicReports.report();

and using report.addColumn(...) and so on, but I can't figure out how to do that for the "columnGrid" part:

          report
          .columnGrid(   
            grid.verticalColumnGridList(   
                itemColumn,   
                grid.horizontalColumnGridList(quantityColumn,   unitPriceColumn)),   
            grid.verticalColumnGridList(   
                orderDateColumn,   
                grid.horizontalColumnGridList(orderDateFColumn, orderYearColumn),   
                grid.horizontalColumnGridList(orderMonthColumn, orderDayColumn)));

There is a variable grid ... where is that even initialized?

Basically I would like to do report.columnGrid(how to initialize the inside part).

How can I transform this to the classic syntax?

도움이 되었습니까?

해결책

There's one static import in the file:

import static net.sf.dynamicreports.report.builder.DynamicReports.*;  

As you can see in this Javadoc documentation, grid is a static field in DynamicReports.

다른 팁

You can import "grid" like this

import static net.sf.dynamicreports.report.builder.DynamicReports.grid;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top