CSV format!
Hi developers..
i have the following code
- void ExportData::on_exportar_clicked()
- {
- if (this->ui->table_agregados->rowCount () != 0){
- this->habilitar_botones (false);
- Dialogcheckeo * get_file_path = new Dialogcheckeo (this, 3);
- get_file_path->exec ();
- int progress= 0;
- double avance = 100/ this->ui->table_agregados->rowCount ();
- QStringList strList;
- for (int row = 0; row < this->ui->table_agregados->rowCount (); row++){
- for (int col = 0; col < this->ui->table_agregados->columnCount (); col++){
- strList << this->ui->table_agregados->item (row, col)->text ();
- }
- data << strList.join (",")+"\n";
- strList.clear ();
- progress+= avance;
- this->ui->progressBar->setValue (progress);
- }
- }else remito.errorString ();
- this->ui->progressBar->setValue (100);
- remito.close ();
- this->habilitar_botones(true);
- }
- }
i can open this file with Excel and Open but what i want is to set the columns name and width (maybe change the font also if its possible lol) how can i accomplish that with Qt? how should i store that information?
I`ve seen something like this:
Col1, col 2, col 3
data1, data2, data3
data4, data5, data6
but this doesnt work, cols are inserted as cell`s not as column names :(
i just need to know the format of csv so that i can play with that, not just simple values separated by a comma
hope anyone can help me…thanks a lot!
3 replies
If you are looking for a more complex format for spreadsheets, take a look at the ODS format (open document standard for spreadsheet). It is a zipped XML format. Qt does not have a build-in way to generate them using high-level primitives, but you should be able to create it using XML and then zipping that XML.
You must log in to post a reply. Not a member yet? Register here!




