I have a form to print. In need to choose the printer from a table witch have the path because it will change.
We need to print directly, i mean without print preview dialog.
I have the follow code:
But i get the follow error in the setPrefferedPrinter function.
TypeError: Cannot find function setPrefferedPrinter. (C:\Documents and Settings\mcarle\servoy_workspace\PruebaDBF\forms\frm_analisis_gral.js#540)
TypeError: Cannot find function setPrefferedPrinter. (C:\Documents and Settings\mcarle\servoy_workspace\PruebaDBF\forms\frm_analisis_gral.js#540)
at C:\Documents and Settings\mcarle\servoy_workspace\PruebaDBF\forms\frm_analisis_gral.js:540 (impresionInformes)
at C:\Documents and Settings\mcarle\servoy_workspace\PruebaDBF\forms\frm_analisis_gral.js:144 (guardar)
I am working in Servoy 5.1.3 version
Thanks in advantage for your help
Sorry by my silly mistake,
Now is acepting the function setPreferredPrinter:
globals.idFormularioTmp = 1 //(1=timbres) Se setea el tipo de formulario
var array = application.getPrinters()
controller.setPreferredPrinter(array[1])
forms.impresion_costo_timbre.controller.print(true, false)
But is not taking any effect, i mean the form is sent to print but the printer which recive the job is the preffered by windows not the one i wanted.
Anyone knows other way to set the printer directly (no with the print dialog).
setPreferredPrinter is not working for me. Always goes to the printer that is the preferred by windows.
Thanks a lot.
My mistake was to put:
controller.setPreferredPrinter(“Epson LX-300”)
instead of:
forms.impresion_costo_timbre.controller.setPreferredPrinter(“Epson LX-300”)
i share this in case it help anyone.
Thank you.
Yes, i think that with the short line i was setting the preferred printer for the form where i writed the line code.
This form was calling to print other form, so i need to write the complete line to really set the preferred printer for this other form