The Excel export exports   to the Excel
--------------------------------------------

         Key: DISPL-226
         URL: http://jira.codehaus.org/browse/DISPL-226
     Project: DisplayTag
        Type: Bug
  Components: Export  
    Versions: 1.0    
    Priority: Minor


Problem Statement: If I have to export a table, then export also exports the 
  used within blank columns. 

The common way to represent a blank column value in a table is by using  . 
So this issue seems to be faced by everyone using display tag. The default 
implementation of escapeColumnValue(java.lang.Object value) in 
org.displaytag.export.ExcelView should take care of this case.

To resolve this issue I created a subclass of org.displaytag.export.ExcelView 
and oberride the following method:
protected String escapeColumnValue(java.lang.Object value) 

The class looks like the following:

public class MyExportViewClass extends ExcelView {

    protected String escapeColumnValue(java.lang.Object value) {
            String returnValue = null;
            if(value instanceof String) {
                String strValue = (String)value;
                if(strValue.trim().equalsIgnoreCase(" ")) {
                    returnValue = "";
                } 
                else {
                    returnValue = super.escapeColumnValue(value);
                }
            } else {
                returnValue = super.escapeColumnValue(value);
            }
            return returnValue;
    }
}

All, you need to do now is to associate the qualified name of the class to the 
property : 'export.excel.class' in the displaytag.properties file.
example:
export.excel.class=display.MyExportViewClass

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
displaytag-devel mailing list
displaytag-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-devel

Reply via email to