Forum Discussion
3 Replies
- KristenastewartNew ContributorThe different sub tabs gives you access to the underlying XML for main reports, sub reports and templates as well as project level report parameters. Project level items can be created, removed and edited as desired, while global items can not be modified inside soapUI. They have to be modified in the file system and reloaded with the Reload button in the top toolbar for changes to be applied (more on that later on).
2. Report Structure
soapUI structures reports as follows:
Main Reports are the top level templates which are shown in the Create Report dialog and visible in the Available Reports tab above. A Main Report template is a standard jasperReport template which receives the report-scope specific model item as its DataSource, for example when generating a LoadTest report the data object passed to the report is a WsdlLoadTest, whose properties can be defined as Jasper fields in the report and used as such.
Main reports can include any number of Subreports (shown in the Subreports tab) through the standard JasperReports subreport mechanism in combination with a soapUI-specific URL prefix ("subreport:"). A Subreport gets its data from the specified DataSource which is available when the report is being generated. Looking at the Subreports tab we can see all available subreports and their corresponding DataSource:
subreports-tab
For example, the MetricsReport subreport gets its data from ReportMetrics DataSource and is included in the all main reports with the following syntax:
1.y="98" width="535" height="30" isRemoveLineWhenBlank="true"> $P{IncludeResults} ... $P{TestSuiteMetrics} "subreport:MetricsReport"
As you can see the subreportExpression uses a soapUI-specific "subreport:" URL-syntax which soapUI uses to locate the specified SubReport template. The fields exposed by the TestSuiteMetrics DataSource are correspondingly defined in the MetricsReport template:
1.......
Templates allows for management of common blocks of template XML. The tab is as follows:
templates-tab
The above example template can then be inserted to any report with the familiar property expansion syntax:
template-example
Finally, Parameters allow for parameterization of report content without the need of recompiling the underlying template. The Parameters tab allows you to add parameter values as desired:- SK-SlyNew Contributor
Thanks for the input.
I still have some questions. Maybe I try to explain it on this example.
I'd like to customize the Project Overview report that is contained in the default projectReport. The report contains some categories. What I'd like to do is to disable most of them for my report. Actually I'd like to see only the "Base Metrics" category in my report.
I figured out that the report is based on the ReportMetrics data source that serves category, name, value and icon data.
As far as I understand Jasper, a solution could be to put a filter between the data source and the report. In this filter I could block all categoried beside "Base Metrics". Am I on the right track?
I installed iReport and trying to do it. Sandy with no success. Could anybody provide an example (*.jrxml) how to filter the ReportMetrics data source?
Thanks!
- SK-SlyNew Contributor
I found a solution:
The filter can be set in the subReport.
What I did in MetricReport.jrxml is to put a
<filterExpression> node diretly under the <jasperReport> node:
<filterExpression><![CDATA[!(
$F{category}.equals("Interface Summary") ||
$F{category}.equals("Overview") ||
$F{category}.equals("Virt Summary")
)
&&
!(
$F{name}.equals("Number of LoadTests")
)]]></filterExpression>
This allows to customize the metrics report and switch off categories and entries.