#include <hk_reportutils.h>
Inheritance diagram for hk_reporthtml:


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) |
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;
| void hk_reporthtml::set_tabletag | ( | const hk_string & | t = "" |
) |
You can define some parameter for the
| 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.
| 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.
| 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
1.5.0