STEM help

8.6.3 Interaction with the web service

The web service provides three methods to support interaction with exported reports:

  • IsExportReportsAvailable(): determines whether any report templates are defined for this model. Returns a zero status code if the ExportReports() method should work, or non-zero if no report templates are defined or if an error occurs.
  • ExportReports(): runs the model with the given set of input values and generates reports from all templates configured for the model on the server. Returns the intended download link text and location(s) (relative to the online server root) if successful.
  • ExportMatchingReports(): generates reports only for a subset of the configured templates that match filename prefix or extension filters.

Note: a complete outline of all of the available methods can be obtained directly from the web service at any time by visiting https://stem.impliedlogic.com/StemWebService.asmx.

An example of the usage of these methods can be found in the stemlib.js file within our generated HTML interface logic, and specifically the following two functions which provide the necessary SOAP encapsulation for the web-service methods above:

  • try_show_export_report_button(): which shows or hides the relevant button
  • export_report(): which calls the separate parse_export_report_response() function to format the hyperlink to the download location(s) if the export is successful.
 

© Implied Logic Limited