LimeReport Forum

General Category | Основное => Discussion | Обсуждение => Topic started by: JAVH on March 31, 2019, 05:29:21 AM

Title: Skip printdialog
Post by: JAVH on March 31, 2019, 05:29:21 AM
Hi, I learn to send to print I can use this:

Code: [Select]
ReportEngine::printReport(QPrinter * printer = 0)
I did try but I get this error:

Code: [Select]
expected primary-expression before * token
'printer' was not declared in this scope

Ok, I declare printer before and then do this:

Code: [Select]
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:

Code: [Select]
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.
Title: Re: Skip printdialog
Post by: JAVH on March 31, 2019, 06:41:22 AM
Sorry, reply to himself, my bad english cannot understand the original post

I can send directly passing the printer

Code: [Select]
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