PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WD19] Closing preview window after printing
[WD19] Closing preview window after printing
Iniciado por guest, 04,jul. 2016 12:26 - 6 respuestas
Publicado el 04,julio 2016 - 12:26
Hi,

I'm trying to close the preview window after report has been printed.
When I put 'iclosereport()' in the 'after printing end of document', the report preview flashes up, then is closed immediately, but no printing occurs.

Need to be closed after user has really printed the Report.
Any ideas?

Erik
Publicado el 04,julio 2016 - 12:34
Hello Erik

Because the print preview is a black box, I think the standard procedure is to move the existing print button offscreen and make it invisible. Put your own print button in its place and call the original button as the first command in the click event of your button and then after the print runs it should retuurn to your button code and you can close the preview window

Regards
Al
Publicado el 04,julio 2016 - 12:40
Hi Erik,

Is it essential that the Preview window opens in the first place? If not, then why not just print directly or open the printer selection dialog (if there are multiple printers defined) before printing?
Publicado el 04,julio 2016 - 16:18
Hi Al and Darren,

thanks for your suggestions. In case of short time I finally got the easiest way and let the user give two options (with or without preview).

Erik
Publicado el 04,julio 2016 - 18:50
IF NOT iDocumentPrinted() is your friend
Publicado el 05,julio 2016 - 08:31
Hello Klaus,

I have tried this after calling iprintreport using a Loop to wait until idocumentprinted = true with no success.

Where did you put that code in?

Erik
Publicado el 05,julio 2016 - 12:05
Hello Eric,

direct after ipreview(i100)
iprintreport(Report)
IF not iDocumentPrinted() then