JasperViewer Zoom Level

The JasperReports plug-in allows you to preview a report (using the JasperViewer) by setting the .jasperPluginRMI.runReport() output format property as follows:

OUTPUT_FORMAT.VIEW

The JasperViewer has three view settings:

Actual Page Size (100%)
Fit Entire Page
Fit Page Width

with 100% Page Size being the default.

I would like to be able to set Fit Entire Page as the default. Does anyone know how to do this?

Thanks!

Hello,

This could be done, but would require changes to the plugin itself. See CustomizedJasperViewer class in the provider for more information (if you want to tackle that on your own).

We also would like to be able to show the entire page as default. Otherwise users have to resize each and every preview window - quite annoying.

Regards,

kwpsd:
I would like to be able to set Fit Entire Page as the default. Does anyone know how to do this?

Hi,

This has been added to the Servoy JasperReports Viewer bean. See https://www.servoyforge.net/issues/377.

Regards,
Andrei

Hi

Even better the plugin should also not only be able to set the default view for the jasper viewer window but also:

able to set the size of the window
set the position of the window -1 -1 would be ideal :) , (currently always defaults to the primary display, this is a jarring effect when using multiple monitors))

Andrei, thanks for implementing this feature and for all your hard work supporting the Jasper Reports plug-in. I very much appreciate your efforts!

Version: 6.0.2 - build 1222

Andrei,

In developer, I updated the Jasper Report plug-in and bean to v3.3.0 b1 (all files are dated 11/25/2011) and added one line of code to set the display mode in the bean:

elements.bean_jasper_preview.displayMode = JR_SVY_VIEWER_DISPLAY_MODE.FIT_WIDTH     <--- ADDED LINE OF CODE

elements.bean_jasper_preview.showReport( fs, reportName, reportArguments )

and received the following run-time error message:

ReferenceError: “JR_SVY_VIEWER_DISPLAY_MODE” is not defined.

Without the new line of code, it works fine. The new code line was added using the auto-completion when in the bean. Is this a bug, or did I not code this correctly?

Thanks!

kwpsd:
Version: 6.0.2 - build 1222

Andrei,

In developer, I updated the Jasper Report plug-in and bean to v3.3.0 b1 (all files are dated 11/25/2011) and added one line of code to set the display mode in the bean:

elements.bean_jasper_preview.displayMode = JR_SVY_VIEWER_DISPLAY_MODE.FIT_WIDTH     <--- ADDED LINE OF CODE

elements.bean_jasper_preview.showReport( fs, reportName, reportArguments )




and received the following run-time error message:



> ReferenceError: "JR_SVY_VIEWER_DISPLAY_MODE" is not defined.



Without the new line of code, it works fine. The new code line was added using the auto-completion when in the bean. Is this a bug, or did I not code this correctly?

Thanks!

Kim, please add one piece of code before yours: “plugins.jasperPluginRMI”.
The viewer’s constants are in the plugin’s code (so it’s needed to have both plugin and bean updated to latest version, but you already have that).
You need that because of the way plugins are loaded (before using the constants provided by the Jasper plugin, first the plugin has to be touched).
I hope this helps.

Regards,
Andrei

in servoy 6.1 this will be fixed because then types/constants of plugins must be accessed through the plugin itself:

plugins.jasperPluginRMI.JR_SVY_VIEWER_DISPLAY_MODE.FIT_WIDTH

this will fix the problem that you have above and will also fix name clashes if different plugins are using the same name for a return type/constant

Thanks for the tip and the explanation, Andrei…it now works! You may want to add this tip to your release notes on Servoy Forge, so that others do have the same problem (at least, until Servoy v6.1 is released).

Johan, thanks for the update!