hk_reporthtml Class Reference

A predefined report that prints your data in a html table. More...

#include <hk_reportutils.h>

Inheritance diagram for hk_reporthtml:

Inheritance graph
[legend]
Collaboration diagram for hk_reporthtml:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void set_tabletag (const hk_string &t="")
void set_beforetable (const hk_string &value="%VALUE%", const hk_string &columnname="")
void set_aftertable (const hk_string &value="%VALUE%", const hk_string &columnname="")
void set_trtag (const hk_string &t)
void set_thtag (const hk_string &t)
void set_tdtag (const hk_string &t)
void set_beforehtmltag (const hk_string &b)
void set_betweenheadtags (const hk_string &b, const hk_string &colname="")
void set_groupcolumn (const hk_string &c)
void set_multiplefiles (bool m=true)
void set_title (const hk_string &t)
void set_author (const hk_string &a)

Protected Member Functions

void configure_page (void)
void configure_table (void)

Detailed Description

A predefined report that prints your data in a html table.

Version:
Revision
1.22
Author:
Horst Knorr (hk_classes@knoda.org)
A report that prints all data in html format. Special characters like Umlaute, accents etc. will be automatically recoded.

You can see what functions influence which parts of the html document in the following listing:

 *set_beforehtmltag()
 *<HTML>
   <HEAD>
     set_betweenheadtags()
     set_title()
     set_author()
   </HEAD>

   <BODY  set_bodytag()>
      set_beforetable()
<TABLE  set_tabletag()>
	   <TR  set_trtags()><TH  set_thtags()>...  ...  
	   <TR  set_trtags()><TD  set_tdtags()>...  ...  	

      set_aftertable()
   </BODY>
 *</HTML>
 *
See the simple usage in the following 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 html document

  hk_reporthtml e;
  e.set_filename("webdocument.html");
  e.datasource(datasource);
  e.set_author("Horst Knorr");
  e.set_title("�erschrift");
  e.execute();
4 sections will be defined, of which the datasection (the

..row) and the tableheadersection (the

.. row) can be reached directly.

* beforetablesection;

* tableheadersection;

* datasection;

* tableendsection;


Member Function Documentation

void hk_reporthtml::set_tabletag ( const hk_string &  t = ""  ) 

You can define some parameter for the
. See yout html documentation for details

void hk_reporthtml::set_beforetable ( const hk_string &  value = "%VALUE%",
const hk_string &  columnname = "" 
)

A hk_string that will be displayed in the body of the html document before the table with the data. Internally it is represented by a hk_reportdata , so you can use all variables.

Parameters:
value the hk_string to be displayed
column The columnname of a column which will be base for the variables SUM%,COUNT%,AVERAGE% etc.

void hk_reporthtml::set_aftertable ( const hk_string &  value = "%VALUE%",
const hk_string &  columnname = "" 
)

A hk_string that will be displayed in the body of the html document after the table with the data.

See also:
set_beforetable

void hk_reporthtml::set_trtag ( const hk_string &  t  ) 

You can define some parameter for the

tag. See your html documentation for details

void hk_reporthtml::set_thtag ( const hk_string &  t  ) 

You can define some parameter for the

tag. See your html documentation for details

void hk_reporthtml::set_tdtag ( const hk_string &  t  ) 

You can define some parameter for the

tag. See your html documentation for details

void hk_reporthtml::set_beforehtmltag ( const hk_string &  b  ) 

You can define what should stand before the <HTML> tag (i.e.<!doctype html public \"-//w3c//dtd html 4.0 transitional//en\">. See your html documentation for details

void hk_reporthtml::set_betweenheadtags ( const hk_string &  b,
const hk_string &  colname = "" 
)

Data which has to be in the <HEAD>...</HEAD> section before the body. i.e.<meta http-equiv=\"Content-Type\" content=\"text/html;charset=iso-8859-1\"> See your html documentation for details

void hk_reporthtml::set_groupcolumn ( const hk_string &  c  ) 

If you want to create more tables depending on the value of a field set the field name with set_groupcolumn

void hk_reporthtml::set_multiplefiles ( bool  m = true  ) 

If you want each grouped table (set_groupcolumn) in its own file set this to true

void hk_reporthtml::set_title ( const hk_string &  t  ) 

The document title. Will be set in the <HEAD>..</HEAD>section

void hk_reporthtml::set_author ( const hk_string &  a  ) 

The document author. Will be set in the <HEAD>..</HEAD>section


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