Custom Output

A Custom Output plugin allows you to specify a custom output type for a schedule. By default, Stonefield Query can email a report or upload it to an FTP site. This plugin allows you to specify a new type, like uploading to Azure, or storing in a local document database, for example.

A Custom Output plugin implements the IStonefieldQueryCustomReportOutputPlugin interface in Interfaces.dll and uses the StonefieldQueryCustomReportOutputPluginAttribute attribute. Your plugin needs references to the Collections, Enums, Interfaces, PluginManager, and System.ComponentModel.Composition assemblies (the first four are Stonefield Query assemblies and the latter is a Nuget package). It may also need references to other Stonefield Query assemblies, depending on what the plugin does; these can be found in the SQWeb folder.

Studio can generate the source code for a plugin for you; see the Generating Plugin Source Code topic for details.


Here's the definition of IStonefieldQueryCustomReportOutputPlugin:

using Stonefield.Query.ReportEngine;
using System.IO;

namespace Stonefield.Query.Plugins
    /// <summary>
    /// The interface that Custom Output type plugins must implement.
    /// </summary>
    public interface IStonefieldQueryCustomReportOutputPlugin : IStonefieldQueryBasePlugin

        /// <summary>
        /// The descriptive name the end user will see for this output type
        /// </summary>
        string Caption { get; }

        /// <summary>
        /// Executes after a report is finished. Use this method to perform the output
        /// type (e.g. upload to FTP, save to disk, etc...)
        /// </summary>
        /// <param name="report">
        /// The report being run.
        /// </param>
        /// <param name="reportStream">
        /// The Stream containing the report contents
        /// </param>
        /// <param name="filename">
        /// The name of the file that should be created.
        /// </param>
        bool PerformOutput(IReport report, Stream reportStream, string filename);

(As with all plugins that derive from IStonefieldQueryBasePlugin, it also has an Application member; see the Plugins topic for information about Application.)


The StonefieldQueryCustomReportOutputPlugin attribute on the plugin class has the usual set of parameters all plugin attributes do; see the Plugins topic for details. Here's an example:

        Version = "",
        ExecutionPriority = 5)]

    public class CustomAzureOutputPlugin : IStonefieldQueryCustomReportOutputPlugin

Plugin methods

Custom output plugins have the following methods and properties:

© Stonefield Software Inc., 2021 • Updated: 03/01/21
Comment or report problem with topic