Добрый день,
По Вашим проблемам есть задачи в нашей баг трекинговой системе: PL-9238 и PL-9680
В качестве обходного пути, Вы можете унаследовать ExcelAction в вашем экране и заменить ExcelExporter, например:
private void initExcelAction() {
customersDataGrid.addAction(new ExcelAction(customersDataGrid) {
@Override
protected void export(ExcelExporter.ExportMode exportMode) {
// Use custom exporter
ExcelExporter exporter = new CustomExcelExporter();
//noinspection unchecked
DataGrid<Entity> dataGrid = (DataGrid<Entity>) listComponent;
List<Column> columns = dataGrid.getVisibleColumns().stream()
.filter(col -> !col.isCollapsed())
.collect(Collectors.toList());
exporter.exportDataGrid(dataGrid, columns, display, null, fileName, exportMode);
}
});
}
private class CustomExcelExporter extends ExcelExporter {
@SuppressWarnings("unchecked")
@Override
protected void createDataGridRow(DataGrid dataGrid, List<Column> columns, int startColumn, int rowNumber, Object itemId) {
if (startColumn >= columns.size()) {
return;
}
HSSFRow row = sheet.createRow(rowNumber);
Instance instance = dataGrid.getDatasource().getItem(itemId);
int level = 0;
for (int c = startColumn; c < columns.size(); c++) {
HSSFCell cell = row.createCell(c);
DataGrid.Column column = columns.get(c);
Object cellValue;
MetaPropertyPath propertyPath = null;
if (column.getPropertyPath() != null) {
propertyPath = column.getPropertyPath();
cellValue = InstanceUtils.getValueEx(instance, propertyPath.getPath());
if (column.getFormatter() != null) {
cellValue = column.getFormatter().format(cellValue);
}
} else {
// Place logic for generated columns here
}
formatValueCell(cell, cellValue, propertyPath, c, rowNumber, level, null);
}
}
}
С уважением,
Глеб