How to use rlib with offline datasources (CSV, XML)

Werner Bochtler <[email protected]> Fri, 29 Jun 2007 12:34:45 +0200
Newsgroups gmane.text.rlib.user
Organization ZKRD gGmbH
Message-ID <[email protected]>
I'm new to rlib and don't know how to use a csv file as datasource.

What I have done so far using perl:

#!/usr/bin/perl
use strict;
use rlib;

my $rlib = rlibc::rlib_init();
rlibc::rlib_add_datasource_csv( $rlib, "data.csv" );
rlibc::rlib_add_report( $rlib, "products.xml" );
rlibc::rlib_set_output_format_from_text( $rlib, "pdf" );
rlibc::rlib_execute( $rlib );
rlibc::rlib_spool( $rlib );
rlibc::rlib_free( $rlib );
exit 0;

------

This results in "No queries added to report".

My questions:

What is the correct structure of the csv data file?
I assume that a header line containing the field names is required. Is
this corect?

Can you give an example for an XML data file?

How can I solve the "No queries to report" problem?

I assume that I have to use rlib_add_query_as() but don't know how?

Last question:
Is there a way to store the generated report in a file?


Thanks in advance,

Werner





-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/