varlena ere: Using CSV files


Overview

Requirements

Examples

How It Works

Design Structure

Tags

Design a Report

Variables

Built-in Arguments

Debugging

Using CSV files

Tricks

Copyright

Reports Home

The CSV Feature has been deprecated.

How to create csv files

Each DataStream in a report can generate a csv file from its query. These are the steps required to generate and use a csv file.

1. In the definition of the DataStream, use csv=yes.

	<DataStream name=dsname ... csv=yes > 

2. When you run the report, pass several additional parameters:

do_csv=t
Enables csv for datastreams which have been defined with csv=yes

rootdir=path to htdocs This should be the path to the htdocs directory of the webserver serving the report pages. Or it may be unset if you are running from the command line. The csvdir setting is relative to the rootdir.

csvdir=target directory relative to $rootdir This is the directory relative to $rootdir where the actual csv files will be written.

3. To add a link to your report which connects to the csv file, use the predefined variable named the same as your datastream. For example, if your datastream name is deptemp, use:
	<A HREF=:deptemp:>CSV file</A>

The browser viewing the report may be set to open csv files in a spreadsheet program such as Excel. If the browser is not programmed to open csv files, you will see the plain text of the file. This may be saved or copied from the browser.

CSV File names

The csv files are named:
	$rootdir/$csvdir/reportname-nnnnn.csv 

Each report run creates a new file. There is no automatic utility for removing obsolete csv files, however, it is recommended that a cron job be created to removed these files if they are older that a few hours up to a day.


Copyright 2003 through 2009 A. Elein Mustain, Varlena, LLC