VelocityReport print issues

Hi
I have a fairly extensive set of velocity reports set up and for most purposes these are viewed on screen, however the client is now very keen to start printing and for some reason I can not get the plugin to print landscape. I have tried various options, but am consistently getting portrait outputs to both PDF and Printer.

I have tried printing with the following

plugins.VelocityReport.printReport("GM/GMTest.html", reportDisbursements(),		
					{
						showDialog: true,
						size: plugins.VelocityReport.PRINTSIZE.ISO_A4,
						orientation: plugins.VelocityReport.PRINTORIENTATION.LANDSCAPE,
						sides:plugins.VelocityReport.PRINTSIDE.DUPLEX,
						copies:1
					}

As far as I can see this should switch the printer to either landscape or portrait - it does not have any effect.

I have additionaly tried changing the print set up in servoy

controller.setPageFormat(210, 297, 10, 10, 10, 10, SM_ORIENTATION.LANDSCAPE,SM_UNITS.MM);

again with no effect

Finally I have tried previewing the report to the reports own viewer and whilst the preview is fine the print dialogue landscape/portrait options have no effect on the output either to PDF or the Printer its self.

I have no particular issue having the client print to PDF and then print from that in fact I prefer it but what is needed is the facility to switch direction as 34 or the 39 forms are landscape.

Ideas much appreciated, apologies is advance if I have missed the obvious !

Gordon

To work reliably, you also need to set the @page size attribute to either landscape or portrait.
You could use a variable in the context to set it if it needs to be dynamic.

context.orientation = "portrait";
//or
context.orientation = "landscape";

Then in the template:

<style type="text/css" media="print">
    @page {
        size: A4 $orientation;
    }
</style>

Thanks for the advice …
Gordon