Struts2, Excel exporting problem

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Struts2, Excel exporting problem

sfotechninja
Hello,

I'm trying to use displaytag in a Struts2 environment and am running
into issues while exporting to Excel:
Excel complains about missing .css files, and when I click open the file
anyway, I see text from the jsp in the spreadsheet, but no data.
There is a little cross, where the data should be.

The css files that excel complains about are included in the jsp as such:
<link rel="stylesheet" type="text/css" href="/portal/css/portal.css"/>

web.xml:
    <filter>
        <filter-name>ResponseOverrideFilter</filter-name>
       
<filter-class>org.displaytag.filter.ResponseOverrideFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>ResponseOverrideFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

displaytag.properties:
export.decorated=true
export.excel=true
export.excel.include_header=true
export.excel.filename = SearchResults.xls
export.excel.class=org.displaytag.export.ExcelView
export.csv=false
export.pdf=false
export.xml=false
Changing export.decorated to false, does not make any difference.

What am I doing wrong? Any help really appreciated.

Thanks,
Karan

- When Tomcat starts:
DEBUG [ResponseOverrideFilter] bufferParam=null
INFO  [ResponseOverrideFilter] Filter initialized. Response buffering is
enabled
[ResponseOverrideFilter] Filter has been called, but PARAMETER_EXPORTING
parameter has not been found.

