class hk_reportsection
|
represents a section of the report.
More... |
|
|
Public Methods
- void set_unique (bool unique=true, bool endsection=false,bool registerchange=true)
- bool unique (void)
- hk_reportdata* new_data (void)
- hk_reportdata* data_at (unsigned int)
- vector<hk_reportdata*>* datalist (void)
- virtual bool actual_string (void)
- hk_string sectionbegin (void)
- void set_sectionbegin (const hk_string& b,bool registerchange=true)
- hk_string sectionend (void)
- void set_sectionend (const hk_string& e,bool registerchange=true)
- hk_string betweendata (void)
- void set_betweendata (const hk_string& b,bool registerchange=true)
- bool new_uniquevalue (bool justcheck=false)
- bool endsection (void)
- void set_automatic_create_data (bool d=true,bool registerchange=true)
- bool new_page_after_section (void)
- void set_new_page_after_section (bool p,bool registerchange=true)
- bool section_was_printed (void)
- void set_subreport (const hk_string& subreport="",bool before_data=false,bool registerchange=true)
- hk_string subreportname (void)
- hk_report* subreport (void)
- void add_depending_fields (const hk_string& thisreport_field, const hk_string& subreport_field,bool registerchange=true)
- void clear_depending_fields (void)
- list<hk_string>* depending_on_thisreportfields (void)
- list<hk_string>* depending_on_subreportfields (void)
- bool print_subreport_before_data (void)
- bool print_subreport (void)
- void set_replacefunction (const hk_string& f,bool registerchange=true)
- virtual hk_string replace (const hk_string& where)
- void reset_count (void)
- virtual hk_font font (void)
- virtual unsigned long counts_as (void)
- void set_sectioncountfunction (const hk_string& f,bool registerchange=true)
- hk_string sectioncountfunctionstring (void)
- reportsectioncounttype* sectioncountfunction (void)
- virtual void savedata (ostream& s,bool userdefined=false)
- virtual void loaddata (const hk_string& definition,bool userdefined=false)
- virtual void set_datasource (hk_datasource* d)
- virtual bool set_presentationdatasource (long n, bool registerchange=true)
- hk_string default_reportdata (void)
- void set_default_reportdata (const hk_string& v,bool registerchange=true)
- hk_string default_beforereportdata (void)
- void set_default_beforereportdata (const hk_string& v,bool registerchange=true)
- hk_string default_afterreportdata (void)
- void set_default_afterreportdata (const hk_string& v,bool registerchange=true)
- void set_default_reportdataconfigurefunction (const hk_string& f,bool registerchange=true)
- hk_string default_reportdataconfigurefunction (void)
- int default_reportprecision (void)
- void set_default_reportprecision (int, bool registerchange=true)
- bool default_use_reportseparator (void)
- void set_default_use_reportseparator (bool, bool registerchange=true)
- void neutralize_definition (bool registerchange)
- virtual void reset (void)
- void clear_countingfields (void)
- void remove_data (hk_reportdata*)
- hk_report* report (void)
- unsigned int horizontal2relativ (unsigned int h)
- unsigned int vertical2relativ (unsigned int v)
- unsigned int relativ2horizontal (unsigned int r)
- unsigned int relativ2vertical (unsigned int r)
- hk_reportsectionpair* reportsectionpair (void)
- bool set_offset (unsigned int o,bool registerchange=true)
- unsigned int offset (void)
- void bulk_operation (hk_presentation::enum_bulkoperation bulkoperation)
- void set_automaticcreatedatafunction (reportsectionautomaticcreatedatatype*)
- reportsectionautomaticcreatedatatype* automaticcreatedatafunction (void)
- hk_reportdata* get_reportdatavisible (long nr)
- hk_reportdata* get_reportdatavisible (const hk_string& identifier)
Public Static Methods
Protected Methods
Protected Members
hk_reportsection represents a section in a hk_report element. Within a section
you can define the outputdata,use it as headers for your data and so in
If it is needed as a section header or footer use set_unique in combination with set_uniquecolumn
It also can contain subreports.
Usually section come as "twins", a header section and a footer section belonging to each other,
see hk_reportsectionpair for details
Example: Defining a CVS output (no first row with columnnames)
//
// first define a datasource
//
hk_drivermanager p_driver;
hk_connection* connect=p_driver.new_connection("mysql");
connect->set_user("root");
connect->set_host("localhost");
connect->set_password("my_password");
connect->connect();
hk_database* database=connect->new_database("vokabeltrainer");
//
//now start defining the report
//
hk_report e;
long int datasrc =e.new_datasource("reportabfrage",true);//loads an existing query
e.set_presentationdatasource(datasrc);
hk_reportsection* s=e.datasection();
s->set_default_data("\"%VALUE%\""); // define " before and after the value of a column
s->set_betweendata(" , "); // a comma separated list
s->set_sectionend("\n"); // one row per datarow
e.execute();
|
you can use the variables
%PAGENUMBER% the number of the page
%ABSOLUTEPAGENUMBER% physical number of the page in file
|
void set_unique (bool unique=true, bool endsection=false,bool registerchange=true)
| set_unique |
If the section should be printed just once per block and not for each datarow use this function
Parameters:
unique | true if this section should be printed once
interesting four grouped data
|
endsection | true if this section should not be printed as a header. Instead it will be printed
at the end of the block. Sections created with hk_reportsectionpair are already set correctly.
|
bool unique (void)
| unique |
the printed data. See hk_reportdata and default_data for details
bool actual_string (void)
| actual_string |
[virtual]
will send the actual data to the outputstream hk_report::outputstream
The sectionbegin will be printed as a header of the section (before the data)
void set_sectionbegin (const hk_string& b,bool registerchange=true)
| set_sectionbegin |
The sectionend will be printed as a footer of the section (after the data)
i.e. a \n at the end of a datarow
void set_sectionend (const hk_string& e,bool registerchange=true)
| set_sectionend |
A string that will be printed between two datasegments defined with new_data
i.e. If you want a comma separated list you would need set_betweendata(" , ");
void set_betweendata (const hk_string& b,bool registerchange=true)
| set_betweendata |
bool new_uniquevalue (bool justcheck=false)
| new_uniquevalue |
Parameters:
justcheck | if true no variables(lastvalue) will be changed
|
Returns: true if this section is a unique section and this section has to be printed
bool endsection (void)
| endsection |
Returns: true if this section is a unique section and will be printed behind the data
void set_automatic_create_data (bool d=true,bool registerchange=true)
| set_automatic_create_data |
If set true and you haven't defined any data with new_data it will automatically create the data
set with default_data
bool new_page_after_section (void)
| new_page_after_section |
true if a new page will be started after printing this section. Usually this function should only be used
in combination with set_unique as an endsection
void set_new_page_after_section (bool p,bool registerchange=true)
| set_new_page_after_section |
bool section_was_printed (void)
| section_was_printed |
Returns: true if this section has been printed (unique sections will not be printed for every row) else false
void set_subreport (const hk_string& subreport="",bool before_data=false,bool registerchange=true)
| set_subreport |
A complete other report can be printed within a section
Parameters:
subreport | the subreport
|
before_data | if true the subreport will be printed before the data of this section will be printed, else
it will be printed after the data
|
void add_depending_fields (const hk_string& thisreport_field, const hk_string& subreport_field,bool registerchange=true)
| add_depending_fields |
If you set a subreport with set_subreport add the fields which are connected between the reports
void clear_depending_fields (void)
| clear_depending_fields |
list<hk_string>* depending_on_thisreportfields (void)
| depending_on_thisreportfields |
list<hk_string>* depending_on_subreportfields (void)
| depending_on_subreportfields |
bool print_subreport_before_data (void)
| print_subreport_before_data |
bool print_subreport (void)
| print_subreport |
void set_replacefunction (const hk_string& f,bool registerchange=true)
| set_replacefunction |
You can enhance the possibilities of the section by writing your own function.This function could for example handle your
own variables.
[virtual]
Reimplemented from hk_visible.
[static]
list<hk_string>* sectionreplacefunctionlist (void)
| sectionreplacefunctionlist |
[static]
void reset_count (void)
| reset_count |
Will set all COUNT, SUM, AVERAGE and so on variables to 0, if they are not "running counts" (which mean global
for the whole report).See hk_reportdata for details. Usually you dont't have to call this function
[virtual]
Reimplemented from hk_visible.
unsigned long counts_as (void)
| counts_as |
[virtual]
Reimplemented from hk_visible.
void add_sectioncountfunctiontype (const hk_string& name,reportsectioncounttype* f)
| add_sectioncountfunctiontype |
[static]
needed by hk_report::set_periodic. It is possible to compute as how much a section counts.
Parameters:
f | is a userdefined function that will be called whenever counts_as is called.
|
list<hk_string>* sectioncountfunctionlist (void)
| sectioncountfunctionlist |
[static]
void set_sectioncountfunction (const hk_string& f,bool registerchange=true)
| set_sectioncountfunction |
hk_string sectioncountfunctionstring (void)
| sectioncountfunctionstring |
reportsectioncounttype* sectioncountfunction (void)
| sectioncountfunction |
void savedata (ostream& s,bool userdefined=false)
| savedata |
[virtual]
Reimplemented from hk_dsdatavisible.
void loaddata (const hk_string& definition,bool userdefined=false)
| loaddata |
[virtual]
Reimplemented from hk_dsdatavisible.
[virtual]
Reimplemented from hk_dsdatavisible.
bool set_presentationdatasource (long n, bool registerchange=true)
| set_presentationdatasource |
[virtual]
Reimplemented from hk_dsvisible.
hk_string default_reportdata (void)
| default_reportdata |
the default column value will be used as a default when a new data will be created with new_data
default is @VALUE@
void set_default_reportdata (const hk_string& v,bool registerchange=true)
| set_default_reportdata |
hk_string default_beforereportdata (void)
| default_beforereportdata |
void set_default_beforereportdata (const hk_string& v,bool registerchange=true)
| set_default_beforereportdata |
hk_string default_afterreportdata (void)
| default_afterreportdata |
void set_default_afterreportdata (const hk_string& v,bool registerchange=true)
| set_default_afterreportdata |
void set_default_reportdataconfigurefunction (const hk_string& f,bool registerchange=true)
| set_default_reportdataconfigurefunction |
hk_string default_reportdataconfigurefunction (void)
| default_reportdataconfigurefunction |
int default_reportprecision (void)
| default_reportprecision |
void set_default_reportprecision (int, bool registerchange=true)
| set_default_reportprecision |
bool default_use_reportseparator (void)
| default_use_reportseparator |
void set_default_use_reportseparator (bool, bool registerchange=true)
| set_default_use_reportseparator |
void neutralize_definition (bool registerchange)
| neutralize_definition |
[virtual]
void clear_countingfields (void)
| clear_countingfields |
unsigned int horizontal2relativ (unsigned int h)
| horizontal2relativ |
100% is report width - left border - right border
unsigned int vertical2relativ (unsigned int v)
| vertical2relativ |
100% is report height - top border - bottom border
unsigned int relativ2horizontal (unsigned int r)
| relativ2horizontal |
100% is report width - left border - right border
unsigned int relativ2vertical (unsigned int r)
| relativ2vertical |
100% is report height - top border - bottom border
bool set_offset (unsigned int o,bool registerchange=true)
| set_offset |
The offset is additional space at the end of the section (totalsectionsize= size needed by reportdata + offset)
unsigned int offset (void)
| offset |
void set_automaticcreatedatafunction (reportsectionautomaticcreatedatatype*)
| set_automaticcreatedatafunction |
reportsectionautomaticcreatedatatype* automaticcreatedatafunction (void)
| automaticcreatedatafunction |
hk_reportdata* get_reportdatavisible (long nr)
| get_reportdatavisible |
hk_reportsection (hk_report*)
| hk_reportsection |
[protected]
~hk_reportsection (void)
| ~hk_reportsection |
[protected virtual]
void before_datasource_enables (void)
| before_datasource_enables |
[protected virtual]
Reimplemented from hk_dsvisible.
void remove_all_datas (void)
| remove_all_datas |
[protected]
hk_reportdata* widget_specific_new_data (void)
| widget_specific_new_data |
[protected virtual]
void widget_specific_after_loaddata (void)
| widget_specific_after_loaddata |
[protected virtual]
void widget_specific_offset_changed (void)
| widget_specific_offset_changed |
[protected virtual]
void sizetype_changed (void)
| sizetype_changed |
[protected virtual]
Reimplemented from hk_visible.
void presentationmode_changed (void)
| presentationmode_changed |
[protected virtual]
Reimplemented from hk_dsdatavisible.
void automatic_create_datafields (void)
| automatic_create_datafields |
[protected]
void force_new_section (void)
| force_new_section |
[protected]
bool p_already_automaticcreated_data
| p_already_automaticcreated_data |
[protected]
[protected]
[protected]
hk_string p_lastuniquevalue
| p_lastuniquevalue |
[protected]
[protected]
[protected]
[protected]
[protected]
[protected]
hk_string p_subreportstring
| p_subreportstring |
[protected]
bool p_print_subreport_before_data
| p_print_subreport_before_data |
[protected]
bool p_uniqueendsection
| p_uniqueendsection |
[protected]
bool p_automatic_create_datas
| p_automatic_create_datas |
[protected]
bool p_newpageaftersection
| p_newpageaftersection |
[protected]
bool p_sectionwasprinted
| p_sectionwasprinted |
[protected]
[protected]
hk_string p_replacefunctionstring
| p_replacefunctionstring |
[protected]
[protected]
hk_string p_default_beforedata
| p_default_beforedata |
[protected]
hk_string p_default_afterdata
| p_default_afterdata |
[protected]
hk_string p_default_dataconfigurefunction
| p_default_dataconfigurefunction |
[protected]
int p_default_precision
| p_default_precision |
[protected]
bool p_default_use_thousandsseparator
| p_default_use_thousandsseparator |
[protected]
unsigned int p_offset
| p_offset |
[protected]
[protected]
Reimplemented from hk_visible.
[protected]
Reimplemented from hk_visible.
- Version: $Revision: 1.5 $
- Author: Horst Knorr (hk_classes@knoda.org)
- Generated: horst on horstnotebook on Mon Nov 22 10:41:06 2004, using kdoc 2.0a54.