[ http://jira.codehaus.org/browse/DISPL-298?page=comments#action_60225 ]
Jorge L. Barroso commented on DISPL-298: ---------------------------------------- ----- related problem --------------- I am getting problems while exporting the values to PDF/Excel by using display tag all values are getting in pdf/excel expcept the Column Totals How Can I get the Column Totals in PDF/EXCEL Please help me Thanks in advanvce Krishna Mangamuri ----- evaluation --------------- The problem is twofold: 1. The new total decorators don't implement interfaces expected by the excel and pdf exporters, namely, org.displaytag.decorator.hssf.DecoratesHssf for excel and org.displaytag.render.ItextDecorator Implementing these interfaces should be required only if the decorator needs to do hssf or itext work. In general, they should become optional. As a workaround, you'll need to extend the total decorator you're using, (org.displaytag.decorator.MultilevelTotalTableDecorator or TotalTableDecorator) so that they implement these interfaces. 2. You'll also need to explicitly configure you're new excel and pdf decorators, like so. <display:setProperty name="export.excel.decorator" value="name.of.your.excel.decorator" /> <display:setProperty name="export.pdf.decorator" value="name.of.your.pdf.decorator" /> > TableDecorator created with 1.0 doesn't work properly with 1.1. Properties > defined only it decorator > ---------------------------------------------------------------------------------------------------- > > Key: DISPL-298 > URL: http://jira.codehaus.org/browse/DISPL-298 > Project: DisplayTag > Type: Bug > Versions: 1.1 > Reporter: Frode Halvorsen > Fix For: 1.1 > > > I made a TableDecorator to use displaytags on a list of Object[], where I > defined all properties in the customized TableDecorator. > It seem to work fine when displayin on web, with sorting and everything, but > when trying to export to Excel, it throws an exception for propertyNotFound. > the class : > package no.song.polka.web.decorators; > import org.displaytag.decorator.TableDecorator; > import org.apache.log4j.Logger; > import no.song.polka.business.*; > /** > * Created by IntelliJ IDEA. > * User: Frode Halvorsen > * Date: 12.feb.2005 > * Time: 02:05:18 > * To change this template use File | Settings | File Templates. > */ > public class ResponsibleProviders extends TableDecorator { > private final Logger log = Logger.getLogger(getClass().getName() + "(" + > System.identityHashCode(this) + ")"); > private Object[] getObjects() { > return (Object[]) getCurrentRowObject(); > // return (Object[]) ((ArrayList) > getDecoratedObject()).get(getListIndex()); > } > public String getFromNumber() { > return ((String) getObjects()[0]).split("-")[0]; > } > public String getSeries() { > String series = (String) getObjects()[0]; > String numbers[] = series.split("-"); > return numbers[0].equals(numbers[1]) ? numbers[0] : series; > } > public String getToNumber() { > String numbers[] = ((String) getObjects()[0]).split("-"); > return numbers[0].equals(numbers[1]) ? " " : numbers[1]; > } > public String getDsp() { > return "" + (Destination) getObjects()[1]; > } > public String getOdsp() { > return "" + (Destination) getObjects()[2]; > } > } > .... > the usage : > <display:table name="result" htmlId="searchResult" id="row" class="polka" > export="true" requestURI="p_17.spr?reuse=true" > decorator="no.song.polka.web.decorators.ResponsibleProviders"> > <display:setProperty name="basic.msg.empty_list_row" value='<tr > class="empty"><td colspan="{0}">Søk på nytt.</td></tr>'/> > <display:setProperty name="export.excel.filename" value="providers.xls"/> > <!--display:column property="fromNumber" title="Telefonnummer" /--> > <!--display:column property="toNumber" title="(serie-slutt)" /--> > <display:column property="series" title="Telefonnummer" sortable="true"/> > <display:column property="dsp" title="Nåværende Tilbyder" /> > <display:column property="odsp" title="Opprinnelig tilbyder" /> > </display:table> > .... > the stacktrace when clicking 'excel' : > Exception: [.LookupUtil] Error looking up property "series" in object type > "[Ljava.lang.Object;". Cause: Unknown property 'series' > at org.displaytag.util.LookupUtil.getBeanProperty(LookupUtil.java:141) > at org.displaytag.model.Column.getValue(Column.java:124) > at > org.displaytag.export.BaseExportView.doExport(BaseExportView.java:265) > at org.displaytag.tags.TableTag.writeExport(TableTag.java:1469) > at org.displaytag.tags.TableTag.doExport(TableTag.java:1356) > at org.displaytag.tags.TableTag.doEndTag(TableTag.java:1227) > at org.apache.jsp.p_17_jsp._jspService(p_17_jsp.java:437) > . > . > . > . -- 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 ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 _______________________________________________ displaytag-devel mailing list displaytag-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/displaytag-devel