Integrate with Webflow Data in JReport Designer

Jerod Johnson
Jerod Johnson
Director, Technology Evangelism
Create charts and reports based on Webflow data in JReport Designer.

The CData JDBC Driver for Webflow data enables access to live data from dashboards and reports as if Webflow were a relational database, allowing you to query Webflow data using familiar SQL queries. This article shows how to connect to Webflow data as a JDBC data source and create reports based on Webflow data in JReport Designer.

Connect to Webflow Data

  1. Edit C:\JReport\Designer\bin\setenv.bat to add the location of the JAR file to the ADDCLASSPATH variable:
    ...
    set ADDCLASSPATH=%JAVAHOME%\lib\tools.jar;C:\Program Files\CData\CData JDBC Driver for Webflow 2016\lib\cdata.jdbc.api.jar;
    ...
    
  2. Create a new data source by clicking File New Data Source.
  3. In the resulting dialog, create a name for the data source (CData JDBC Driver for Webflow), select JDBC, and click OK.
  4. In the Get JDBC Connection Information dialog you will configure your connection to the JDBC driver:
    • Driver: Be sure that the Driver box is checked and fill in the name of the class for the driver:
      cdata.jdbc.api.APIDriver
    • URL: Enter the JDBC URL. This starts with jdbc:api: and is followed by a semicolon-separated list of connection properties.

      Authentication

      Webflow uses OAuth 2.0 authentication to ensure secure access to sites, CMS collections, e-commerce data, and other resources. This authentication method allows you to securely connect to your Webflow workspace and manage resources with proper authorization.

      OAuth 2.0 Setup and Configuration

      Step 1: Create a Webflow OAuth Application

      To set up OAuth authentication:

      1. Visit the Webflow Developer Portal
      2. Navigate to "Apps & Integrations" in your Webflow account
      3. Click "Register an App" to create a new OAuth application
      4. Configure the application name, description, and redirect URI (CallbackURL)
      5. Copy the Client ID and Client Secret for use in your connection

      Required Connection Properties

      • AuthScheme: Set this to OAuth (required)
      • OAuthClientId: Client ID from your Webflow OAuth application (required)
      • OAuthClientSecret: Client secret from your Webflow OAuth application (required)
      • CallbackURL: Redirect URI specified in your OAuth application (required)
      • InitiateOAuth: Set to GETANDREFRESH for automatic token management (recommended)

      Required OAuth Scopes

      The Webflow API Profile requires the following OAuth scopes:

      • sites:read - Read access to site information and configuration
      • pages:read - Read access to site pages
      • cms:read - Read access to CMS collections and items
      • forms:read - Read access to forms and form submissions
      • assets:read - Read access to media assets and folders
      • ecommerce:read - Read access to products, orders, and inventory
      • authorized_user:read - Read access to the authorized user

      Built-in Connection String Designer

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

      java -jar cdata.jdbc.api.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.

      Below is a typical JDBC URL:

      jdbc:api:Profile=C:\profiles\Webflow.apip;AuthScheme=OAuth;InitiateOAuth=GETANDREFRESH;OAuthClientId=your_client_id;OAuthClientSecret=your_client_secret;CallbackUrl=your_callback_url;
    • User: The username to authenticate with; typically left blank.
    • Password: The password to authenticate with; typically left blank.
  5. In the Add Table dialog, select the tables you wish to include in your report (or in future reports using this data source) and click Add.

    Click Done once the dialog has completed loading the tables.

  6. In the Catalog Browser, you can create the queries that you will use to populate your reports. You can do this now, or after you create your report. In either case, expand () the data source (CData JDBC Driver for Webflow), right-click on Queries, and select Add Query.
  7. In the Add Table/View/Query dialog, expand () the JDBC URL and Tables and select the table(s) you wish to use in the query and click OK.
  8. In the Query Editor dialog, you can select the columns you wish to include or simply click the SQL button and manually input your own query. For example:
    SELECT ,  FROM Sites WHERE Id = 'your_site_id'
    

    With the query built, click OK to close the Query Editor dialog. At this point you are ready to add Webflow data to a new or existing report.

    NOTE: Now that the query is built, you can create a Business View based on the query. With a Business View, you can create Web reports or library components based on the query. For more information on this, refer to the JReport tutorials.

Add Webflow Data to a Report

You are now ready to create a report with Webflow data.

  1. Create a new report (File New Page Report) or open the Chart Wizard for an existing report.
  2. Select the Query (or create a new one; see above).
  3. Assign a Category and Value for the chart from the columns in your Query and click Finish.
  4. Click the View tab for your report to see the chart.

Ready to get started?

Connect to live data from Webflow with the API Driver

Connect to Webflow