delarosa62 wrote:
Does some one know how to implement these methods in VBA using OTA?. What kind of arguments they take and what they should return?.
The document says it all.
First, you don't need to use the SetConnection method : you can just set the Connection property.
Second, the parameters for the Generate method are described as :
[id(7), helpstring("Generate report.")] HRESULT Generate([in,optional,defaultvalue(0)] long BeginIndex, [in,optional,defaultvalue(0)] long EndIndex, [out, retval] long* Total);
So : the first one is a BeginIndex, it is optional and its default value is 0. The second one is EndIndex, it is optional and its default value is 0. The return value is Total. The indexes allow to generate parts of the report (from 1 to 10, then 11 to 20, and so on). The Total value is the total number of items listed in the report.
Here is some VBA code that used to work, 6 years ago :
Dim TDReporter Dim TestFilter Set TestFilter = TDConnection.TestFactory.Filter ' Here set some filter criteria... Set TDReporter = CreateObject ("OtaReport80.Reporter") ' TDConnection is a global in the workflow TDReporter.Connection = TDConnection ' Set Reportconfig before the filter TDReporter.ReportConfig.xml = "some xml file.xml" ' see below TDReporter.Object = TestFilter TDReporter.File = "some file.htm" ' will be the output TDReporter.Template = "some template" ' see below TDReporter.Debug = False TDReporter.Generate 0
The ReportConfig.xml looks like :
<config> <template>template.xsl</template> <report_config attr_flag="0" view="detailed" history="n" attach="y" td_type="test"><description/> <filter>[Filter]</filter> <fields> <field name="TS_NAME"/><field name="TS_VTS"/><field name="TS_SUBJECT"/><field name="TS_RESPONSIBLE"/><field name="TS_DESCRIPTION"/></fields> <subreport_config attr_flag="0" view="grid" history="n" attach="n" td_type="desstep"><fields><field name="DS_STEP_NAME"/><field name="DS_USER_02"/><field name="DS_DESCRIPTION"/><field name="DS_EXPECTED"/></fields></subreport_config></report_config></config>
The Object and Template properties of the Reporter object replace the <filter> and <template> definitions of the ReportConfig xml.