Integration examples

Below is an example of integrating the reporting functions into an instance of the API. For more general examples of using the API, see Pseudocode Example Of Batch API. This integration example assumes you have knowledge of the API functions. For more information on these, see Suppression- Specific Functions.

Integrating XML reports

The conventions within the pseudocode are below:

Convention Meaning
/* Comment */ Italic text between asterisks and forward slashes denotes a comment.
[QABatchWV_DataSetInfo] The functions which relate to each part of the pseudocode appears on the right hand side of the page.
[QABatchWV_Open (Close)] Some API functions are 'paired', i.e. when a function is called, its pair must also be called at some point. When a paired function is used in the pseudocode, its pair appears in brackets directly after the function name.

Pseudocode listing

/* Before calling any function in the Batch API, you must initialise it with QABatchWV_Startup. Once initialised, you must open an instance of the API
*/

Initialise API                                          [QABatchWV_Startup (Shutdown)]
    Initialise an instance of the API                   [QABatchWV_Open (Close)]
        Open a counter handle [QABatchWV_ CounterOpen   (CounterClose)]

/* Once the counter handle is open, addresses may be cleaned in the normal way. For more information on how to do this, see Batch API Functions, and for examples see Pseudocode Example Of Batch API. Each address cleaned will be added to the open report, as well as information about the number of clicks used. When address cleaning is completed, you can output the information stored in the open report. */

            Extract report using counter handle         [QABatchWV_ CounterReport]

/* A XML report is returned into the specified buffer as a string. You can clean further addresses and extract the report as many times as required. Once completed, close the counter instance and the instance of the API */

        Close the counter handle                        [QABatchWV_ CounterClose]
    Close instance of API                               [QABatchWV_Close] 
Shutdown API                                            [QABatchWV_Shutdown]

Viewing the report

To view XML reports generated by QABatchWV_CounterReport:

  1. Write the contents of the QABatchWV_CounterReports output buffer to an .xml disk file.
  2. A stylesheet is provided with Batch to convert the XML into a browser based report.
    To generate the report, ensure that the XSL stylesheet and the flash components (supplied with Batch) have been copied into the same directory as the XML file.
  3. The report will be displayed when the XML file is opened in your Internet Browser.