The ReportOptions is mandatory: XmlIn property or OptionsName property or embedded resource.
The ReportOptions object contains all the data needed to generate a report, such as the SearchConditions to retrieve data from the GN4 database, the XSLT stylesheet to generate the report XML and list of output columns (aggregated or not). See here for a complete description of the ReportOptions object.
The ReportOptions can be passed to the Report activity in three ways:
1.Loading the ReportOptions as embedded resources, at the bottom of the workflow file. In this case, the wfres:ActivityName attribute of the ReportOptions tag must match the x:Name attribute of the Report activity.
For example:
<wfres:workFlow
xmlns:wfres="http://www.teradp.com/schemas/GN4/1/WFRes.xsd">
<SequentialWorkflow
x:Name="mainWorkflow"
DisplayProgress="true"
xmlns="http://www.teradp.com/schemas/GN4/1/Workflow/Activity"
xmlns:gn4wf="http://www.teradp.com/schemas/GN4/1/Workflow"
xmlns:common="http://www.teradp.com/schemas/GN4/1/Common"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wf="http://schemas.microsoft.com/winfx/2006/xaml/workflow"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:coll="clr-namespace:System.Collections;assembly=mscorlib">
<Report
x:Name="createReport" />
</SequentialWorkflow>
<!-- workflow resources - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<ropt:ReportOptions
wfres:activityName="createReport"
xmlns:ropt="http://www.teradp.com/schemas/GN4/1/ReportOptions.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
NavOptions="None"
TableName="myReportTable">
<Xslt xmlns="http://www.teradp.com/schemas/GN4/1/XmlExportOptions.xsd">
. . .
</Xslt>
<Conditions xmlns="http://www.teradp.com/schemas/GN4/1/SearchConditions.xsd">
. . .
</Conditions>
<ropt:Columns>
. . .
</ropt:Columns>
</ropt:ReportOptions>
</wfres:workFlow>
2.loading the ReportOptions from a configuration file already imported into the GN4 database. In this case the name of the ReportOptions configuration file is specified by the OptionsName activity's property.
The OptionsName activity's property is analogous to the 'srv4 report -opt ...' option and '...do.ashx?cmd=report&name=...' option (write 'srv4 help report' in command-line or open '...do.ashx?cmd=help&name=report&x=docBook' in browser for more info about it).
In the following example:
<Report
x:Name="createReport"
OptionsName="test" />
the activity Report loads from the GN4 database the 'report_test' config file containing the declaration of the ReportOptions to use.
3.loading the ReportOptions from a physical xml file. Just like the 'srv4 report -opt...' command, the Report activity can receive the ReportOptions as xml document.
The xml configuration file is passed to the Report activity as the XmlIn property.
Here is a example of a workflow which loads the ReportOptions from the filesystem:
. . .
<!-- read the physical file -->
<Fetch
x:Name="loadConfigFile"
Url="e:\tera\gn4\test\report_test.xml" />
<!-- read the xml data from the file -->
<LoadXml
x:Name="loadXmlFile"
Data="{wf:ActivityBind loadConfigFile, Path=DataOut}" />
<!-- generate a report -->
<Report
x:Name="createReport"
XmlIn="{wf:ActivityBind loadXmlFile, Path=XmlOut}" />
. . .
|