Я использую приведенный ниже код для отображения свойств столбца в отчете jasper. Но я не могу получить три значения свойств в одном столбце. Есть ли возможность отобразить три свойства, используя «,» в одном столбце.Как добавить несколько столбцов свойств (полей) в ColumnBuilder?
Файл содержит следующий код:
DynamicReportBuilder drb = new DynamicReportBuilder();
drb.setTitle("Transaction List Export")
.setSubtitle("This report was generated at " + new Date())
.setDetailHeight(15) // defines the height for each record of the report
.setPrintColumnNames(true)
.setIgnorePagination(true) // for Excel, we may don't want pagination, just a plain list
.setMargins(30, 20, 0, 15) // define the margin space for each side (top, bottom, left and right)
.setDefaultStyles(titleStyle, subtitleStyle, headerStyle, detailStyle)
.setColumnsPerPage(1, 10)
.setUseFullPageWidth(true) // we tell the report to use the full width of the page. this resizes
// the columns width proportionally to meat the page width.
.setAllowDetailSplit(false)
.setReportName("Client List");
AbstractColumn columnClientLocation = ColumnBuilder.getNew()
.setColumnProperty("ClientAddress", String.class.getName()+Constants.COMMA)
.setColumnProperty("ClientCity",String.class.getName()+Constants.COMMA)
setColumnProperty("ClientPostalCode",String.class.getName())
.setTitle(messages.getMessage(locale, "group.terminalinfo"))
.setWidth(80)
.build();
width = width + 80;
/**
* We add the columns to the report (through the builder) in the
* order we want them to appear
*/
if(myContainer.getServiceProvider().equalsIgnoreCase("GOOG")) {
drb.addColumn(columnTransactionActivity)
.addColumn(columnClientLocation);
}
Я не могу получить значения ClientAddress
, ClientCity
и ClientPostalCode
в одном столбце отчета яшмы.
Я хотел бы отобразить все эти три свойства в одном столбце.