View RSS Feed

Development Team Blog

Selecting a Data Source for a Visual Report Writer Report

Rate this Entry
This blog informs you about the Data Source selection in Visual Report Writer. Visual Report Writer is a product created by Data Access Worldwide and fully written in Visual DataFlex. For this blog I used version 1.4 which was released in 2011. If you did not try or saw the product before you can download and try the report writer freely for 60 days. I also advise you to visit the Data Access Synergy conference in Orlando (March 30 - April 1); we will show the product there and organize a special training day.

When you create a new report you have to select a data source. You can choose between:
  1. Embedded DataFlex database
  2. ODBC (incl. Stored Procedures)
  3. Repository

The first option (Embedded DataFlex database) is actually not only the embedded database but also includes access to foreign databases such as Microsoft SQL Server, IBM DB2, Pervasive.SQL via the technique of intermediate files and the Data Access connectivity kits. With the use of INT files you do not have to worry about the database connection strings BUT - important - you will not get the same speed for your reports as the product can offer via direct ODBC access. The advise therefore is to use ODBC to your SQL based Client Server databases instead of INT access.

If we concentrate on the DataFlex embedded database we can select the tables to be used
  1. By opening a filelist
  2. By individual table selection
  3. By filelist selected via a workspace

If you use the filelist (option 1) you have to make sure that the files for the tables listed in the filelist are:
  1. In the same folder as where the filelist resides,
  2. Or are accessible via a path in the filelist's root entry (DF_FILE_ROOT_NAME)
  3. Or are accessible over a path (a Windows environment variable setting)

Option 2 and 3 of the above list are not really advisable because they either fix the files to a specific location on the system or are defined in a Windows global way. If your filelist is not where the files are you better use option 2 or 3 in 2nd list. With option 2 you can select files from multiple different folders if you want. With option 3, new in Visual Report Writer 1.4, you can point to a workspace file that is also used in Visual DataFlex projects. Both the WS and the SWS can be chosen. Visual Report Writer will load the filelist from the workspace description file.

As mentioned before, if your database is an SQL based database we recommend using option 2 (ODBC). In the follow up of the wizard you can select a user, system or file DSN or enter the full connection string to the SQL database. The last one does not rely on any registry setting or file on the machine - so easier to deploy - but requires more knowledge about what you need in the connection string. This connection string is usually very different per database manufacturer.

The last data source option (repository) helps people that do not know what tables from a data source to select and what the links between those tables should be. A more experienced user can setup a repository while building a report and others later can make use of the knowledge gathered by the experienced person.

The chosen data source will in all cases be stored in the report definition. Within the designer product you can change the data source location of an existing report and in the integration part of Visual Report Writer you can change the same information at programming level. The integration wizard that comes with Visual Report Writer 1.4 has an option to write out source code that helps you changing the data source on the fly, at runtime thus.