Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

hk_reportsection Class Reference

represents a section of the report. More...

#include <hk_reportsection.h>

Inheritance diagram for hk_reportsection:

hk_dsdatavisible hk_dsvisible hk_visible hk_class List of all members.

Public Member Functions

void set_unique (bool unique=true, bool endsection=false, bool registerchange=true)
bool unique (void)
hk_reportdatanew_data (void)
hk_reportdatadata_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_reportsubreport (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)
reportsectioncounttypesectioncountfunction (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_reportreport (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_reportsectionpairreportsectionpair (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 *)
reportsectionautomaticcreatedatatypeautomaticcreatedatafunction (void)
hk_reportdataget_reportdatavisible (long nr)
hk_reportdataget_reportdatavisible (const hk_string &identifier)
bool is_fully_printed (void)
void set_print_section (bool)
bool print_section (void)

Static Public Member Functions

static void add_sectionreplacefunctiontype (const hk_string &name, section_replacefunctiontype *f)
static list< hk_string > * sectionreplacefunctionlist (void)
static void add_sectioncountfunctiontype (const hk_string &name, reportsectioncounttype *f)
static list< hk_string > * sectioncountfunctionlist (void)

Protected Member Functions

 hk_reportsection (hk_report *)
virtual ~hk_reportsection (void)
virtual void before_datasource_enables (void)
void remove_all_datas (void)
virtual hk_reportdatawidget_specific_new_data (void)
virtual void widget_specific_after_loaddata (void)
virtual void widget_specific_offset_changed (void)
virtual void sizetype_changed (void)
virtual bool presentationmode_changed (void)
void automatic_create_datafields (void)
void force_new_section (void)
void raise_widget (hk_reportdata *)
void lower_widget (hk_reportdata *)

Protected Attributes

bool p_already_automaticcreated_data
vector< hk_reportdata * > p_data
bool p_unique
hk_string p_lastuniquevalue
hk_string p_sectionbegin
hk_string p_sectionend
hk_string p_betweendata
hk_reportp_report
hk_reportp_subreport
hk_string p_subreportstring
bool p_print_subreport_before_data
bool p_uniqueendsection
bool p_automatic_create_datas
bool p_newpageaftersection
bool p_sectionwasprinted
section_replacefunctiontype * p_replacefunction
hk_string p_replacefunctionstring
hk_string p_default_data
hk_string p_default_beforedata
hk_string p_default_afterdata
hk_string p_default_dataconfigurefunction
int p_default_precision
bool p_default_use_thousandsseparator
unsigned int p_offset

Friends

class hk_report
class hk_reportsectionpair
class hk_reportdata

Detailed Description

represents a section of the report.

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

Version:
Revision
1.45
Author:
Horst Knorr (hk_classes@knoda.org)


Constructor & Destructor Documentation

hk_reportsection::hk_reportsection hk_report  )  [protected]
 

virtual hk_reportsection::~hk_reportsection void   )  [protected, virtual]
 


Member Function Documentation

virtual bool hk_reportsection::actual_string void   )  [virtual]
 

will send the actual data to the outputstream hk_report::outputstream

void hk_reportsection::add_depending_fields const hk_string thisreport_field,
const hk_string subreport_field,
bool  registerchange = true
 

If you set a subreport with set_subreport add the fields which are connected between the reports

static void hk_reportsection::add_sectioncountfunctiontype const hk_string name,
reportsectioncounttype f
[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.

static void hk_reportsection::add_sectionreplacefunctiontype const hk_string name,
section_replacefunctiontype *  f
[static]
 

void hk_reportsection::automatic_create_datafields void   )  [protected]
 

reportsectionautomaticcreatedatatype* hk_reportsection::automaticcreatedatafunction void   )  [inline]
 

virtual void hk_reportsection::before_datasource_enables void   )  [protected, virtual]
 

Reimplemented from hk_dsvisible.

hk_string hk_reportsection::betweendata void   ) 
 

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 hk_reportsection::bulk_operation hk_presentation::enum_bulkoperation  bulkoperation  ) 
 

void hk_reportsection::clear_countingfields void   ) 
 

void hk_reportsection::clear_depending_fields void   ) 
 

virtual unsigned long hk_reportsection::counts_as void   )  [virtual]
 

Reimplemented from hk_visible.

hk_reportdata* hk_reportsection::data_at unsigned  int  ) 
 

vector<hk_reportdata*>* hk_reportsection::datalist void   ) 
 

