cee::rep::Table

class Table : public RefCountedObject

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.

../_images/rep_plot_vs_chart.png

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!

Public Functions

Table(size_t numRows, size_t numCols)

Creates a table with the specified dimensions.

Table(const Table &other)

Constructs a report table by copying from another report table.

Table &operator=(const Table &other)

Assigns other to this report table and returns a reference to this report table.

Str value(size_t row, size_t col) const

Returns the value found in row row and column col.

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.

Returns true if row and col is within table dimensions.

size_t rowCount() const

Returns the number of rows in the table.

Note! Row count is including the first title row.

size_t columnCount() const

Returns the number of columns in the table.

Str chartYAxisTitle() const

Returns the y axis title.

Only applicable for chart data.

void setChartYAxisTitle(const Str &yAxisTitle)

Sets the y axis title.

Only applicable for chart data.

Str chartXAxisTitle() const

Gets the x axis title.

Only applicable for chart data.

void setChartXAxisTitle(const Str &xAxisTitle)

Sets the x axis title.

Only applicable for chart data.