Hi
The trouble you have there is that displaytag does not produce "real"
excel files. They are pretty much the same as the csv (comma separated
value) files. If you open the produced xls file with text editor you can
see it yourself. If you compare it with the binary file that Microsoft
Excel makes they look nothing alike (altough the produced files may be
legitimate excel files still... don't know for sure).

So I think that if you want to make real excel files that have the column
type setted and so on, you need to replace the
org.displaytag.export.ExcelView class with implementation that produces
excel files that are more like the files that MS Excel creates. As fas ar
I know.
There may be open source java libraries available in the net that make
this doable. I didn't try to google for them though.

Regards,
Ilari


> Date: Tue, 10 Feb 2009 15:58:45 +0000 (GMT)
> From: [email protected]
> To: [email protected]
> Subject: [displaytag-user] Export to excel and numbers???
>
> Hello,
>  
> I am trying to export my table to excel. The data are exported ok, but excel 
> donÿÿt realize that a column have numbers. The code in my JSP is:
>  
> <display:column media="excel pdf xml" titleKey="myTitle" property="contador"/>
>  
> and the method in the Table Decorator is:
>  
> public Integer getContador()
> {
>       return new Integer(this.getListIndex()+1);
> }
>  
>  
> I have tryed too with a column without decorator like this:
>  
> <display:column sortable="true" media="pdf excel xml "property="contadorInt" 
> total="true" titleKey="myTitle"/>
>  
> but I have the same problema.
>  
> I have tryed with "format" attribute too, but I canÿÿt put a number.
>  
> How could I export to excel a column with numbers? Now this column is a text 
> in the excel exported
>  
> Thanks






-- 

"Friends come and go, but enemies accumulate."

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
displaytag-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to