In order to use SQProxy from a .NET application you must use the SQProxyWrapper, SFQWrapper, and interop libraries we have provided. To do so, add references to these libraries to a .NET project: right-click References in the Solution Explorer, choose Add Reference, select the Browse page, and choose the following three files, all located in C:\Program Files\Common Files\Microsoft Shared\VFP:

  • SQProxyWrapper.dll
  • SFQWrapper.dll
  • Interop.sqproxy.dll

Be sure to change the properties for Interop.sqproxy.dll: Embed Interop Types should be false and Copy Local true.

You can then use the wrappers with code like the example below:

using SFQWrapper;
using SQProxyWrapper;

namespace ConsoleApplication1
  class Program
    static void Main(string[] args)
      SQProxy sqProxy = new SQProxy();

      sqProxy.LoadProject(@"C:\Program Files\Stonefield Query SDK\Sample Project");

      // Wait for project to finish loading
      while (!sqProxy.ProjectLoaded)

      System.Console.WriteLine("Project Loaded");

      // Get references to some objects we'll need.
      SFQApplication application = sqProxy.SQApplication;
      ReportEngine reportEngine = application.ReportEngine;

      // Find out how many folders there are.
      System.Console.WriteLine("There are " + 
        reportEngine.GetFolders().Count.ToString() + " folders");

      // Display the folder names.
      foreach(Folder folder in reportEngine.GetFolders())

      // Run a report.
      bool result = reportEngine.RunReportToFile("Customers", 

      if (result)
        System.Console.WriteLine("The Customers report was output to PDF.");
        System.Console.WriteLine("The Customers report was not run successfully.");


© Stonefield Software Inc., 1996-2020 • Updated: 09/18/18
Comment or report problem with topic