DisplayTag
  1. DisplayTag
  2. DISPL-300

WYSIWYG data exporting for one table only

    Details

    • Type: Task Task
    • Status: Reopened Reopened
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.1
    • Fix Version/s: None
    • Component/s: Export
    • Labels:
      None
    • Application server:
      Tomcat 5.0.28

      Description

      I want to use the new export poi feature in one table only, and the basic exportation in the other tables, is there a property export.excel.class e.g.
      <display:setProperty name="export.excel.class" value="org.displaytag.export.excel.DefaultHssfExportView />

      to use in the jsp so only that table get affected with poi feature? I tried like that and it didn't work :( , currently I set my displaytag.properties export.excel.class=org.displaytag.export.excel.DefaultHssfExportView and it worked , but the other tables are not exporting to excel the right way. I need the poi feature only in this table.
      Thanks in advance

        Activity

        Hide
        Jorge L. Barroso added a comment -
        I'm not sure whether this is a current feature, but perhaps it should be.

        You can, however, configure your displaytag deployment to achieve this, by introducing an export type for the Excel WYSIWYG export, call it wexcel.
        Here's a sample config
        #Includes new wexcel type
        export.types=csv excel xml pdf rtf wexcel
        #Not globally available
        export.wexcel=false
        #Use the WYSIWG exporter
        export.wexcel.class=org.displaytag.export.excel.DefaultHssfExportView

        Then in your jsp, enable this export type, like so:
        <display:setProperty name="export.wexcel" value="true"/>
        Disable your default excel exporter just in this page.
        <display:setProperty name="export.excel" value="false"/>

        Add this media type to the columns you want exported, like so:

        <display:column titleKey="title.sometitle" media="wexcel">...

        Don't forget to configure the excel icon for this export.

        -Jorge
        Show
        Jorge L. Barroso added a comment - I'm not sure whether this is a current feature, but perhaps it should be. You can, however, configure your displaytag deployment to achieve this, by introducing an export type for the Excel WYSIWYG export, call it wexcel. Here's a sample config #Includes new wexcel type export.types=csv excel xml pdf rtf wexcel #Not globally available export.wexcel=false #Use the WYSIWG exporter export.wexcel.class=org.displaytag.export.excel.DefaultHssfExportView Then in your jsp, enable this export type, like so: <display:setProperty name="export.wexcel" value="true"/> Disable your default excel exporter just in this page. <display:setProperty name="export.excel" value="false"/> Add this media type to the columns you want exported, like so: <display:column titleKey="title.sometitle" media="wexcel">... Don't forget to configure the excel icon for this export. -Jorge
        Hide
        Emmanuel added a comment -
        Thanks Jorge,
        Show
        Emmanuel added a comment - Thanks Jorge,
        Hide
        fabrizio giustina added a comment -
        looks solved with the suggestion from Jorge
        Show
        fabrizio giustina added a comment - looks solved with the suggestion from Jorge
        Hide
        Emmanuel added a comment -
        Hi Jorge, I tried what you suggested and it gave me a nullpointerException, do I have to change something or add something in the source files in order for displaytag to accept the wexcel type java.lang.NullPointerException
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:141)
        at org.displaytag.util.ReflectHelper.classForName(ReflectHelper.java:43)
        at org.displaytag.export.ExportViewFactory.registerExportView(ExportViewFactory.java:95)
        at org.displaytag.export.ExportViewFactory.<init>(ExportViewFactory.java:67)
        at org.displaytag.export.ExportViewFactory.getInstance(ExportViewFactory.java:79)
        at org.displaytag.tags.TableTag.doStartTag(TableTag.java:709)

        Show
        Emmanuel added a comment - Hi Jorge, I tried what you suggested and it gave me a nullpointerException, do I have to change something or add something in the source files in order for displaytag to accept the wexcel type java.lang.NullPointerException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at org.displaytag.util.ReflectHelper.classForName(ReflectHelper.java:43) at org.displaytag.export.ExportViewFactory.registerExportView(ExportViewFactory.java:95) at org.displaytag.export.ExportViewFactory.<init>(ExportViewFactory.java:67) at org.displaytag.export.ExportViewFactory.getInstance(ExportViewFactory.java:79) at org.displaytag.tags.TableTag.doStartTag(TableTag.java:709)
        Hide
        jonwilmoth added a comment -
        I'm not sure if this should be addressed here or with http://jira.codehaus.org/browse/DISPL-245, but exporting to excel with the default 1.1.1 config (export.excel.class=org.displaytag.export.ExcelView) doesn't preserve currency formatting when the last column in a row is numeric. The raw numeric value is output. Other columns before the end of the row do preserve the currency formatting. A workaround to this is to override the export class to export.excel.class=org.displaytag.export.excel.ExcelHssfView.
        Show
        jonwilmoth added a comment - I'm not sure if this should be addressed here or with http://jira.codehaus.org/browse/DISPL-245, but exporting to excel with the default 1.1.1 config (export.excel.class=org.displaytag.export.ExcelView) doesn't preserve currency formatting when the last column in a row is numeric. The raw numeric value is output. Other columns before the end of the row do preserve the currency formatting. A workaround to this is to override the export class to export.excel.class=org.displaytag.export.excel.ExcelHssfView.

          People

          • Reporter:
            Emmanuel
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: