DisplayTag
  1. DisplayTag
  2. DISPL-292

Export to Excel, PDf y RTF doesn't export all the LIST

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: 2.0
    • Component/s: Export
    • Labels:
      None
    • Application server:
      Tomcat 5.0.28

      Description

      When I use the Export utility and I code the line <display:setProperty name="export.excel.export_amount" value="list"></display:setProperty>, or I use the propertites, displaytag only exports the PAGE (10 records), not the LIST. but it only happens when I export to EXCEL, PDf y RTF.

      When I export to XML and CSV all runs fine (1604 records are exported).

      Any of you with the same problem ?

      Thx,
      Jaume
      1. DISPL-292-displaytag-patch.txt
        0.7 kB
        Jorge L. Barroso
      2. TableWriterTemplate.java
        22 kB
        Jonathan Gordon

        Activity

        Hide
        Jorge L. Barroso added a comment -
        I'll have a look.
        Show
        Jorge L. Barroso added a comment - I'll have a look.
        Hide
        Bob Barney added a comment -
        I am also having this problem. I verified that adding the export filter does not help. This is a big problem, as I am currently writing a story about Displaytag for an online magazine, and I planned to highlight the export feature in the article. Please give this problem your highest attention.

        Much thanks!

        Stephen
        Show
        Bob Barney added a comment - I am also having this problem. I verified that adding the export filter does not help. This is a big problem, as I am currently writing a story about Displaytag for an online magazine, and I planned to highlight the export feature in the article. Please give this problem your highest attention. Much thanks! Stephen
        Hide
        Jorge L. Barroso added a comment -
        I'll have a solution soon.

        The conflict lies in that the new Excel, PDF, and RTF table writers are meant to behave just as the HTML table writer does. So it defaults to observing the list size, sorting, and grouping of the html page to suport WYSIWYG exports. But the "legacy" exporting configuration properties should definitely be supported.

        Perhaps, adding the following kind of functionality would be the best solution in the end. From: http://jira.codehaus.org/browse/DISPL-245
        =======================================================
        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.
        =======================================================

        But for now the easiest solution might be to introduce non-WYSIWYG Excel, PDF, and RTF exports that simply obey all the "legacy" exporting config properties. Users can then choose one or the other.
        Show
        Jorge L. Barroso added a comment - I'll have a solution soon. The conflict lies in that the new Excel, PDF, and RTF table writers are meant to behave just as the HTML table writer does. So it defaults to observing the list size, sorting, and grouping of the html page to suport WYSIWYG exports. But the "legacy" exporting configuration properties should definitely be supported. Perhaps, adding the following kind of functionality would be the best solution in the end. From: http://jira.codehaus.org/browse/DISPL-245 ======================================================= 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. ======================================================= But for now the easiest solution might be to introduce non-WYSIWYG Excel, PDF, and RTF exports that simply obey all the "legacy" exporting config properties. Users can then choose one or the other.
        Hide
        Bob Barney added a comment -
        > But for now the easiest solution might be to introduce non-WYSIWYG Excel, PDF, and RTF exports that simply obey all the "legacy" exporting config properties. Users can then choose one or the other.

        I am afraid that I don't know how to do this. Do you have any examples that I could mimic?

        Stephen
        Show
        Bob Barney added a comment - > But for now the easiest solution might be to introduce non-WYSIWYG Excel, PDF, and RTF exports that simply obey all the "legacy" exporting config properties. Users can then choose one or the other. I am afraid that I don't know how to do this. Do you have any examples that I could mimic? Stephen
        Hide
        Jorge L. Barroso added a comment -
        This patch makes WYSIWYG exports observe the export.amount config setting.

        The distrubution default setting for export.amount is list. To export just the current page, change this setting to export.amount=page.
        Show
        Jorge L. Barroso added a comment - This patch makes WYSIWYG exports observe the export.amount config setting. The distrubution default setting for export.amount is list. To export just the current page, change this setting to export.amount=page.
        Hide
        Jorge L. Barroso added a comment -
        The line numbers in the patch I submitted depend on the the patch for http://jira.codehaus.org/browse/DISPL-298 .
        Show
        Jorge L. Barroso added a comment - The line numbers in the patch I submitted depend on the the patch for http://jira.codehaus.org/browse/DISPL-298 .
        Hide
        sujatha ganesh added a comment -
        I need this fix to export the whole list to excel. When will 1.1.1 version be released? I need the displaytag1.1.1.jar please.

        Thanks
        -S
        Show
        sujatha ganesh added a comment - I need this fix to export the whole list to excel. When will 1.1.1 version be released? I need the displaytag1.1.1.jar please. Thanks -S
        Hide
        Jorge Blázquez added a comment -
        Hi to all,

        Jorge, is the jar file you have posted compiled with a 5.0 JVM?

        I tried to replace the displaytag distribution with the jar you posted nad i got version incompatibilities issues.
        Most exactly, this error: "java.lang.UnsupportedClassVersionError:(Unsupported major.minor version 49.0)"

        Maybe I'm doing something wrong.

        thanks in advance
        Jorge
        Show
        Jorge Blázquez added a comment - Hi to all, Jorge, is the jar file you have posted compiled with a 5.0 JVM? I tried to replace the displaytag distribution with the jar you posted nad i got version incompatibilities issues. Most exactly, this error: "java.lang.UnsupportedClassVersionError:(Unsupported major.minor version 49.0)" Maybe I'm doing something wrong. thanks in advance Jorge
        Hide
        Jorge Blázquez added a comment -
        Sorry, it seems Celso posted the jar but was not able to see his message.
        Show
        Jorge Blázquez added a comment - Sorry, it seems Celso posted the jar but was not able to see his message.
        Hide
        Javier D L added a comment -
        Hi.
        i also have this error "java.lang.UnsupportedClassVersionError:(Unsupported major.minor version 49.0)", i need a jar that work with minor version that 49.0. i have a 1.4 java version, i think that the version of jvm is 48.0.
        thanks
        Javi
        Show
        Javier D L added a comment - Hi. i also have this error "java.lang.UnsupportedClassVersionError:(Unsupported major.minor version 49.0)", i need a jar that work with minor version that 49.0. i have a 1.4 java version, i think that the version of jvm is 48.0. thanks Javi
        Hide
        Javier D L added a comment -
        Fixed by Jaume,
        This jar show all list in pdf
        work with j2sdk1.4.2_07 and Tomcat 4.1

         thanks Jaume
        Show
        Javier D L added a comment - Fixed by Jaume, This jar show all list in pdf work with j2sdk1.4.2_07 and Tomcat 4.1  thanks Jaume
        Hide
        fabio canepa added a comment -
        + 1 for this patch. I've tested also on the trunk version and it seems to works...
        Show
        fabio canepa added a comment - + 1 for this patch. I've tested also on the trunk version and it seems to works...
        Hide
        Harry added a comment -
        Hi All,

        I've just started using display tag Libraries. I successfully managed to do everything with the libraries. But now I'm having the same export problem as mentioned above. Can you please let me know how to handle this problem. Should I download the patch, that's mentioned here and then change my displaytag library jar version 1.1.1 to this jar file. Please advice.

        The jar file that I'm using is more recent then the patch jar file mentioned here.

        Thanks,
        Harry
        Show
        Harry added a comment - Hi All, I've just started using display tag Libraries. I successfully managed to do everything with the libraries. But now I'm having the same export problem as mentioned above. Can you please let me know how to handle this problem. Should I download the patch, that's mentioned here and then change my displaytag library jar version 1.1.1 to this jar file. Please advice. The jar file that I'm using is more recent then the patch jar file mentioned here. Thanks, Harry
        Hide
        Jaume Guillamon added a comment -
        Hi Harry,

        Just download my patch file.

        I'm using java 1.5 and runs fine.

        Best regards.
        Show
        Jaume Guillamon added a comment - Hi Harry, Just download my patch file. I'm using java 1.5 and runs fine. Best regards.
        Hide
        radha added a comment -
        Jaume Guillamon,

        Still unable to fix this issue. I cannot export all records when the display pages are paginated.

        I have deleted the jar files for 1.1.1 that I downloaded from the sourceforge.net web site and replaced them with that of yours (two jar files that you provide above, when I try to use only just one of the jar files, the pages don't even open up).

        There were no issues until here.

        I changed the jsp's as

        <display:table
        name="someSessionList" export="true"
        class="dataTable" defaultorder="ascending" cellspacing="1"
        pagesize="100">

        <display:setProperty name="export.excel.export_amount" value="list"></display:setProperty>
        <display:setProperty name="export.pdf.export_amount" value="list"></display:setProperty>

        <display:column
        title="someTitle"
        property="someProperty"
        ...


        I am displaying 1000 records paginated as 100 per page.

        When I click pdf or excel export, I get only 100 records?


        Here is my displaytag.properties file

        # sort.behavior=list
        # sort.amount=list
        #basic.empty.showtable=true
        basic.msg.empty_list=No results matched your criteria.
        paging.banner.placement=top
        #paging.banner.onepage=<span class="pagelinks"></span>
        export.types=csv excel xml pdf rtf
        export.excel=true
        export.csv=true
        export.xml=true
        export.pdf=true
        export.rtf=true
        export.excel.class=org.displaytag.export.excel.DefaultHssfExportView
        export.pdf.class=org.displaytag.export.DefaultPdfExportView
        export.rtf.class=org.displaytag.export.DefaultRtfExportView
        # if set, file is downloaded instead of opened in the browser window
        #export.[mymedia].filename=
        export.banner=</div><div class="exportlinks">Export options: {0}</div>

        Any suggestions why I am unable to export all the records?

        By the way, I see verions 1.2, 1.3, and 1.4. Where do I get these?

        Thanks
        Krishna
        Show
        radha added a comment - Jaume Guillamon, Still unable to fix this issue. I cannot export all records when the display pages are paginated. I have deleted the jar files for 1.1.1 that I downloaded from the sourceforge.net web site and replaced them with that of yours (two jar files that you provide above, when I try to use only just one of the jar files, the pages don't even open up). There were no issues until here. I changed the jsp's as <display:table name="someSessionList" export="true" class="dataTable" defaultorder="ascending" cellspacing="1" pagesize="100"> <display:setProperty name="export.excel.export_amount" value="list"></display:setProperty> <display:setProperty name="export.pdf.export_amount" value="list"></display:setProperty> <display:column title="someTitle" property="someProperty" ... I am displaying 1000 records paginated as 100 per page. When I click pdf or excel export, I get only 100 records? Here is my displaytag.properties file # sort.behavior=list # sort.amount=list #basic.empty.showtable=true basic.msg.empty_list=No results matched your criteria. paging.banner.placement=top #paging.banner.onepage=<span class="pagelinks"></span> export.types=csv excel xml pdf rtf export.excel=true export.csv=true export.xml=true export.pdf=true export.rtf=true export.excel.class=org.displaytag.export.excel.DefaultHssfExportView export.pdf.class=org.displaytag.export.DefaultPdfExportView export.rtf.class=org.displaytag.export.DefaultRtfExportView # if set, file is downloaded instead of opened in the browser window #export.[mymedia].filename= export.banner=</div><div class="exportlinks">Export options: {0}</div> Any suggestions why I am unable to export all the records? By the way, I see verions 1.2, 1.3, and 1.4. Where do I get these? Thanks Krishna
        Hide
        radha added a comment -
        Sorry about my previous post, it was confusing. Anyways, for others, I think just copying your TableTag.java patch into your own TableTag.java will do the work!!!

        Now I get the java heap space error when exporting decorated. Any work around for this I believe I have to look up my Tomcat and not displayTag libraries? wonder if there is anything in displayTag that I can optimize for memory??

        I am using my custom decorators to include the header, footer, images, and most importantly grouping, sorting, and sub totaling on any of the fields in the pdf, excel exports!!!. Will put this up here for others to comment and use very soon!!!

        By the way, I see verions 1.2, 1.3, and 1.4. Where do I get these?

        Cheers
        Krishna
        Show
        radha added a comment - Sorry about my previous post, it was confusing. Anyways, for others, I think just copying your TableTag.java patch into your own TableTag.java will do the work!!! Now I get the java heap space error when exporting decorated. Any work around for this I believe I have to look up my Tomcat and not displayTag libraries? wonder if there is anything in displayTag that I can optimize for memory?? I am using my custom decorators to include the header, footer, images, and most importantly grouping, sorting, and sub totaling on any of the fields in the pdf, excel exports!!!. Will put this up here for others to comment and use very soon!!! By the way, I see verions 1.2, 1.3, and 1.4. Where do I get these? Cheers Krishna
        Hide
        Carlos Alonso added a comment -
        Hi, all

        Sorry about my poor english, it's not my natural language.

        The problem with "DISPL-292 Export to Excel, PDf y RTF doesn't export all the LIST" in version 1.2 is caused for the class PaginationHelper, and also is necesary the path proposed "DISPL-292-displaytag-patch.txt" by "Jorge L. Barroso".

        The problem with class PaginationHelper is that in the constructor of the class, it haven't got any parameter refer to "especial pagination relation with export", by default always is the same "size of pagination". Then the Iterator that return the method "getIterator()" is minor of the size o all my list to export.

        I can't publish my solution, because it's a concrete solution for my problem, but the only I did it was to include the parameter boolean "export.amount" (this.properties.getExportFullList()) in the construtor for build the correct Iterator of my List with all values, if it is a export table.

        The call to the class PaginationHelper, in the class TableTag, is in the line 1098:
        -------------------------------------------------------------
        1098: PaginationHelper paginationHelper = new PaginationHelper(pageNumber, pagesize);
        -------------------------------------------------------------

        Cheers. Carlos
        Show
        Carlos Alonso added a comment - Hi, all Sorry about my poor english, it's not my natural language. The problem with " DISPL-292 Export to Excel, PDf y RTF doesn't export all the LIST" in version 1.2 is caused for the class PaginationHelper, and also is necesary the path proposed " DISPL-292 -displaytag-patch.txt" by "Jorge L. Barroso". The problem with class PaginationHelper is that in the constructor of the class, it haven't got any parameter refer to "especial pagination relation with export", by default always is the same "size of pagination". Then the Iterator that return the method "getIterator()" is minor of the size o all my list to export. I can't publish my solution, because it's a concrete solution for my problem, but the only I did it was to include the parameter boolean "export.amount" (this.properties.getExportFullList()) in the construtor for build the correct Iterator of my List with all values, if it is a export table. The call to the class PaginationHelper, in the class TableTag, is in the line 1098: ------------------------------------------------------------- 1098: PaginationHelper paginationHelper = new PaginationHelper(pageNumber, pagesize); ------------------------------------------------------------- Cheers. Carlos
        Hide
        krina added a comment -
        after adding the patch it is still not working...i mean not displaying all the records..
        Jaume,can u give me solution...for this..
        thnx..in advance
        Show
        krina added a comment - after adding the patch it is still not working...i mean not displaying all the records.. Jaume,can u give me solution...for this.. thnx..in advance
        Hide
        Angelo Dipierro added a comment -
        I solved this problems without patches by simply doing something like

                if (null != request.getParameter(TableTagParameters.PARAMETER_EXPORTING)) {
                    paginatedList.setObjectsPerPage(paginatedList.getFullListSize());
                }

        Hope this helps.
        Show
        Angelo Dipierro added a comment - I solved this problems without patches by simply doing something like         if (null != request.getParameter(TableTagParameters.PARAMETER_EXPORTING)) {             paginatedList.setObjectsPerPage(paginatedList.getFullListSize());         } Hope this helps.
        Hide
        Angelo Dipierro added a comment -
        Ops. "paginatedList" above is of course my own implementation of org.displaytag.pagination.PaginatedList
        Show
        Angelo Dipierro added a comment - Ops. "paginatedList" above is of course my own implementation of org.displaytag.pagination.PaginatedList
        Hide
        German Ruiz added a comment -
        Hi!

        I have the same problem too - exporting with partial list -.
        I solved it modifying TableTag class, leave the assign of variable "tableIterator" as version 1.1.1 (always this.tableIterator = IteratorUtils.getIterator(this.list) ).

        ¿What 's the function of PaginationHelper? The partial list just have all the items to render o to export.

        Sorry for my bad english :-(

        Germán
        Show
        German Ruiz added a comment - Hi! I have the same problem too - exporting with partial list -. I solved it modifying TableTag class, leave the assign of variable "tableIterator" as version 1.1.1 (always this.tableIterator = IteratorUtils.getIterator(this.list) ). ¿What 's the function of PaginationHelper? The partial list just have all the items to render o to export. Sorry for my bad english :-( Germán
        Hide
        Narmada Devi added a comment -
        Hi,

        Even I have the same problem - exporting only 10 records per page (as I've listed only 10 records per page).

        Can someone help me to sort this issue.
        Pls. also tell the list of all jars that need to be included.

        thanx in advance
        Show
        Narmada Devi added a comment - Hi, Even I have the same problem - exporting only 10 records per page (as I've listed only 10 records per page). Can someone help me to sort this issue. Pls. also tell the list of all jars that need to be included. thanx in advance
        Hide
        Tsena Namsrai added a comment -
        Please use

        export.excel.class=org.displaytag.export.excel.ExcelHssfView

        and

        export.excel.amount=list

        in displaytag.properties
        Show
        Tsena Namsrai added a comment - Please use export.excel.class=org.displaytag.export.excel.ExcelHssfView and export.excel.amount=list in displaytag.properties
        Hide
        himanshu kakar added a comment -
        hii tere'
        i am having problem with exporting rtf.
        this export works, but i am not able to get the full list . i only get the data in the page, when i do export rtf. i am using displaytag1.2 jar and itext1.3 jar. My other export options work fine, only having problem with this rtf. So plz suggest me a solution. i have also set the export.amount in the displaytag.properties to list.but thn also this rtf didnt workd.
        so plzzz help me with full solution for this rtf export (to export the whole list)
        Thanx in advance
        Show
        himanshu kakar added a comment - hii tere' i am having problem with exporting rtf. this export works, but i am not able to get the full list . i only get the data in the page, when i do export rtf. i am using displaytag1.2 jar and itext1.3 jar. My other export options work fine, only having problem with this rtf. So plz suggest me a solution. i have also set the export.amount in the displaytag.properties to list.but thn also this rtf didnt workd. so plzzz help me with full solution for this rtf export (to export the whole list) Thanx in advance
        Hide
        Martin Irigaray added a comment -
        Are there any solutions for this problem?. How can i get the PDF exported with Captions and Footers and the full list ?. Thanks.
        Show
        Martin Irigaray added a comment - Are there any solutions for this problem?. How can i get the PDF exported with Captions and Footers and the full list ?. Thanks.
        Hide
        Martin Irigaray added a comment -
        Ok, i saw the problem is on class TableWriterTemplate, in the line RowIterator rowIterator = model.getRowIterator(false); Is calling always with false, that's why always use the page result. Insted of changing the source of displaytag, i copied the TableWriterTemplate and all the classes (export and render folder) that dependes on it, to my project and rename it. Then selected my new classes in the displaytag properties file. And changed the parameter for true.
        Show
        Martin Irigaray added a comment - Ok, i saw the problem is on class TableWriterTemplate, in the line RowIterator rowIterator = model.getRowIterator(false); Is calling always with false, that's why always use the page result. Insted of changing the source of displaytag, i copied the TableWriterTemplate and all the classes (export and render folder) that dependes on it, to my project and rename it. Then selected my new classes in the displaytag properties file. And changed the parameter for true.
        Hide
        Jonathan Gordon added a comment -
        The following works for me in development. Fix is to overload the writeTable method, adding a boolean which is passed to the getRowIterator method. I can also supply a patch if that's easier.
        Show
        Jonathan Gordon added a comment - The following works for me in development. Fix is to overload the writeTable method, adding a boolean which is passed to the getRowIterator method. I can also supply a patch if that's easier.
        Hide
        Jonathan Gordon added a comment -
        My comment above is in reference to the TableWriterTemplate.java file that I attached.
        Show
        Jonathan Gordon added a comment - My comment above is in reference to the TableWriterTemplate.java file that I attached.
        Hide
        fabrizio giustina added a comment -
        looks already solved in svn, unit test added
        Show
        fabrizio giustina added a comment - looks already solved in svn, unit test added

          People

          • Reporter:
            Jaume Guillamon
          • Votes:
            7 Vote for this issue
            Watchers:
            12 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: