|
|
This is a generic export-class. It provides access to the various export-formats, which are defined in the classes ExportObj_TEXT, ExportObj_CSV, etc. The use is allways the same: create an export-object, set filname and format, add data and at least create the file.
Everything which is specific for the export is done by the classes ExportObj_TEXT, ExportObj_CSV, etc.
ExportObj (QWidget *parent, const char *name)
| ExportObj |
Constructor for the fileclass of the export
void setFormat (int x)
| setFormat |
Sets the format of the export. x may have the following values:
1 - for excel (not implemented now) 2 - for txt (separated with tabs) 3 - for csv (separated with semicolon) 4 - for html (as a table) 5 - for xml (remember: we don't have any DTD now) 6 - for ps (not implemented now) 7 - for tex (not implemented now) |
You may also use EXCEL, TEXT, CSV, HTML, XML, PS and TEX instead of the numbers.
void setFilename (const QString * filename)
| setFilename |
Sets the filename, which is going to be written.
void setTablename (const QString * tbname)
| setTablename |
void addData (int row, int col, QString* data, QString* dtype=NULL)
| addData |
Adds a cell of the data, we want to export.
row - the row, where the data is located col - the column, where the data is located data - a QString, representing the data dtype - an integervalue, representing the datatype. |
Remember, there's no definition for the datatypes now!
I suggest using: 0 for strings (256 character), 1 - 5 for int (8, 16, 32 ,64, 128bit), 6 - 10 for floats. But I have to think about this again, also need more information about what datatypes in mysql (and other dbs) are supported.
void finish ()
| finish |
finish will start the actual export. This will create the file (given by setFilename and setFormat) and put all data (given with addData).
void setRowOffset ( int r )
| setRowOffset |
void setColumnOffset ( int c )
| setColumnOffset |
void doExport ()
| doExport |
[private slots slot]
int exportformat | exportformat |
[private]
int cells | cells |
[private]
QString* exportFilename | exportFilename |
[private]
QString* exportTablename | exportTablename |
[private]
cell_t * zellExport | zellExport |
[private]
cell_t * last | last |
[private]
char * datastring | datastring |
[private]
char * dtypestring | dtypestring |
[private]
int rowOffset | rowOffset |
[private]
int columnOffset | columnOffset |
[private]
Generated by: marcus on voyager on Mon Sep 16 15:31:33 2002, using kdoc 2.0a53. |