Ready to get started?

Learn more about Sage US Connectivity Solutions

Learn More

Feed Sage US Data into FineReport

How to set Sage US data as a JDBC data source in FineReport.

The CData JDBC Driver for Sage US fully implements the JDBC standard and can provide Sage US data connectivity to a wide variety of BI, reporting, and ETL tools and custom applications. In this article, we explain how to set Sage US data as JDBC data source in FineReport and view Sage US data as a table in the Report Designer.

Set Up a JDBC Data Source of Sage US Data

Follow the instruction below to set Sage US data as a FineReport database connection.

  1. Copy the cdata.jdbc.sage50us.jar file from the lib folder in the CData JDBC Driver for Sage US installation directory to the lib folder of the FineReport installation directory. You will need to copy the cdata.jdbc.sage50us.lic file as well.
  2. From the Server tab, select Define Data Connection, click to add a new connection, and click JDBC.

Next we will set up the data connection definition in the window.

  1. Database: Others
  2. JDBC Driver: cdata.jdbc.sage50us.Sage50US Driver
  3. URL: A standard JDBC connection string using semicolon-separated connection properties.

    The Application Id and Company Name connection string options are required to connect to Sage as a data source. You can obtain an Application Id by contacting Sage directly to request access to the Sage 50 SDK.

    Sage must be installed on the machine. The Sage.Peachtree.API.dll and Sage.Peachtree.API.Resolver.dll assemblies are required. These assemblies are installed with Sage in C:\Program Files\Sage\Peachtree\API\. Additionally, the Sage SDK requires .NET Framework 4.0 and is only compatible with 32-bit applications. To use the Sage SDK in Visual Studio, set the Platform Target property to "x86" in Project -> Properties -> Build.

    You must authorize the application to access company data: To authorize your application to access Sage, restart the Sage application, open the company you want to access, and connect with your application. You will then be prompted to set access permissions for the application in the resulting dialog.

    While the compiled executable will require authorization only once, during development you may need to follow this process to reauthorize a new build. To avoid restarting the Sage application when developing with Visual Studio, click Build -> Configuration Manager and uncheck "Build" for your project.

    Built-in Connection String Designer

    For assistance in constructing the JDBC URL, use the connection string designer built into the Sage US JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.

    java -jar cdata.jdbc.sage50us.jar

    Fill in the connection properties and copy the connection string to the clipboard.

    When you configure the JDBC URL, you may also want to set the Max Rows connection property. This will limit the number of rows returned, which is especially helpful for improving performance when designing reports and visualizations.

    A typical JDBC URL is below:

    jdbc:sage50us:ApplicationId=8dfafu4V4ODmh1fM0xx;CompanyName=Bellwether Garden Supply - Premium;
  4. Click Connection pool attributes and set Test before getting connections to No.

Click Test connection to ensure you have configured the connection properly. With the connection to Sage US set up, you can use it as FineReport data source.

Select Sage US Data in the Report Designer.

  1. Click to add a new template data set and select DB query to open the database query window.
  2. Choose the JDBC connection that you created from the dropdown list.
  3. The Sage US entities will appear as tables on the left pane.
  4. Write a SELECT statement for the Sage US data tables and columns that you want to load.
  5. Click preview and data is shown as table.

With these simple steps, Sage US can be used as a JDBC data source in FineReport.