开发者

Where does this grid variable come from?

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.verticalColumnGr开发者_开发百科idList(   
                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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