Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: 1.1
    • Component/s: Export, HTML Generation
    • Labels:
      None
    • Testcase included:
      yes

      Description

      Request for enhancements of the export facility

      1. The default exporters should render the table as close as possible
         to the rendered HTML. When typical business users are presented with the
         displaytag export facility, they usually expect the exported Excel or PDF to
         look just like the HTML in their browser; they expect a WYSIWYG rendering.
      2. The export API should encourage reuse of the table-rendering logic
         employed to render the table in a JSP. For instance, to render the grouping
         in my PDF export just as it appears in the HTML, I would have had to
         re-implement TableTag.groupColumns(). Also, any future changes to the
         table rendering would not be included in my PDF export. So, this looked
         like a job for the Template Method pattern, which also applies nicely to the
         decorators, to ensure that the HTML and default export
         renderings will be in synch.
      3. Include caption in export.
      4. Include footer in export.
      5. Export in RTF format.
      The attached patch implements the above enhancements.
      <a href="http://www.jamesgood.com:8080/displaytag-examples-1.1-SNAPSHOT/example-new-export.jsp">
      Here's a live example and a more detailed explanation.</a>

      Following are potential additional export enhacements I'm working on.
      1. Use css table styles as style configuration for Excel, PDF, and RTF exports.
         If not practical, provide export style config properties.
      2. Specify Excel formats for columns, e.g., ##.##.
      3. Include smart linking in Excel, PDF, and RTF exports.
      4. Export just the current page, a page range, or all data, especially if
         paging is used.
         The ui may look like this:

         Export options: Excel | PDF | RTF | From: [1] To: [1] (default to this page)
         Export options: Excel | PDF | RTF | From: [1] To: [max] (default to all)

         Defaults to exporting what's on the page currently. Default would be
         configurable through property.

      6. Set the column width to the max column string value width.
      7. Exporters should support nested tables.
      8. Implement font styles in RTF export, e.g., bold face.
      9. Export in MS Word format using POI.

      Related Jira issues:
      <ol>
      <li>http://jira.codehaus.org/browse/DISPL-194
      <li>http://jira.codehaus.org/browse/DISPL-123
      </ol>

      Unit Tests:
      The main code change this patch supplies is a refactoring of the table-rendering
      code. As such, the relevant unit test are the existing tests,
      <a href="http://www.jamesgood.com:8080/displaytag-examples-1.1-SNAPSHOT/docs/multiproject/displaytag/junit-report.html">
      all of which succeeded.</a>

      -Jorge
      1. displaytagExamplePatch.txt
        35 kB
        Jorge L. Barroso
      2. displaytagExportPoiPatch.txt
        19 kB
        Jorge L. Barroso
      3. displaytagPatch.txt
        114 kB
        Jorge L. Barroso
      1. ico_file_rtf.png
        1.0 kB

        Activity

        Hide
        Jorge L. Barroso added a comment -
        Hi, Björn.

        Regarding,
        >6. Set the column width to the max column string value width.
        Correction: The code for setting the max width did not make it into the 1.1 default excel exporter. I got it confused with my local copy, which has it. It should be added to the next release, but the poi limitations I mentioned still hold.
        Show
        Jorge L. Barroso added a comment - Hi, Björn. Regarding, >6. Set the column width to the max column string value width. Correction: The code for setting the max width did not make it into the 1.1 default excel exporter. I got it confused with my local copy, which has it. It should be added to the next release, but the poi limitations I mentioned still hold.
        Hide
        Björn Wennerström added a comment -
        Thanks for the update!

        We're really interested in nested tables because it's the only way we can see for doing an Excel export with two sheets that get their data from different tables. Or is there another way? I'll be offline for a few weeks now, but in August I'll have to find a solution to this somehow
        Show
        Björn Wennerström added a comment - Thanks for the update! We're really interested in nested tables because it's the only way we can see for doing an Excel export with two sheets that get their data from different tables. Or is there another way? I'll be offline for a few weeks now, but in August I'll have to find a solution to this somehow
        Hide
        Dean Pullen added a comment -
        These new 'default' classes (e.g. DefaultPdfExportView ) do not export the full list of table data when paging is on, and thus must disregard the export.amount=list param in display.properties.
        How can I get both the footer and the full table list of data exported? All though this is meant to be WYSIWYG, I think that param should still be examined.
        Show
        Dean Pullen added a comment - These new 'default' classes (e.g. DefaultPdfExportView ) do not export the full list of table data when paging is on, and thus must disregard the export.amount=list param in display.properties. How can I get both the footer and the full table list of data exported? All though this is meant to be WYSIWYG, I think that param should still be examined.
        Hide
        Jorge L. Barroso added a comment -
        Dean,

        A patch fixing the export.amount bug is available at http://jira.codehaus.org/browse/DISPL-292.

        -Jorge
        Show
        Jorge L. Barroso added a comment - Dean, A patch fixing the export.amount bug is available at http://jira.codehaus.org/browse/DISPL-292 . -Jorge
        Hide
        A K Alex added a comment -
        I would like to export a footer of the form:

        <display:footer>
          <tr>
            <td>Total of Col 1</td>
            <td>Total of Col 2</td>
            <td>Total of Col 3</td>
          </tr>
        </display:footer>


        Any solutions?
        Show
        A K Alex added a comment - I would like to export a footer of the form: <display:footer>   <tr>     <td>Total of Col 1</td>     <td>Total of Col 2</td>     <td>Total of Col 3</td>   </tr> </display:footer> Any solutions?

          People

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

            Dates

            • Created:
              Updated:
              Resolved: