LimeReport Forum
General Category | Основное => Discussion | Обсуждение => Topic started by: JAVH on January 07, 2019, 02:20:52 am
-
Hi!!, sorry for this question that is newbie, recently i'm learning this Report generator and is amazing.
I have a QTreeWidget with a QDoubleSpinBox inside
(https://i.ibb.co/F0PGr7f/1.png)
In this topic topic (http://limereport.ru/forum/index.php?topic=208.msg1192#msg1192) i did learn how to send data from Widget to the report, I can send all, except the last field (SpinBox)
I did try with a casting sending value of SpinBox to a QAbstractItemModel
LimeReport::ReportEngine *Ticket =new LimeReport::ReportEngine(this);
Ticket->dataManager()->addModel("treeWidget",ui->TrWVenta->model(),false);
QAbstractItemModel *ModCant;
ModCant=dynamic_cast<QAbstractItemModel*>(ui->TrWVenta->itemWidget(Item,3));
Ticket->dataManager()->addModel("Cantidad",ModCant,true);
Ticket->designReport();
But in data manager I get only this (with red circle) and I cannot view any data
(https://i.ibb.co/3CFNjf3/2.png)
How can send data from QDoubleSpinBox to the report??
Thanks and sorry for my bad english!!
-
Hi!
Thanks and sorry for my bad english!!
I am not native speaker too :) If we can understand each other in my opinion this is enough :)
As i can see the field "Candidad" is present in the model that you sent to limereport.
As i guess you don't see the value of this field, isn't it?
I think the problem in your delegate item that represent field value as spinbox in the treewidget.
Possible it does not sending the value to the treewidget model.
-
Thanks, I can't sent value, SpinBox haven't model property and QTreeWidgetItem value (QSpinBox delegate) is in blank, only QSpinBox save the value but cannot send to report.
I did create another QTreeWidget and did copy all values to this, including SpinBox value, and sent this to LimeReport.
If there are a better way to do this I will be grateful.
Best regards.
-
Just for example
-
@Arin Alex, please is there any way I can run the report direct to PDF without going through the process of adding data band, headers on Lime Report Designer?
-
solomon78
I don't clearly understand what do you mean?
You can create a report pattern in the designer than save it to disk and print it to the pdf file.
-
Just for example
Thanks and sorry for the late answer, in my case I must did to create other QtreeWidget in memory and did copy all values of first QtreeWidget (and passing it the qspin value) and I did send last TreeWidget to LimeReport like in your example. But if there are another way less dirty for send delegate values I will be grateful.
Thanks!!
-
JAVH
Hi.
The spinbox delegate is needed for putting data to the treeview model.
It is the standard qt way for organizing editing data in the treeview.
Why you don't like it?
-
Hi Alex, I'm entering manually data in this, in this case I'm not using data of a database.
Thanks for the suggestion!!
Best reggards.