- When the table is displayed in the browser, I see following in the log:
2007-11-02 15:16:47,366 INFO  [ExportViewFactory] Initializing
ExportViewFactory with type={csv,excel,xml,pdf}
2007-11-02 15:16:47,382 DEBUG [ExportViewFactory] ExportView for csv
media added: org.displaytag.export.CsvView
2007-11-02 15:16:47,382 DEBUG [ExportViewFactory] ExportView for excel
media added: org.displaytag.export.ExcelView
2007-11-02 15:16:47,382 DEBUG [ExportViewFactory] ExportView for xml
media added: org.displaytag.export.XmlView
2007-11-02 15:16:47,397 WARN  [ExportViewFactory] Unable to instantiate
class for pdf export. org.displaytag.export.PdfView was found, but
required libraries are missing: com/lowagie/text/Element
2007-11-02 15:16:47,397 DEBUG [TableTag] [row] doStartTag called
2007-11-02 15:16:47,397 INFO  [TableProperties] LocaleResolver
initialized to com.struts2.displaytag.DisplayTagI18nStruts2Adapter.
2007-11-02 15:16:47,413 DEBUG [LookupUtil] getBeanValue - bean: {users}
2007-11-02 15:16:47,475 DEBUG [TableTag] [row] setting media [html] in
this.pageContext
2007-11-02 15:16:47,475 DEBUG [TableTag] [row] doIteration called
2007-11-02 15:16:47,475 DEBUG [TableTag] [row] setting attribute "row"
in pageContext
2007-11-02 15:16:47,507 DEBUG [TableTag] [row] first iteration=true (row
number=1)
2007-11-02 15:16:47,507 INFO  [TableProperties] I18nResourceProvider
initialized to com.struts2.displaytag.DisplayTagI18nStruts2Adapter.
2007-11-02 15:16:47,522 DEBUG [TableTag] [row] addColumn
HeaderCell[columnNumber=0,title=Name,beanPropertyName=<null>]
2007-11-02 15:16:47,522 DEBUG [ColumnTag] columnTag.addHeaderToTable()
:: first iteration - adding header
HeaderCell[columnNumber=0,title=Name,beanPropertyName=<null>]
2007-11-02 15:16:47,522 DEBUG [TableTag] [row] first iteration=true (row
number=1)
2007-11-02 15:16:47,538 DEBUG [TableTag] [row] addColumn
HeaderCell[columnNumber=0,title=Title,beanPropertyName=title]
2007-11-02 15:16:47,538 DEBUG [ColumnTag] columnTag.addHeaderToTable()
:: first iteration - adding header
HeaderCell[columnNumber=1,title=Title,beanPropertyName=title]
2007-11-02 15:16:47,554 DEBUG [TableTag] [row] first iteration=true (row
number=1)
2007-11-02 15:16:47,554 DEBUG [TableTag] [row] addColumn
HeaderCell[columnNumber=0,title=Organization/Region,beanPropertyName=<null>]
2007-11-02 15:16:47,554 DEBUG [ColumnTag] columnTag.addHeaderToTable()
:: first iteration - adding header
HeaderCell[columnNumber=2,title=Organization/Region,beanPropertyName=<null>]
2007-11-02 15:16:47,554 DEBUG [TableTag] [row] first iteration=true (row
number=1)
2007-11-02 15:16:47,554 DEBUG [TableTag] [row] addColumn
HeaderCell[columnNumber=0,title=E-mail,beanPropertyName=email]
2007-11-02 15:16:47,554 DEBUG [ColumnTag] columnTag.addHeaderToTable()
:: first iteration - adding header
HeaderCell[columnNumber=3,title=E-mail,beanPropertyName=email]
2007-11-02 15:16:47,554 DEBUG [TableTag] [row] first iteration=true (row
number=1)
2007-11-02 15:16:47,569 DEBUG [TableTag] [row] addColumn
HeaderCell[columnNumber=0,title=Phone,beanPropertyName=phone]
2007-11-02 15:16:47,569 DEBUG [ColumnTag] columnTag.addHeaderToTable()
:: first iteration - adding header
HeaderCell[columnNumber=4,title=Phone,beanPropertyName=phone]
2007-11-02 15:16:47,569 DEBUG [TableTag] [row] doAfterBody called -
iterating on row 1
2007-11-02 15:16:47,569 DEBUG [TableTag] [row] doIteration called
2007-11-02 15:16:47,569 DEBUG [TableModel] [row] adding row
Row[rowNumber=1,rowObject=kbwina]
2007-11-02 15:16:47,569 DEBUG [TableTag] [row] doIteration() - iterator
ended after 1 rows
2007-11-02 15:16:47,569 DEBUG [TableTag] [row] doEndTag called
2007-11-02 15:16:47,569 DEBUG [SmartListHelper] New SmartListHelper
instantiated: list.size=[1], page size=[20], full list size=[1].
2007-11-02 15:16:47,569 DEBUG [SmartListHelper] CurrentPage page is 1 of 1
2007-11-02 15:16:47,569 DEBUG [SmartListHelper] Returning sublist for page 1
2007-11-02 15:16:47,569 DEBUG [TableModel] [row] sorting page list
2007-11-02 15:16:47,585 DEBUG [TableWriterTemplate] [row] writeTable
called for table [row]
2007-11-02 15:16:47,585 DEBUG [HtmlTableWriter] [row] getTableHeader called
2007-11-02 15:16:47,585 DEBUG [HtmlTableWriter] [row] getTableHeader end
2007-11-02 15:16:47,585 DEBUG [RowIterator] [row] rowIterator.next() row
number=0
2007-11-02 15:16:47,585 DEBUG [TableWriterTemplate]  creating
ColumnIterator on
[HeaderCell[columnNumber=0,title=Name,beanPropertyName=<null>],
HeaderCell[columnNumber=1,title=Title,beanPropertyName=title],
HeaderCell[columnNumber=2,title=Organization/Region,beanPropertyName=<null>],
HeaderCell[columnNumber=3,title=E-mail,beanPropertyName=email],
HeaderCell[columnNumber=4,title=Phone,beanPropertyName=phone]]
2007-11-02 15:16:47,585 DEBUG [LookupUtil] getProperty [username] on
bean kbwina
2007-11-02 15:16:47,585 DEBUG [LookupUtil] getProperty [username] on
bean kbwina
2007-11-02 15:16:47,679 DEBUG [LookupUtil] getProperty [title] on bean
kbwina
2007-11-02 15:16:47,679 DEBUG [LookupUtil] getProperty [title] on bean
kbwina
2007-11-02 15:16:47,679 DEBUG [LookupUtil] getProperty [email] on bean
kbwina
2007-11-02 15:16:47,679 DEBUG [LookupUtil] getProperty [email] on bean
kbwina
2007-11-02 15:16:47,679 DEBUG [LookupUtil] getProperty [phone] on bean
kbwina
2007-11-02 15:16:47,679 DEBUG [LookupUtil] getProperty [phone] on bean
kbwina
2007-11-02 15:16:47,679 DEBUG [SmartListHelper] Displaying pages from 1 to 1
2007-11-02 15:16:47,679 DEBUG [SmartListHelper] adding page 1
2007-11-02 15:16:47,679 DEBUG [Pagination] adding page 1
2007-11-02 15:16:47,679 DEBUG [TableWriterTemplate] [row] writeTable end
2007-11-02 15:16:47,679 DEBUG [TableTag] [row] doEndTag - end
2007-11-02 15:16:47,679 DEBUG [TableTag] [row] doStartTag called
2007-11-02 15:16:47,679 DEBUG [LookupUtil] getBeanValue - bean: {users}
2007-11-02 15:16:47,679 DEBUG [TableTag] [row] setting media [html] in
this.pageContext
2007-11-02 15:16:47,679 DEBUG [TableTag] [row] doIteration called
2007-11-02 15:16:47,679 DEBUG [TableTag] [row] setting attribute "row"
in pageContext
2007-11-02 15:16:47,679 DEBUG [TableTag] [row] first iteration=true (row
number=1)
2007-11-02 15:16:47,694 DEBUG [TableTag] [row] addColumn
HeaderCell[columnNumber=0,title=Name/Title,beanPropertyName=<null>]
2007-11-02 15:16:47,694 DEBUG [ColumnTag] columnTag.addHeaderToTable()
:: first iteration - adding header
HeaderCell[columnNumber=0,title=Name/Title,beanPropertyName=<null>]
2007-11-02 15:16:47,694 DEBUG [TableTag] [row] first iteration=true (row
number=1)
2007-11-02 15:16:47,694 DEBUG [TableTag] [row] addColumn
HeaderCell[columnNumber=0,title=Organization/Region,beanPropertyName=<null>]
2007-11-02 15:16:47,694 DEBUG [ColumnTag] columnTag.addHeaderToTable()
:: first iteration - adding header
HeaderCell[columnNumber=1,title=Organization/Region,beanPropertyName=<null>]
2007-11-02 15:16:47,741 DEBUG [TableTag] [row] first iteration=true (row
number=1)
2007-11-02 15:16:47,741 DEBUG [TableTag] [row] addColumn
HeaderCell[columnNumber=0,title=Contact Info,beanPropertyName=<null>]
2007-11-02 15:16:47,741 DEBUG [ColumnTag] columnTag.addHeaderToTable()
:: first iteration - adding header
HeaderCell[columnNumber=2,title=Contact Info,beanPropertyName=<null>]
2007-11-02 15:16:47,757 DEBUG [TableTag] [row] first iteration=true (row
number=1)
2007-11-02 15:16:47,757 DEBUG [TableTag] [row] addColumn
HeaderCell[columnNumber=0,title=Organization/Region,beanPropertyName=<null>]
2007-11-02 15:16:47,757 DEBUG [ColumnTag] columnTag.addHeaderToTable()
:: first iteration - adding header
HeaderCell[columnNumber=3,title=Organization/Region,beanPropertyName=<null>]
2007-11-02 15:16:47,757 DEBUG [TableTag] [row] doAfterBody called -
iterating on row 1
2007-11-02 15:16:47,757 DEBUG [TableTag] [row] doIteration called
2007-11-02 15:16:47,757 DEBUG [TableModel] [row] adding row
Row[rowNumber=1,rowObject=kbwina]
2007-11-02 15:16:47,757 DEBUG [TableTag] [row] doIteration() - iterator
ended after 1 rows
2007-11-02 15:16:47,757 DEBUG [TableTag] [row] doEndTag called
2007-11-02 15:16:47,757 DEBUG [SmartListHelper] New SmartListHelper
instantiated: list.size=[1], page size=[20], full list size=[1].
2007-11-02 15:16:47,757 DEBUG [SmartListHelper] CurrentPage page is 1 of 1
2007-11-02 15:16:47,757 DEBUG [SmartListHelper] Returning sublist for page 1
2007-11-02 15:16:47,757 DEBUG [TableModel] [row] sorting page list
2007-11-02 15:16:47,757 DEBUG [TableWriterTemplate] [row] writeTable
called for table [row]
2007-11-02 15:16:47,757 DEBUG [HtmlTableWriter] [row] getTableHeader called
2007-11-02 15:16:47,757 DEBUG [HtmlTableWriter] [row] getTableHeader end
2007-11-02 15:16:47,757 DEBUG [RowIterator] [row] rowIterator.next() row
number=0
2007-11-02 15:16:47,757 DEBUG [TableWriterTemplate]  creating
ColumnIterator on
[HeaderCell[columnNumber=0,title=Name/Title,beanPropertyName=<null>],
HeaderCell[columnNumber=1,title=Organization/Region,beanPropertyName=<null>],
HeaderCell[columnNumber=2,title=Contact Info,beanPropertyName=<null>],
HeaderCell[columnNumber=3,title=Organization/Region,beanPropertyName=<null>]]
2007-11-02 15:16:47,757 DEBUG [SmartListHelper] Displaying pages from 1 to 1
2007-11-02 15:16:47,757 DEBUG [SmartListHelper] adding page 1
2007-11-02 15:16:47,757 DEBUG [Pagination] adding page 1
2007-11-02 15:16:47,757 DEBUG [TableWriterTemplate] [row] writeTable end
2007-11-02 15:16:47,757 DEBUG [TableTag] [row] doEndTag - end
2007-11-02 15:16:48,460 DEBUG [ResponseOverrideFilter] Filter has been
called, but PARAMETER_EXPORTING parameter has not been found.
2007-11-02 15:16:48,569 DEBUG [ResponseOverrideFilter] Filter has been
called, but PARAMETER_EXPORTING parameter has not been found.

