hk_reportcsv Class Reference

A predefined report that exports your data as cvs. More...

#include <hk_reportutils.h>

Inheritance diagram for hk_reportcsv:

Inheritance graph
[legend]
Collaboration diagram for hk_reportcsv:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void set_groupcolumn (const hk_string &c)
void set_multiplefiles (bool m=true)
void set_filedefinition (const hk_string &textdelimiter="\"", const hk_string &betweenfields=",", const hk_string &rowdelimiter="\n", const hk_string &datetimeformat="", const hk_string &dateformat="", const hk_string &timeformat="", const hk_string &charset="", const hk_string &locale="")
void set_withheader (bool with)
hk_string textdelimiter (void)
hk_string between (void)

Protected Member Functions

void configure_page (void)
virtual void widget_specific_before_execute (void)
virtual void widget_specific_after_execute (void)

Protected Attributes

hk_reportsectionp_datasection
hk_reportsectionp_footsection

Detailed Description

A predefined report that exports your data as cvs.

CVS is a standard exportformat. Usually it is a comma separated list with on datarow per line. The data is usually delimited by "". The first line may contain the columnnames. Normally you just have to set the datasource and then execute the report.

Example

 // first create a datasource
  hk_classes p_class;
  hk_connection* connect=p_class.hk_create("mysql");
  connect->user("root");
  connect->host("localhost");
  connect->password("my_password");
  connect->connect();
  hk_database* database=connect->new_database();
  database->name("vokabeltrainer");
  hk_datasource* datasource=database->new_resultquery();
  datasource->sql("SELECT * FROM vokabeln");

 // now create the output as a CVS document

  hk_reportcsv e;
  e.datasource(datasource);
  e.execute();
 *
Version:
0.1
Author:
Horst Knorr (hk_classes@knoda.org)


Member Function Documentation

void hk_reportcsv::set_filedefinition ( const hk_string &  textdelimiter = "\"",
const hk_string &  betweenfields = ",",
const hk_string &  rowdelimiter = "\n",
const hk_string &  datetimeformat = "",
const hk_string &  dateformat = "",
const hk_string &  timeformat = "",
const hk_string &  charset = "",
const hk_string &  locale = "" 
)

Here you can easily define other delimiters and data separators.To get a tabulatorseparated list just set set_dataformat("\"","");

void hk_reportcsv::set_withheader ( bool  with  ) 

set it to false if you don't want the columnnames in the first line (default ist true)


The documentation for this class was generated from the following files:
Generated on Tue Nov 28 02:48:41 2006 for Databaseconnectionclasses by  doxygen 1.5.0