LimeReport Forum
General Category | Основное => Discussion | Обсуждение => Topic started by: JAVH on March 31, 2019, 05:29:21 am
-
Hi, I learn to send to print I can use this:
ReportEngine::printReport(QPrinter * printer = 0)
I did try but I get this error:
expected primary-expression before * token
'printer' was not declared in this scope
Ok, I declare printer before and then do this:
Etiqueta->printReport(printer=0);
But then print dialog shows, only get printer selected, but not skip dialog, there are another new way to do?? I'm using last git version.
This is my code:
LimeReport::ReportEngine *Etiqueta=new LimeReport::ReportEngine(this);
QPrinter *printer;
Etiqueta->loadFromFile("rpt/barcode.lrxml");
Etiqueta->dataManager()->setReportVariable("barcode",Codigo);
Etiqueta->printReport(printer=0);
Thanks and best regards.
-
Sorry, reply to himself, my bad english cannot understand the original post
I can send directly passing the printer
LimeReport::ReportEngine *Etiqueta=new LimeReport::ReportEngine(this);
QPrinter printer;
printer.setPrinterName(Var.LabelPrinter); //this select printer and do the magic, hehehehehe
Etiqueta->loadFromFile("rpt/barcode.lrxml");
Etiqueta->dataManager()->setReportVariable("barcode",Codigo);
Etiqueta->printReport(&printer);
Thanks again and sorry for bad understanding :P