PrintPreview not working 5.1.1

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. :D

Does anything appear in the log files when print preview does nothing? (in case you are running from developer, the one in app. server folder and the one in your workspace/.metadata)

Hi Andrei,

Nope, I cleaned both logs and nothing is registered when I use the printpreview.
Right now I’m having this problem with 3 forms.
No problems with the other 10 (aprox.).
Could it be that I’m calling the printRoutine() from a dialog the problem??
Remember printRoutine() is a global method so it should not be a problem.

I’m considering using another way for printpreviewing since this is not working.
But I’m runing out of ideas. :?

Thanks for the help :D

I just used print preview with dialogs. Are you using smart client?
Are you sure controller.showPrintPreview(…) is being called?

If yes, maybe you should add a case to the support system with a sample solution attached so that we can have a look.
http://servoy.com/s

Yes it’s being called.
I’ve debug it many times, and the result is always the same, it gets ok to the form[frm].controller.showprintpreview() line, runs the code and finishes with no action or error.
I’ll try to make a sample and post the case.
Thanks