- When I hit the export to excel link:
2007-11-02 15:20:44,903 ERROR [ParametersInterceptor]
ParametersInterceptor - [setParameters]: Unexpected Exception caught
setting '6578706f7274' on 'class com.portal.action.UserSearchAction:
Error setting expression '6578706f7274' with value
'[Ljava.lang.String;@ba93d1'
2007-11-02 15:20:44,919 ERROR [ParametersInterceptor]
ParametersInterceptor - [setParameters]: Unexpected Exception caught
setting 'd-16544-e' on 'class com.portal.action.UserSearchAction: Error
setting expression 'd-16544-e' with value '[Ljava.lang.String;@13eabd9'
2007-11-02 15:20:44,919 ERROR [ParametersInterceptor]
ParametersInterceptor - [setParameters]: Unexpected Exception caught
setting '6578706f7274' on 'class com.portal.action.UserSearchAction:
Error setting expression '6578706f7274' with value
'[Ljava.lang.String;@ba93d1'
2007-11-02 15:20:44,919 ERROR [ParametersInterceptor]
ParametersInterceptor - [setParameters]: Unexpected Exception caught
setting 'd-16544-e' on 'class com.portal.action.UserSearchAction: Error
setting expression 'd-16544-e' with value '[Ljava.lang.String;@13eabd9'
2007-11-02 15:20:45,185 DEBUG [TableTag] [row] doStartTag called
2007-11-02 15:20:45,185 DEBUG [LookupUtil] getBeanValue - bean: {users}
2007-11-02 15:20:45,185 DEBUG [TableTag] [row] setting media [excel] in
this.pageContext
2007-11-02 15:20:45,185 DEBUG [TableTag] [row] doIteration called
2007-11-02 15:20:45,185 DEBUG [TableTag] [row] setting attribute "row"
in pageContext
2007-11-02 15:20:45,185 DEBUG [TableTag] [row] first iteration=true (row
number=1)
2007-11-02 15:20:45,185 DEBUG [TableTag] [row] addColumn
HeaderCell[columnNumber=0,title=Name,beanPropertyName=<null>]
2007-11-02 15:20:45,185 DEBUG [ColumnTag] columnTag.addHeaderToTable()
:: first iteration - adding header
HeaderCell[columnNumber=0,title=Name,beanPropertyName=<null>]
2007-11-02 15:20:45,185 DEBUG [TableTag] [row] first iteration=true (row
number=1)
2007-11-02 15:20:45,185 DEBUG [TableTag] [row] addColumn
HeaderCell[columnNumber=0,title=Title,beanPropertyName=title]
2007-11-02 15:20:45,185 DEBUG [ColumnTag] columnTag.addHeaderToTable()
:: first iteration - adding header
HeaderCell[columnNumber=1,title=Title,beanPropertyName=title]
2007-11-02 15:20:45,185 DEBUG [TableTag] [row] first iteration=true (row
number=1)
2007-11-02 15:20:45,200 DEBUG [TableTag] [row] addColumn
HeaderCell[columnNumber=0,title=Organization/Region,beanPropertyName=<null>]
2007-11-02 15:20:45,200 DEBUG [ColumnTag] columnTag.addHeaderToTable()
:: first iteration - adding header
HeaderCell[columnNumber=2,title=Organization/Region,beanPropertyName=<null>]
2007-11-02 15:20:45,200 DEBUG [TableTag] [row] first iteration=true (row
number=1)
2007-11-02 15:20:45,200 DEBUG [TableTag] [row] addColumn
HeaderCell[columnNumber=0,title=E-mail,beanPropertyName=email]
2007-11-02 15:20:45,200 DEBUG [ColumnTag] columnTag.addHeaderToTable()
:: first iteration - adding header
HeaderCell[columnNumber=3,title=E-mail,beanPropertyName=email]
2007-11-02 15:20:45,200 DEBUG [TableTag] [row] first iteration=true (row
number=1)
2007-11-02 15:20:45,200 DEBUG [TableTag] [row] addColumn
HeaderCell[columnNumber=0,title=Phone,beanPropertyName=phone]
2007-11-02 15:20:45,200 DEBUG [ColumnTag] columnTag.addHeaderToTable()
:: first iteration - adding header
HeaderCell[columnNumber=4,title=Phone,beanPropertyName=phone]
2007-11-02 15:20:45,200 DEBUG [TableTag] [row] doAfterBody called -
iterating on row 1
2007-11-02 15:20:45,200 DEBUG [TableTag] [row] doIteration called
2007-11-02 15:20:45,200 DEBUG [TableModel] [row] adding row
Row[rowNumber=1,rowObject=kbwina]
2007-11-02 15:20:45,200 DEBUG [TableTag] [row] doIteration() - iterator
ended after 1 rows
2007-11-02 15:20:45,200 DEBUG [TableTag] [row] doEndTag called
2007-11-02 15:20:45,200 DEBUG [SmartListHelper] New SmartListHelper
instantiated: list.size=[1], page size=[20], full list size=[1].
2007-11-02 15:20:45,200 DEBUG [SmartListHelper] CurrentPage page is 1 of 1
2007-11-02 15:20:45,200 DEBUG [SmartListHelper] Returning sublist for page 1
2007-11-02 15:20:45,200 DEBUG [TableModel] [row] sorting page list
2007-11-02 15:20:45,200 DEBUG [TableTag] [row] doEndTag - exporting
2007-11-02 15:20:45,200 DEBUG [TableTag] [row] currentMediaType=excel
2007-11-02 15:20:45,200 DEBUG [TableTag] Exportfilter NOT enabled
2007-11-02 15:20:45,200 DEBUG [BaseExportView]
org.displaytag.export.ExcelView
2007-11-02 15:20:45,216 DEBUG [RowIterator] [row] rowIterator.next() row
number=0
2007-11-02 15:20:45,216 DEBUG [LookupUtil] getProperty [title] on bean
kbwina
2007-11-02 15:20:45,216 DEBUG [LookupUtil] getProperty [title] on bean
kbwina
2007-11-02 15:20:45,216 DEBUG [LookupUtil] getProperty [email] on bean
kbwina
2007-11-02 15:20:45,216 DEBUG [LookupUtil] getProperty [email] on bean
kbwina
2007-11-02 15:20:45,216 DEBUG [LookupUtil] getProperty [phone] on bean
kbwina
2007-11-02 15:20:45,216 DEBUG [LookupUtil] getProperty [phone] on bean
kbwina
2007-11-02 15:20:45,216 DEBUG [TableTag] Export completed
2007-11-02 15:20:45,216 DEBUG [TableTag] [row] doEndTag - end


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
displaytag-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/displaytag-user
Reply | Threaded
Open this post in threaded view
|

Re: Struts2, Excel exporting problem

Pradip Bhatt
I get same issue for Convert PDF, Excel, CSV ..

Did you solved your this issue??
Can you please help me?

Pradip Bhatt



------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
displaytag-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/displaytag-user