Hi everybody,
I’ve been trying to findout why printpreview() does not work ok.
The scenario is that I have some forms I want to show in printpreview.
For almost every form this works fine.
But for others the method runs ok till it gets to the printpreview line. It just gets there, runs the code, but does nothing at all.
No error, no action, no nothing.
Here is the code I use when the printing button is actioned.
If there is something on the relation foundset I load it into a form. Else show a error msg.
function rpt_detallesAlumno_list()
{
if(gcuralumnoid_to_cctealumno_detalle.getSize()> 0)
{
forms.rpt_detallesAlumno_list.foundset.loadRecords(gcuralumnoid_to_cctealumno_detalle)
forms.rpt_detallesAlumno_list.onLoad()
globals.printRoutine('rpt_detallesAlumno_list')
}
else
{
var msg = i18n.getI18NMessage('msg.printError')
var btnMsg = i18n.getI18NMessage('lbl.Aceptar')
globals.showErrorDialog(msg, null ,btnMsg);
}
}
This is the function printRoutine() used in the previous code.
function printRoutine()
{
var frm = arguments[0]
var oneRecord = arguments[1]
if(!oneRecord) oneRecord = false
if(!frm) return;
forms[frm].controller.showPrintPreview(oneRecord)
}
frm is a string with the name of the form I want to print and oneRecord is a bool to check if I just want to print one record or every record in the foundset.
This works ok for most of the forms. But for one or two this does not work. Every form is called in the same way and I’ve already checked if the foundset has been getting any records, wich it has. Also the string with the form name is perfect.
Am I doing something wrong???
Could some object of the form prevent the printpreview to work correctly??
Thanks for the reply.