Adding a report

The following procedure assumes you have already logged onto the APS and have a current session (see Authenticating and logging on the user for information on creating a session):

To add a report
  1. Retrieve the PluginManager Object.

    The PluginManager allows you to retrieve the Report plugin, which is needed to create a report object.

  2. Retrieve the Report plugin by passing the plugin's ProgID to the PluginInfo property of the PluginManager.
  3. Create an empty InfoObjects Collection using the NewInfoObjectCollection Method in the InfoStore Object.
  4. Call the Add Method using the newly created InfoObjects Collection and the Report plugin.

    The InfoObjects Add method creates a new InfoObject based on the type of plugin you give it. In this case, it creates a new Report object and adds it to the collection. It is important to note that a report object is a type of InfoObject.

  5. Using the newly created Report object, add the report data to the InfoObjects Collection. Do this using the collection's Add method.

    The report data may be specified in the form of a path and filename, or in a binary stream format that contains the report data. If a path is specified it must be a valid path on the WCS. For information on transferring the file from a browser to the web server, refer to your web server documentation.

  6. Specify the folder into which the report will be placed.

    The folder into which the report is to be placed is set using the report's parent ID. If the ID is zero or the ID does not belong to a folder, the report will not be added; otherwise it is placed in the folder specified by the SI_PARENTID Property.

  7. As an optional step you can enable the report's thumbnail image using the EnableThumbnail Property.
  8. Commit the new collection to the APS using the InfoStore's Commit Method.

    This adds the report to the File Repository Server and updates the APS InfoStore.

These steps are illustrated in the following Example.



Crystal Decisions, Inc.
http://www.crystaldecisions.com
Support services:
http://support.crystaldecisions.com