Menu

Export table

Help
Whiskogs
2007-12-21
2012-10-09
  • Whiskogs

    Whiskogs - 2007-12-21

    Hi again,

    Another one: I would like to export the table in excel, csv, xml. So far, tough luck: the content is displayed in the same browser page.
    The table is in a jsp included in another (index.jsp), the export attribute is set to true and I've added the following to my displaytag table to make it open in a different programme window:

    <display:setProperty name="export.excel.filename" value="mycollection.xls" />
    <display:setProperty name="export.csv.filename" value="mycollection.csv" />
    <display:setProperty name="export.xml.filename" value="mycollection.xml" />

    (I have tried setting the export.csv.label property and it works, so I'm convinced the above is taken into account)

    My web.xml file contains those filters:

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

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

    Nothing seems to do the trick. Reading the forum, it seems a lot of people have troubles with the export feature, but I couldn't find a solution to my problem. Can anyone help, please?
    If it makes a difference, the first column of my table is checkbox (and btw, can I not export it? -- meaning export only a selection of columns from a table?)

    thx,

     
    • Whiskogs

      Whiskogs - 2008-01-18

      I managed: adding filters on .do and .jsp isn't sufficient, had to add the exact url of the page/servlet from where the export is done. Something like:

      <filter-mapping>
      <filter-name>ResponseOverrideFilter</filter-name>
      <url-pattern>/my/collection</url-pattern>
      </filter-mapping>

      Problem solved.

       
    • Whiskogs

      Whiskogs - 2008-01-10

      bump

       

Log in to post a comment.