Creating a report with on-the-fly filtering

Sometimes you may have a report that you'd like to generate for different sets of elements in your project without rewriting the custom report. Report parameters make this pretty easy to do. The article at http://casecomplete.zendesk.com/entries/20047751-passing-parameter-values-to-reports can get you started with report parameters so that you are prompted for values when you generate the report.

Here's a simple example, below. This report will prompt for the name of the release for which use cases are reported:

$info

                $description “use a parameter to specify what to report on”

                $param $$WhichRelease

$endinfo

 

$repeatUseCases where Release = $$WhichRelease

$Name ($ID)

$endrepeatUseCases

 

The only problem with this report is that if you want to show use cases for any release, there's no way to specify that. The fix, though, is simple. The report below uses $IF statements in the report to conditionally determine whether to apply filtering to the report, or to report on everything based on whether the parameter value contains something or is empty, respectively. Each $IF section is tested, and is included in the report if the criteria is true. Otherwise, it's ignored. Here's the report template:

$info

                $description “use a parameter to specify what to report on”

                $param $$WhichRelease

$endinfo

 

$if $$WhichRelease <> ‘’

$repeatUseCases where Release = $$WhichRelease

$endif

$if $$WhichRelease = ‘’

$repeatUseCases

$endif

$Name ($ID)

$endrepeatUseCases

Have more questions? Submit a request
Was this article helpful?
1 out of 1 found this helpful

Comments

  • Avatar
    Jason Miceli

    This worked perfectly - thanks!  

    However, the reason I needed to take this approach was because it seemed like the function to report on only selected items was not working.  I thought I saw it work fine one time, but here I was trying to select just items in a certain release and create a report based on those selected items - instead the report contained NO items.  I tried this a bunch of times with a few different report types and a bunch of different selections, ranging from 1 item to all items, but every time I selected "Selected Items" the final report would contain nothing.  Ideas?

  • Avatar
    Jason Payne

    Hey Jason,

    Glad the filtering worked out for you, but the reason behind why you needed to use it is definitely something we want to address. If you would, please send an email to us (support@serlio.com) and let us know a few things, at least initially:

    • What version of CaseComplete are you running? Click File / Help on the ribbon bar, then the version number is on the right side.

    - If you're using customized templates, please send those over to us to help evaluate. If built-in, just let us know which ones you tried.

    • If you could, send some screenshots of your project data - or at least which element types you selected for which report so that we can gain a better understanding of where the problem lies. Maybe another, easier comparison we could make is if you were to try the same actions on the Loan Processing sample project, and let us know the details.

    Thanks!

Powered by Zendesk