• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Excel download question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Excel download question


  • Subject: Re: Excel download question
  • From: Johann Werner <email@hidden>
  • Date: Tue, 05 Apr 2011 10:45:34 +0200

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@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Excel download question (From: Markus Ruggiero <email@hidden>)

  • Prev by Date: Re: Concurrent Requests, Number of Instances & Scheduling
  • Next by Date: Re: [SOLVED] Re: Session being created continuously...
  • Previous by thread: Excel download question
  • Next by thread: [MEET] Toronto Cocoaheads / tacow - April 12
  • Index(es):
    • Date
    • Thread