Hi Markus,

I never used the ERExcelListPage but when using Apache POI directly you have to 
adapt the cell style to accept line breaks:

Workbook wb = ...;
Sheet sheet = ...;
Row row = ...;
Cell cell = ...;
String value = <string with line breaks>;
CellStyle wrappingStyle = wb.createCellStyle();
wrappingStyle.setWrapText(true);
wrappingStyle.setVerticalAlignment(CellStyle.VERTICAL_TOP);

cell.setCellStyle(wrappingStyle);
cell.setCellValue(value);
row.setHeightInPoints((1 + StringUtils.countMatches(value, "\n") * 
sheet.getDefaultRowHeightInPoints());

Hope that helps.

jw


Am 04.04.2011 um 12:39 schrieb Markus Ruggiero:

> Just a quick question regarding ERExcelListPage: How can I add a line break 
> inside one Excel cell?  I have a toMany relationship where the customer wants 
> the values of a destination key put into one Excel cell as a single multi 
> line value. How can I do this? I already have a simple custom component that 
> puts the values in one cell but I can only add a printable separator (eg "|" 
> or "," or "-" or similar) but not a line break.
> 
> Thanks for any help
> ---markus---



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to