You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by ramilani12 <ra...@gmail.com> on 2008/04/24 19:58:12 UTC
Wrap Text From HTML
Hello Folks
How POI understand this scapes: \r\n when I put in cell?.
Because I have one TextArea in my page JSP, if user pressed key ENTER in
textarea , textarea put this scapes \r\n
For example :
Value TextArea:
Abcbbcbcbcccbb\r\n <- pressed key ENTER
Ahsajdhasjdhasj\r\n <- pressed key ENTER
When I create sheet from POI in my cell will show:
Abcbbcbcbcccbb⌂
Ahsajdhasjdhasj⌂
I think Excel didin´t understand this scapes \r\n.
--
raphael milani
:=]
Re: Wrap Text From HTML
Posted by ramilani12 <ra...@gmail.com>.
Yeap.
I solved this problem:
private String removeEscapes(String str)
{
String aux = StringEscapeUtils.escapeJava((str));
//remove tabs
aux = StringUtils.replace(StringUtils.trimAllWhitespace(aux), "\\t",
" ");
//remove the return, only newline valid in excel
aux = StringUtils.replace(StringUtils.trimAllWhitespace(aux), "\\r",
" ");
//unescape so that \n gets back to newline
aux = StringEscapeUtils.unescapeJava(aux);
return aux;
}
Excel didn´t understand \r\n.
I use StringUtils from: org.springframework.util.StringUtils
On Thu, Apr 24, 2008 at 3:00 PM, <mg...@gmail.com> wrote:
> Just add \n don't have \r
> Sent via BlackBerry by AT&T
>
> -----Original Message-----
> From: ramilani12 <ra...@gmail.com>
>
> Date: Thu, 24 Apr 2008 14:58:12
> To:"POI Users List" <us...@poi.apache.org>
> Subject: Wrap Text From HTML
>
>
> Hello Folks
>
> How POI understand this scapes: \r\n when I put in cell?.
> Because I have one TextArea in my page JSP, if user pressed key ENTER in
> textarea , textarea put this scapes \r\n
>
> For example :
> Value TextArea:
>
> Abcbbcbcbcccbb\r\n <- pressed key ENTER
> Ahsajdhasjdhasj\r\n <- pressed key ENTER
>
> When I create sheet from POI in my cell will show:
>
> Abcbbcbcbcccbb⌂
> Ahsajdhasjdhasj⌂
>
> I think Excel didin´t understand this scapes \r\n.
> --
> raphael milani
> :=]
>
--
raphael milani
:=]
Re: Wrap Text From HTML
Posted by mg...@gmail.com.
Just add \n don't have \r
Sent via BlackBerry by AT&T
-----Original Message-----
From: ramilani12 <ra...@gmail.com>
Date: Thu, 24 Apr 2008 14:58:12
To:"POI Users List" <us...@poi.apache.org>
Subject: Wrap Text From HTML
Hello Folks
How POI understand this scapes: \r\n when I put in cell?.
Because I have one TextArea in my page JSP, if user pressed key ENTER in
textarea , textarea put this scapes \r\n
For example :
Value TextArea:
Abcbbcbcbcccbb\r\n <- pressed key ENTER
Ahsajdhasjdhasj\r\n <- pressed key ENTER
When I create sheet from POI in my cell will show:
Abcbbcbcbcccbb⌂
Ahsajdhasjdhasj⌂
I think Excel didin´t understand this scapes \r\n.
--
raphael milani
:=]