Menu

one dynamic table on multiple pages

Users
none
2008-02-14
2013-04-25
  • none

    none - 2008-02-14

    Hi there, first I want to thank Mirko for the great job on JODReports, this API helped me a lot to do what I wanted.

    And here'are the problems i'm facing now :
    1)one dynamic table on multiple pages
    I got a template with a table listing items into table-rows, but when the table reaches the end of the page(due to the high number of items) it doesn t go to the next page.

    is there any easy way to fix it that I've not noticed? only thing I see if there's none is making a list of image list's, each list would contain the right number of images. Then I would iterate over first list in text:section, and in each text section i would iterate over the contained list in table:table-row, like this :

    /*******section-begins******/
    @text:section
    [#list item.imagesPerPages as images]  //note that images is a list containing the right number of image per page.
    @/text:section
    [/#list]
      /******table begins******/  
      @table:table-row
      [#list images as image]
      @/table:table-row
      [/#list]
      
      // display informations about image... ${image.path} etc

       /******table ends******/

    /******section ends******/
    outtopic :
    2)dynamic image list
    I didn't find any way to handle dynamic list of images, and browsing this forum I saw I wasn't the only one. (like trying to display each image of the list while not knowing the size of this list),
    so I made a template this way :

    in a table there's this script :

    @table:table-row
    [#list object.images as image]
    @/table:table-row
    [/#list]

    object is of course the object I merge.
    then I put ${image.path} into the image description of the image into a table:table-row; s
    then I made a post-processor (using your pre-processor as a model) that would search content.xml for images having a description element looking like this "#replaceC:/path/to/image" ("#replace" is just a prefix I used to recognize the images that needed to be treated). then it was a piece of cake to insert the new images into the final zipoutput and add the corresponding name to the "href" of each image.

    Anyway, I thought I'd share this, but it only works with images that actually exist as files, and not with streams, so its not that good of a solution, so I'll ask, is there gonna be any update on jodreports that would handle it better ? 

    again, thanks for your work on this api!!

     
    • Mirko Nasato

      Mirko Nasato - 2008-02-17

      Hi,

      For the dynamic image list, if you feel adventurous try the code in Subversion that includes support for it.

      For the table not going to the next page, that's weird, it usually goes to the next page without problems. I do remember a vaguely similar problem in the past though, that turned out to be an OpenOffice.org bug

        http://qa.openoffice.org/issues/show_bug.cgi?id=71806

      Try rearranging your template layout in one way or another.

      Kind regards

      Mirko

       
    • none

      none - 2008-02-18

      Hi Mirko.

      Thanks for replying.

      Well I found my way out by doing this :
      segmented the big list into several list of 3 items, displayed each list on a page in a table.
      I found out that when using text secionts openoffice makes the page breaks itself, but it buggued for me after 3 pages, so I did the pagebreaks myself into text section and that's the solution we will use for now.

      (I had a text section which was repeated for each list of 3 item I had, so basically for 9 items I would have 3 text sections, in this text-section I had put a table in order to display the 3 elements, as the element and layout I had to make was kinda complex I had to use a cadre into the table. Letting openoffice make the page breaks lead to the disapearing of the right part of my first cadre/element in the third page, no idea why, and only the first element of the third page was screwed up, the next element was ok).

      so basically I modified the structure of the item I merge with the template and managed it another way into the template, tho  thats kinda complex.

      for dynamic image List, i made a filter myself, using your preprocessor to put image path's into image description, then treat each image by inserting the picture with the given path into "Pictures/" in the final odt, and replacing the href by the new one.

       

Log in to post a comment.