Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Ans: Yes. You need to implement the sorting function directly within the HTML template as shown below (before the start of <html> tag).

Syntax

Code Block
#set($numItems = $items.size())
#set($range = $numItems - 1)
#foreach ($i in [0..$range])
  #set($subRange = $range - $i - 1)
  #if ($subRange >= 0)
    #foreach ($j in [0..$subRange])
      #if ($items.get($j).specimen.ppid.compareTo($items.get($j + 1).specimen.ppid) > 0)
        #set ($temp = $items[$j])
        #set ($items[$j] = $items[$j + 1])
        #set ($items[$j + 1] = $temp)
      #end
    #end
  #end
#end

...