Home > Software design >  How can i store data of database's different categories
How can i store data of database's different categories

Time:01-09

I want to export data into CSV format, i have this tables they have data about customers and products.

enter image description here

I want to export table to CSV for all products. In CSV format it should be like table below. First row is customer id and column under every customer id is prices of products that customer bought.

The question is how can i store data of prices by user and product. I tryed to use queries and arrays, but there can be any amount of customers and products.

enter image description here

To export to CSV i store all data in QString value with ';' for next column and \n for next row and then transimt QString value.

CodePudding user response:

Solved by creating QTableWidget. I transmited data from database in QTableWidget one query in a column and then row by row added data from QTableWidget to QString value to export it later to CSV.

  • Related