use of com.axelor.meta.schema.views.GridView in project axelor-open-suite by axelor.
the class ReportBuilderService method createTable.
/**
* Process panelRelated to find right grid view of reference model. Grid view used to create html
* table.
*
* @param panelRelated PanelRelated to use.
* @param refModel Name of model refer by panelRelated.
* @return Html table string created.
*/
private String createTable(PanelRelated panelRelated, String refModel) {
List<AbstractWidget> items = panelRelated.getItems();
if (items != null && !items.isEmpty()) {
return getHtmlTable(panelRelated.getName(), items, refModel);
}
MetaView gridView = findGridView(panelRelated.getGridView(), refModel);
if (gridView != null) {
try {
ObjectViews views = XMLViews.fromXML(gridView.getXml());
GridView grid = (GridView) views.getViews().get(0);
return getHtmlTable(panelRelated.getName(), grid.getItems(), refModel);
} catch (JAXBException e) {
e.printStackTrace();
}
}
return "";
}
Aggregations