hk_string hk_reportsection::default_afterreportdata void   )  [inline]
 

hk_string hk_reportsection::default_beforereportdata void   )  [inline]
 

hk_string hk_reportsection::default_reportdata void   )  [inline]
 

the default column value will be used as a default when a new data will be created with new_data default is @

hk_string hk_reportsection::default_reportdataconfigurefunction void   ) 
 

int hk_reportsection::default_reportprecision void   ) 
 

bool hk_reportsection::default_use_reportseparator void   ) 
 

list<hk_string>* hk_reportsection::depending_on_subreportfields void   ) 
 

list<hk_string>* hk_reportsection::depending_on_thisreportfields void   ) 
 

bool hk_reportsection::endsection void   ) 
 

Returns:
true if this section is a unique section and will be printed behind the data

virtual hk_font hk_reportsection::font void   )  [virtual]
 

Reimplemented from hk_visible.

void hk_reportsection::force_new_section void   )  [protected]
 

hk_reportdata* hk_reportsection::get_reportdatavisible const hk_string identifier  ) 
 

hk_reportdata* hk_reportsection::get_reportdatavisible long  nr  ) 
 

unsigned int hk_reportsection::horizontal2relativ unsigned int  h  ) 
 

100% is report width - left border - right border

bool hk_reportsection::is_fully_printed void   ) 
 

virtual void hk_reportsection::loaddata const hk_string definition,
bool  userdefined = false
[virtual]
 

void hk_reportsection::lower_widget hk_reportdata  )  [protected]
 

void hk_reportsection::neutralize_definition bool  registerchange  ) 
 

hk_reportdata* hk_reportsection::new_data void   ) 
 

the printed data. See hk_reportdata and default_data for details

bool hk_reportsection::new_page_after_section void   ) 
 

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

bool hk_reportsection::new_uniquevalue bool  justcheck = false  ) 
 

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

unsigned int hk_reportsection::offset void   ) 
 

virtual bool hk_reportsection::presentationmode_changed void   )  [protected, virtual]
 

Reimplemented from hk_dsdatavisible.

bool hk_reportsection::print_section void   ) 
 

bool hk_reportsection::print_subreport void   ) 
 

bool hk_reportsection::print_subreport_before_data void   )  [inline]
 

void hk_reportsection::raise_widget hk_reportdata  )  [protected]
 

unsigned int hk_reportsection::relativ2horizontal unsigned int  r  ) 
 

100% is report width - left border - right border

unsigned int hk_reportsection::relativ2vertical unsigned int  r  ) 
 

100% is report height - top border - bottom border

void hk_reportsection::remove_all_datas void   )  [protected]
 

void hk_reportsection::remove_data hk_reportdata  ) 
 

virtual hk_string hk_reportsection::replace const hk_string where  )  [virtual]
 

Reimplemented from hk_visible.

hk_report* hk_reportsection::report void   ) 
 

hk_reportsectionpair* hk_reportsection::reportsectionpair void   )  [inline]
 

virtual void hk_reportsection::reset void   )  [virtual]
 

void hk_reportsection::reset_count void   ) 
 

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 void hk_reportsection::savedata ostream &  s,
bool  userdefined = false
[virtual]
 

bool hk_reportsection::section_was_printed void   ) 
 

Returns:
true if this section has been printed (unique sections will not be printed for every row) else false

hk_string hk_reportsection::sectionbegin void   ) 
 

The sectionbegin will be printed as a header of the section (before the data)

reportsectioncounttype* hk_reportsection::sectioncountfunction void   ) 
 

static list<hk_string>* hk_reportsection::sectioncountfunctionlist void   )  [static]
 

hk_string hk_reportsection::sectioncountfunctionstring void   ) 
 

hk_string hk_reportsection::sectionend void   ) 
 

The sectionend will be printed as a footer of the section (after the data) i.e. a
at the end of a datarow

static list<hk_string>* hk_reportsection::sectionreplacefunctionlist void   )  [static]
 

void hk_reportsection::set_automatic_create_data bool  d = true,
bool  registerchange = true
 

If set true and you haven't defined any data with new_data it will automatically create the data set with default_data

void hk_reportsection::set_automaticcreatedatafunction reportsectionautomaticcreatedatatype  ) 
 

void hk_reportsection::set_betweendata const hk_string b,
bool  registerchange = true
 

virtual void hk_reportsection::set_datasource hk_datasource d  )  [virtual]
 

the datasource

Reimplemented from hk_dsdatavisible.

void hk_reportsection::set_default_afterreportdata const hk_string v,
bool  registerchange = true
 

void hk_reportsection::set_default_beforereportdata const hk_string v,
bool  registerchange = true
 

void hk_reportsection::set_default_reportdata const hk_string v,
bool  registerchange = true
 

void hk_reportsection::set_default_reportdataconfigurefunction const hk_string f,
bool  registerchange = true
 

void hk_reportsection::set_default_reportprecision int  ,
bool  registerchange = true
 

void hk_reportsection::set_default_use_reportseparator bool  ,
bool  registerchange = true
 

void hk_reportsection::set_new_page_after_section bool  p,
bool  registerchange = true
 

bool hk_reportsection::set_offset unsigned int  o,
bool  registerchange = true
 

The offset is additional space at the end of the section (totalsectionsize= size needed by reportdata + offset)

virtual bool hk_reportsection::set_presentationdatasource long  n,
bool  registerchange = true
[virtual]
 

Reimplemented from hk_dsvisible.

void hk_reportsection::set_print_section bool   ) 
 

void hk_reportsection::set_replacefunction const hk_string f,
bool  registerchange = true
 

You can enhance the possibilities of the section by writing your own function.This function could for example handle your own variables.

void hk_reportsection::set_sectionbegin const hk_string b,
bool  registerchange = true
 

void hk_reportsection::set_sectioncountfunction const hk_string f,
bool  registerchange = true
 

void hk_reportsection::set_sectionend const hk_string e,
bool  registerchange = true
 

void hk_reportsection::set_subreport const hk_string subreport = "",
bool  before_data = false,
bool  registerchange = true
 

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 hk_reportsection::set_unique bool  unique = true,
bool  endsection = false,
bool  registerchange = true
 

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.

virtual void hk_reportsection::sizetype_changed void   )  [protected, virtual]
 

Reimplemented from hk_visible.

hk_report* hk_reportsection::subreport void   ) 
 

hk_string hk_reportsection::subreportname void   ) 
 

bool hk_reportsection::unique void   ) 
 

unsigned int hk_reportsection::vertical2relativ unsigned int  v  ) 
 

100% is report height - top border - bottom border

virtual void hk_reportsection::widget_specific_after_loaddata void   )  [inline, protected, virtual]
 

virtual hk_reportdata* hk_reportsection::widget_specific_new_data void   )  [protected, virtual]
 

virtual void hk_reportsection::widget_specific_offset_changed void   )  [inline, protected, virtual]
 


Friends And Related Function Documentation

friend class hk_report [friend]
 

friend class hk_reportdata [friend]
 

Reimplemented from hk_visible.

friend class hk_reportsectionpair [friend]
 


Member Data Documentation

bool hk_reportsection::p_already_automaticcreated_data [protected]
 

bool hk_reportsection::p_automatic_create_datas [protected]
 

hk_string hk_reportsection::p_betweendata [protected]
 

vector<hk_reportdata*> hk_reportsection::p_data [protected]
 

hk_string hk_reportsection::p_default_afterdata [protected]
 

hk_string hk_reportsection::p_default_beforedata [protected]
 

hk_string hk_reportsection::p_default_data [protected]
 

hk_string hk_reportsection::p_default_dataconfigurefunction [protected]
 

int hk_reportsection::p_default_precision [protected]
 

bool hk_reportsection::p_default_use_thousandsseparator [protected]
 

hk_string hk_reportsection::p_lastuniquevalue [protected]
 

bool hk_reportsection::p_newpageaftersection [protected]
 

unsigned int hk_reportsection::p_offset [protected]
 

bool hk_reportsection::p_print_subreport_before_data [protected]
 

section_replacefunctiontype* hk_reportsection::p_replacefunction [protected]
 

hk_string hk_reportsection::p_replacefunctionstring [protected]
 

hk_report* hk_reportsection::p_report [protected]
 

hk_string hk_reportsection::p_sectionbegin [protected]
 

hk_string hk_reportsection::p_sectionend [protected]
 

bool hk_reportsection::p_sectionwasprinted [protected]
 

hk_report* hk_reportsection::p_subreport [protected]
 

hk_string hk_reportsection::p_subreportstring [protected]
 

bool hk_reportsection::p_unique [protected]
 

bool hk_reportsection::p_uniqueendsection [protected]
 


The documentation for this class was generated from the following file:
Generated on Thu Mar 9 18:40:42 2006 for hk_classes by  doxygen 1.4.1