Reportizer Documentation Contents Index

Report Data Sources

Top Previous Next

Data source is the most important part of the report. It contains information about the data, which is used by the report.

How Reportizer works with data sources

Reportizer works with classic (relational) databases (Paradox, dBase, Oracle, SQL Server, Microsoft Access etc.) and list-based data sources (for example, list of files and folders from specified directory). On the report level, this is specidied by data source type property.

Reportizer can work with relational databases through the interface of the following database engines: ADO, BDE, Interbase. Some data sources can be opened only by one of these engines (for example, UDL files can be opened only by ADO). But some data sources can be opened by more than one engine (for example, dBase (DBF) files can be opened by ADO and BDE; Interbase databases can be opened by ADO, BDE, and Interbase engines). You can switch between available database engines (database interfaces) by changing data source type for report.

Reportizer works with following database types:

Alias / ODBC DSNLocal or remote databases, for which BDE aliases or ODBC data source names (DSN) are defined.BDE aliases can be used only when BDE is available.
FileFiles of multi-table databases (for example, Microsoft Access databases (MDB) or Microsoft Excel worksheets (XLS)). 
FolderFolders with files of the local databases (for example, of Paradox (DB), dBase (DBF), comma separated values (CSV) formats).Because of folder can contain data files of different types, then, if you select folder as your report data source, the program sometimes will require more info about specific driver, which should be used to connect the database.
Connection stringThe string, which describes all parameters needed to connect the database.Connection strings can be used only for ADO connections. Connection string, when applying to report, must begin with <CONSTR> prefix.

Relational databases consist of tables. Data from the database tables are used by reports and can be extracted through the tables itself or by database queries (which is written in SQL).

You can specify the data source for report while creating new report in New Report wizard. You can change the data source for existing report in Data Source page of main window.

Select Data Source dialog

Use Select Data Source dialog as the first step in constructing the data source for your report. You can invoke it by clicking '...' button near Database input field.

In this dialog, you have to specify the data source type (BDE, ADO, Interbase, Folders/Files) and the data source (see the table above).

Opening data source

Data source can be opened either automatically (when the report is previewed or printed) or manually by Open / Close Data Source button on Data Source page. It is also possible to open data source in Report Builder (it is useful, for example, to access field or parameter names) by double-clicking the corresponding area in status bar.

Each time the data source was successfully opened, Reportizer saves the database attributes (name, connection method, user name, password...) in a special list.

Closing data source

Data source is closed either automatically each time the user selects another report or changes data source parameters, or manually on Data Source page.

Notes

1. If the data source (either database or data set) of report is changed (for example, when you change SQL text), then you will be asked to test the data source before template's saving. To avoid the testing, press CTRL+SHIFT when clicking Save button.

2. When working with some data source types, additional components are required. For example, to open Microsoft Access 2007 database (.accdb) or Microsoft Excel 2007 workbook (.xlsx), Microsoft ACE must be installed.

3. Sometimes, after opening Excel workbooks (.xls) via ADO or via ODBC DSN, you may see no tables in the file. If you are sure the file has data, try to open it by it's native program, assign name(s) to needed cell range(s), save, and then try to open it again. If the result will unsuccessful, try to open the file by direct specifying connection string with different parameters: for example, change ODBC-based string to Jet-based one (the differences are shown in examples of connection strings).

4. If your report data source uses text or CSV files, it is recommended to create schema for each file. Schema describes field structure and some other properties of data file. Schema files must be placed in the folder, where data files are located. For BDE connections, schema file must have the same filename as the data file, but with .SCH extension. For ADO connections, the schemas for all data files from certain folder are always kept in one file file named Schema.ini. For other details about creating the schemas, please read your database engine documentation.

See also

 Query Examples

 Examples of ADO Connection Strings

 Working with Command Line

 Error Messages

 Using SQL Queries