Data table structure for use in report generation. More...
Public Member Functions | |
Table (size_t numRows, size_t numCols) | |
Creates a table with the specified dimensions. More... | |
Table (const Table &other) | |
Constructs a report table by copying from another report table. More... | |
Table & | operator= (const Table &other) |
Assigns other to this report table and returns a reference to this report table. More... | |
Str | value (size_t row, size_t col) const |
Returns the value found in row row and column col. More... | |
bool | setValue (size_t row, size_t col, const Str &val) |
Sets the string val into the table at position given by row row and column col. More... | |
size_t | rowCount () const |
Returns the number of rows in the table. More... | |
size_t | columnCount () const |
Returns the number of columns in the table. More... | |
Str | chartYAxisTitle () const |
Returns the y axis title. More... | |
void | setChartYAxisTitle (const Str &yAxisTitle) |
Sets the y axis title. More... | |
Str | chartXAxisTitle () const |
Gets the x axis title. More... | |
void | setChartXAxisTitle (const Str &xAxisTitle) |
Sets the x axis title. More... | |
![]() | |
void | addRef () const |
Increments the reference count for this object. More... | |
void | release () const |
Decrements the reference count for this object. More... | |
int | refCount () const |
Returns the reference count for this object. More... | |
void | setRefCountZero () const |
Sets the ref count to zero, but DOES NOT delete the object. More... | |
Data table structure for use in report generation.
A Table contains a two dimensional array of strings. A table can store, for instance, a series of pick information or plot data.
The size of the table is defined upon construction and cannot be changed afterwards. Set values in the table with setValue() and query the table using value().
The table data can be used either in a plain textual table or, if it contains plot data, it can be used to create a chart object in Word or PowerPoint. The figure is showing one table snapshot shown as both a table and a chart in a Word document.
The first row will be treated as column titles.
When used to populate a chart, the first column will be used on the x-axis and each of the remaining columns will represent a new data series. The elements in the first row will be set as the names of the data series. You can specify optional x and y axis titles using setChartYAxisTitle() and setChartXAxisTitle().
Note! If the table are to be used as chart data, the number value MUST be passed along using a '.' as the decimal point for the MS Office chart object to recognize it as a number!
cee::rep::Table::Table | ( | size_t | numRows, |
size_t | numCols | ||
) |
Creates a table with the specified dimensions.
cee::rep::Table::Table | ( | const Table & | other | ) |
Constructs a report table by copying from another report table.
cee::Str cee::rep::Table::chartXAxisTitle | ( | ) | const |
Gets the x axis title.
Only applicable for chart data.
Str cee::rep::Table::chartYAxisTitle | ( | ) | const |
Returns the y axis title.
Only applicable for chart data.
size_t cee::rep::Table::columnCount | ( | ) | const |
Returns the number of columns in the table.
Assigns other to this report table and returns a reference to this report table.
size_t cee::rep::Table::rowCount | ( | ) | const |
Returns the number of rows in the table.
void cee::rep::Table::setChartXAxisTitle | ( | const Str & | xAxisTitle | ) |
Sets the x axis title.
Only applicable for chart data.
void cee::rep::Table::setChartYAxisTitle | ( | const Str & | yAxisTitle | ) |
Sets the y axis title.
Only applicable for chart data.
bool cee::rep::Table::setValue | ( | size_t | row, |
size_t | col, | ||
const Str & | val | ||
) |
Sets the string val into the table at position given by row row and column col.
Returns true if row and col is within table dimensions.
Str cee::rep::Table::value | ( | size_t | row, |
size_t | col | ||
) | const |
Returns the value found in row row and column col.