DisplayTag
  1. DisplayTag
  2. DISPL-466

Allow usage of Excel templates in Excel export

    Details

    • Type: New Feature New Feature
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Export
    • Labels:
      None

      Description

      Displaytag should allow to use XLT files (Excel templates) in Excel export.

      I found some info of it in this mailing list thread:
      http://www.mail-archive.com/displaytag-devel@lists.sourceforge.net/msg03072.html

      But did not find that that was realized nor any JIRA issue for this, so I am creating to let know that this function is needed.
      1. displ-466-v3.diff
        21 kB
        Maciej Wegorkiewicz

        Activity

        Hide
        Maciej Wegorkiewicz added a comment -
        I modified the sources and implemented the funcionality. Please someone review and give feedback or integrate into the library.

        All modified sources I attached in this ticket.

        The funtion works like this:

        1. You add template in the form of normal XLS file into the jar/war of your application (so the class can load it by Class.getResourceAsStream)
        2. On JSP page you add link to the template in tag in the form like this:
        <display:table (...) export="true" excelTemplate="/template.xls" startRow="0" startColumn="0">
        3. Here we are! The data would be shown onto template.xls provided - with colors, font formating etc.

        startRow/startColumn still does not work - I will implement after these changes are agreed with the team.
        Show
        Maciej Wegorkiewicz added a comment - I modified the sources and implemented the funcionality. Please someone review and give feedback or integrate into the library. All modified sources I attached in this ticket. The funtion works like this: 1. You add template in the form of normal XLS file into the jar/war of your application (so the class can load it by Class.getResourceAsStream) 2. On JSP page you add link to the template in tag in the form like this: <display:table (...) export="true" excelTemplate="/template.xls" startRow="0" startColumn="0"> 3. Here we are! The data would be shown onto template.xls provided - with colors, font formating etc. startRow/startColumn still does not work - I will implement after these changes are agreed with the team.
        Hide
        fabrizio giustina added a comment -
        Hi Maciej,
        thanks for the effort put in developing this functionality. If you would like to see it integrated however you should try to supply your patch in a more manageable format and complete it with unit tests (you can see several examples in existing code).
        Please never attach the full sources, but do a svn diff with your changes.

        Show
        fabrizio giustina added a comment - Hi Maciej, thanks for the effort put in developing this functionality. If you would like to see it integrated however you should try to supply your patch in a more manageable format and complete it with unit tests (you can see several examples in existing code). Please never attach the full sources, but do a svn diff with your changes.
        Hide
        Maciej Wegorkiewicz added a comment -
        Dear Fabrizio,

        What do you mean by doing "a svn diff with your changes"? Should I provide here not source files but only text rows that differ? I cannot see the option of extracting such data (at least in Tortoise). I provided the zip with only the files that are changed (these are not full sources!), you can just save it onto your source tree and make diff to see what was changed?
        So please tell me more precisely what these diffs mean for you.

        As with unit tests I will look at it now.
        Show
        Maciej Wegorkiewicz added a comment - Dear Fabrizio, What do you mean by doing "a svn diff with your changes"? Should I provide here not source files but only text rows that differ? I cannot see the option of extracting such data (at least in Tortoise). I provided the zip with only the files that are changed (these are not full sources!), you can just save it onto your source tree and make diff to see what was changed? So please tell me more precisely what these diffs mean for you. As with unit tests I will look at it now.
        Hide
        fabrizio giustina added a comment -
        > What do you mean by doing "a svn diff with your changes"?

        if you are using svn you should use the command "Create Patch", see:
        http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-patch.html

        please check that the generated patch only contains useful modification, not code reformatting or unrelated changes.
        Show
        fabrizio giustina added a comment - > What do you mean by doing "a svn diff with your changes"? if you are using svn you should use the command "Create Patch", see: http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-patch.html please check that the generated patch only contains useful modification, not code reformatting or unrelated changes.
        Hide
        Maciej Wegorkiewicz added a comment -
        I attached the svn diff. As for unit tests I did not write any new one as my functionality is related to excel-export-poi module and the module has no unit tests. Anyway I have run all tests and every one that performed successfully before my changes is working now also.
        Show
        Maciej Wegorkiewicz added a comment - I attached the svn diff. As for unit tests I did not write any new one as my functionality is related to excel-export-poi module and the module has no unit tests. Anyway I have run all tests and every one that performed successfully before my changes is working now also.
        Hide
        Maciej Wegorkiewicz added a comment -
        I did the patch - it works on production in my company, I have put the sources here and the team does not want to integrate it into the official version.
        This way I have no possibility of update the version without re-integrating and other Displaytag users have no functionality of Excel templates.

        Great.

        I have now learned that one should not try to work on displaytag, seems it is better to find other component.

        "Thanks a lot"
        Show
        Maciej Wegorkiewicz added a comment - I did the patch - it works on production in my company, I have put the sources here and the team does not want to integrate it into the official version. This way I have no possibility of update the version without re-integrating and other Displaytag users have no functionality of Excel templates. Great. I have now learned that one should not try to work on displaytag, seems it is better to find other component. "Thanks a lot"

          People

          • Reporter:
            Maciej Wegorkiewicz
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: