Support

 View Only
  • 1.  Jama variables and tools available to Velocity Reports

    Posted 10-07-2022 07:16
    Edited by Jeff Abbott 10-07-2022 12:33

    I'm trying to generate a report from a set of item types that includes a folder hierarchy. 

    I have set my report to be context sensitive so that $documentList includes all item types. However I am unable to return any fields at all through either $doc.getCustomFields() or $velocityReportUtil.getValueForField().

    I would greatly appreciate a generic example that simply iterates over the fields (picklists, string#, and integers) of an ContourItem and prints those out in an HTML velocity template.



  • 2.  RE: Jama variables and tools available to Velocity Reports

    Posted 10-07-2022 11:19

    Quick Guide:
    https://community.jamasoftware.com/blogs/shawnna-williams/2021/06/25/navigating-the-velocity-api-documentation

    Velocity Report Util:
    http://velocity.jamasoftware.com/latest/OldVelocity/com/jamasoftware/contour/report/util/VelocityReportUtil.html

    Jama API
    http://velocity.jamasoftware.com/latest/OldVelocity/overview-summary.html



    ------------------------------
    Jeff Abbott
    Leidos
    Orlando FL
    ------------------------------



  • 3.  RE: Jama variables and tools available to Velocity Reports

    Posted 10-08-2022 08:37
    #foreach($docitem in $documentList)
    do something with $docitem.document
    or call a method from $documentSource by using the item id ($docitem.document.id)
    #end ​

    ------------------------------
    Alessandro
    Systems Engineer
    SICK AG
    ------------------------------



  • 4.  RE: Jama variables and tools available to Velocity Reports

    Posted 10-10-2022 06:49

    Thanks for the pointer Alessandro,

    I found my first problem which as not setting $doc = $vDoc.document.  To my surprise, the custom fields were also retrievable using $velocityReportUtil.getValueForField($doc, "req_list_type", $dateFormat ))
    However, my new challenge is not being able to access the attachments (figures) on each item. Neither of these two methods work for me:

    #set( $attachmentList = $attachmentDAO.getDocument_DocAttachments($mathTool.toInteger($docI.Id) )
    #set($attachmentId= $doc.getAttachment())

    Jeff



    ------------------------------
    Jeff Abbott
    Leidos
    Orlando FL
    ------------------------------



  • 5.  RE: Jama variables and tools available to Velocity Reports

    Posted 10-10-2022 08:40

    Hey Jeff, 
    are you using a Jama version < 8.42?

    DAOs are not available in newer versions.
    Here you can use $documentSource.getAttachment($mathTool.toInteger($nAttId))



    ------------------------------
    Alessandro
    Systems Engineer
    SICK AG
    ------------------------------



  • 6.  RE: Jama variables and tools available to Velocity Reports

    Posted 10-10-2022 10:47
    Right, sorry for the confusion.  I am setting $attachmentDao as follows:
    #set( $attachmentDao = $documentSource )

    Jeff

    ------------------------------
    Jeff Abbott
    Leidos
    Orlando FL
    ------------------------------



  • 7.  RE: Jama variables and tools available to Velocity Reports

    Posted 10-10-2022 13:55
    I have resolved my problem. I was preparing an example for Jama support when my sample script suddenly worked. I must have changed something since yesterday, but I don't know what that was.

    ------------------------------
    Jeff Abbott
    Leidos
    Orlando FL
    ------------------------------