Post

1 follower Follow
0
Avatar

Report on items based on related documents

Hi!

Not sure if this is possible, but I would like to include a conditional text block based on the existence of a related document for a specific package (so I don't think I can use "where RelatedDocuments exist").  Here's one version of the code I tried, which does not work:

_$if numberOfRelatedDocuments where Package = ‘Data Requirements’ > 0 _

Entity Relationship Model

$listRelatedDocuments where Package = Data Requirements

$endif

 

When I use this block, I get the following error:

The following will help CaseComplete support engineers diagnose this issue. Please paste into an email and send to support@serlio.com.

Version: 6.0.4139.24201

OS: Microsoft Windows NT 5.1.2600 Service Pack 3

Word version: 12

Report Template : T:\Resources and Templates\Baseline\Templates\BRD Template - CC 2011.docx

System.Exception: "where" is not a valid operator in "numberOfRelatedDocuments where Package = ‘Data Requirements’ > 0"

   at ih.b(a A_0)

   at ih.a()

   at ih.b()

   at ih.c()

   at ih.c(String A_0)

   at ih..ctor(String A_0, ie A_1)

   at ie.a(Element A_0, String A_1, i7 A_2, Object A_3)

   at ie.c(Element A_0, i7 A_1)

   at ie.h(String A_0)

   at es.a(ie A_0)

 

My attempts are based on this (from the Custom Reports document):

This keyword displays the number of items in the given list.  You can combine $numberOf with any valid list contents, e.g. $numberOfActors, or $numberOfOpenIssues (see the resource section for valid list contents).  You may also add a where clause (see section 4) to display the number of items that conform to a specific set of criteria, for example:

$numberOfUseCases where ID = 1 and Release = 1.0

 

Tom Tomasovic Answered

Please sign in to leave a comment.

2 comments

0
Avatar

Hi Tom,

You can't follow an if statement with a where, that's why you're getting the error.

We recently added two new keywords that should help you out: $showonce and $when

To use $showonce, you could use this:

$repeatRelatedDocuments where Package = Data Requirements

$showonce

Entity Relationship Model

$endshowonce

$Name

$endrepeatRelatedDocuments

To use the $when, it would be:

$whenRelatedDocuments where Package = Data Requirements

Entity Relationship Model

$listRelatedDocuments where Package = Data Requirements

$endwhenRelatedDocuments

The details on these new keywords can be found in the Custom Report User Guide. Please note - there is a slight issue with $when keyword right now, it will only work if it's nested within a $repeat or $Outline. We're planning on releasing a new update later today that will include a fix that will allow you to use the $when right at the top level.

Jeff Marver 0 votes
Comment actions Permalink