Release Notes and Announcements

Expand all | Collapse all

Velocity Reports: Obtaining the size of the document list

  • 1.  Velocity Reports: Obtaining the size of the document list

    Posted 06-05-2017 18:40
    $documentList.size doesn't seem to work.  The report is context sensitive, so the $documentList is there, so that's not the problem.

    I have created the following macro, and passed the $documentList to it, and gotten the size, but surely there's a simpler way.

    #macro(size $aList)
    #set($listIndex = 0)
    #foreach($vItem in $aList)
    #set($listIndex = $listIndex + 1)
    #end
    #set($listSize = $listIndex)
    #end

    What am I missing?  a call to a Java list method (Java is not my default language of choice)?  Thanks in advance for any help!

    ------------------------------
    Brian Nolan
    Solute, Inc.
    San Diego CA
    ------------------------------


  • 2.  RE: Velocity Reports: Obtaining the size of the document list

    Posted 06-07-2017 08:54
    I would try  $documentList.size().

    Rationale: the document list should be a java list, size() should deliver # of elements.

    List (Java Platform SE 8 )




    ------------------------------
    Harald Hotz-Behofsits
    Frequentis AG
    ------------------------------