What's new Download Reportworq
⬇ Guide PDF

Connect Excel#

Excel is a built-in connector that reads an Excel workbook as a tabular data source. It appears in the datasource catalog as Excel and is backed by the CData Excel driver that Reportworq ships, so there is nothing to install: the driver is managed code and works on Windows and Linux servers alike. Each worksheet in the workbook becomes a table, and you query it through the same table-or-SQL data-model modes and the same =RWSQL worksheet function as any relational source. Use it for reference data, mapping tables, a staged extract, or demo data that must travel with the repository.

The workbook can live in either of two places, and the choice matters more than any other setting on the form:

This page covers both. It stands on its own for a local or repository-stored workbook; for the driver's cloud storage modes and the long tail of its properties, the authoritative reference is CData's ADO.NET documentation for Excel.

Before you begin#

Choose where the workbook lives#

The table below compares the two locations. Both use the same connector and the same form; only the value in URI differs.

On the server Inside the repository
URI value An absolute path, for example C:\Reportworq\data\Budget.xlsx or /var/lib/reportworq/data/Budget.xlsx repository:Budget.xlsx, or repository:data/Budget.xlsx for a subfolder
Where the file is Anywhere on the server's file system, or a share the service account can reach <repository>/v6/fs/files/, a folder inside the repository configured at setup
Backup and restore The workbook is backed up separately from the repository A file-level copy of the repository folder includes the workbook. The built-in Backup feature does not: it zips the content store only, so add v6/fs/files/ to your own backup routine
Moving to another environment Edit the path if the folder layout differs Nothing to edit: the same connection settings work wherever the repository is extracted
Best for A workbook another process refreshes, such as an export dropped into a folder on a schedule A workbook that is part of the solution: reference data, mappings, demo content

Recommendation. When the workbook is part of the solution, ship it inside the repository. The connection then has no absolute path and no per-environment edit, and the workbook cannot drift away from the content that depends on it. Keep the workbook on the server only when something outside Reportworq owns and refreshes it.

Configure the connection#

  1. Add the Excel connector and open its editor.
  2. Keep Enable datasource connection selected.
  3. Enter a Datasource Name. Report authors reference the connection by this name, for example in the connectionName argument of =RWSQL.
  4. In URI, enter where the workbook is: an absolute path on the server, or a repository: reference to a workbook inside the repository. See Reference a workbook inside the repository below.
  5. Leave Connection Type at Local. Local covers both a file on the server and a file inside the repository, and it needs no credentials, so the Auth Scheme field it reveals stays at None. The other connection types (Amazon S3, Azure Blob Storage, SharePoint, OneDrive, SFTP, and the rest) read the workbook from that store and need its credentials; they are documented in CData's connection guide.
  6. Leave Show Advanced Options cleared unless you need one of the properties in Adjust how the workbook is read. Selecting it swaps the short form for the driver's full property sections.
  7. Save, then select Test connection. The test opens the workbook with the driver's own connection test and returns "Success." when the file exists and parses as a valid workbook. A missing file or a file that is not a valid workbook fails the test; a wrong path is the most common cause. With the default Test Connection Behavior (LIST_OR_READ_FILES), a URI that points at an existing folder also passes, even when the folder holds no workbook; set Test Connection Behavior to READ_FILE under Show Advanced Options to make the test insist on the file itself. The Excel form has no Validation Query row, because the driver tests the file directly rather than running a query.

A property left at its default is not written into the connection string, so the saved connection carries only the values you changed.

Reference a workbook inside the repository#

The repository: prefix makes the workbook part of the repository. When you test or query the connection, Reportworq resolves the prefix to the repository's files folder, so repository:Budget.xlsx reads <repository>/v6/fs/files/Budget.xlsx. The stored setting keeps the prefix; only the connection string that is built at run time carries the absolute path. That is what keeps the connection portable.

Put the workbook in the files folder#

There is no upload screen for this folder. An administrator places the workbook on the server:

  1. Find the repository folder, the one configured when Reportworq was set up.
  2. Under it, open v6/fs/files/. Create the files folder if it does not exist yet.
  3. Copy the workbook into that folder, or into a subfolder of it. The folder holds loose files that belong to the repository rather than to the content store: a spreadsheet or a SQLite database that a data connection reads from. Because it is a real folder inside the repository, a plain copy of the repository carries it.

Write the reference#

Enter the workbook's path relative to the files folder, after the prefix:

repository:Budget.xlsx
repository:data/Budget.xlsx

The rules the reference follows:

What happens on backup, restore, and copy#

Query the workbook#

Once the connection tests, a model author builds views over it on the model's Connection tab, choosing Table or View or SQL Query, exactly as for the SQL connectors; see Query the source in a data model. What the driver exposes:

In SQL Query mode, write ordinary SQL against those tables:

SELECT Region, Sales FROM Data WHERE Sales >= 300

From a worksheet, read the workbook with =RWSQL, which re-runs the query on every job run; the middle argument is the Datasource Name you entered:

=RWSQL(B5, "Budget", "SELECT Region FROM Data WHERE Sales >= 300")

Reportworq caps row-limited previews with SELECT TOP n for this connector on its own, so there is no Limit Query Type field on the Excel form.

Adjust how the workbook is read#

Select Show Advanced Options to reach the driver's property sections. The form's field labels are the driver's own property names, spaced for readability, so the same names appear in CData's documentation. The properties below are the ones that most often matter for a local or repository-stored workbook; each links to its CData reference page.

Section Field Default What it does
Connection Header true Whether the first row supplies the column names. false gives generic names (A, B, C). A per-sheet override is allowed: True,Sheet1=False.
Connection Define Tables empty Models fixed cell ranges as named tables, for example Budget=Data!A1:N25,Targets=Data!P1:R40. Needs URI to point at a single workbook.
Connection Orientation Vertical Horizontal reads a sheet whose records run across columns, with the names down the first column.
Connection Test Connection Behavior LIST_OR_READ_FILES What Test connection checks. READ_FILE insists that URI is an existing, valid workbook file.
Data Recalculate true Whether the driver's formula engine recalculates formula cells. See the formulas note below.
Data Has Cross Sheet References false Set to true when formulas reference other sheets and you need their current values; the driver then loads every sheet.
Data Ignore Calc Error false A cell with a calculation error (#NAME?, #DIV/0!) is returned as null; true returns the error text instead.
Data Null Values empty A comma-separated list of cell values to read as null, for example N/A,NaN.
Data Type Detection Scheme ColumnFormat How column types are inferred: from the cell format (default), by scanning rows (RowScan), or none (every column as text).
Data Show Empty Rows false Empty rows are dropped from results unless this is true.
Miscellaneous Row Scan Depth 15 How many rows are scanned to discover columns and, under RowScan, their types. Raise it when the first rows have blanks.
Miscellaneous Readonly false true allows only SELECT, so a write-back function such as RWSQLUPDATE cannot change the workbook. Recommended for a reference workbook.

The full list, including the Schema, Caching, and Logging sections, is in the connection-string properties reference of the CData documentation.

Notes and limits#

Going deeper. To curate columns into governed business fields, set filters, and publish a view for report authors, see Data models.

Feedback on this page

Comments, questions, requests, or something missing or unclear? Email us - the page you are on is filled in for you.

Email feedback on this page

Or write to support@reportworq.com directly.