Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: Skip printdialog  (Read 1310 times)

JAVH

  • Newbie
  • *
  • Posts: 10
    • View Profile
Skip printdialog
« 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.
« Last Edit: March 31, 2019, 05:41:49 AM by JAVH »

JAVH

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Skip printdialog
« Reply #1 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