I filed a defect issue on the Servoy forge 20 days ago.
(I get an error message when using an image (file) in every report on Webclient Developer)
Still no reaction
I filed a defect issue on the Servoy forge 20 days ago.
(I get an error message when using an image (file) in every report on Webclient Developer)
Still no reaction
What String value do you have for the image path?
Hi Jeff,
Image expression = $P{directory} + “logo4.jpg”
where $P{directory} = "C:\Program Files\Servoy521\application_server\vision\resources\reports" in my case.
Attention : Smart client developer works ok !! Web client developer in same configuration (data, report, etc.) throws error !
Thanks,
Hello,
See below a technique for passing images around/into Jasper, and note that it works for sure in smart client (both developer and deployed on a server). I have not tested it in web client (but it’s a small amount of code if you want to try).
In Servoy…
var rfile = plugins.file.convertToRemoteJSFile('/img.jpg');
var bytes = rfile.getBytes();
var img = null;
if(bytes) {
img = new Packages.javax.swing.ImageIcon(bytes);
}
plugins.jasperPluginRMI.runReport('server','report.jasper',null,'view',{'MY_IMG': img}, 'en');
In iReport…
Define a parameter to hold your image named (for example): $P{MY_IMG}
Expression class property of $P{MY_IMG} parameter should be set to: java.awt.Image
Image expression property of $P{MY_IMG} parameter should be set to: ```
(java.awt.Image)$P{MY_IMG}.getImage() // The casting is necessary for mac os
Place the parameter on your report
Run your report.
A couple of caveats...
1). ImageIcon only support jpg,gif and png image formats.
2). There will be a maximum file size that is allowed for ImageIcon (although I don't know exactly what it is).
Hope this [alternative method] helps.
Hi Jeff,
Thanks for your effort but …
Can you comment on :
IMHO : Servoy support level on the jasper plugin is not in balance (if you use it) with the great possibilities and great importance inside the Servoy solutions of this plugin.
I sincerely hope that forging the project does not mean : If you can’t wait, make or fix it your self…
Regards,
lwjwillemsen:
Hi Jeff,Thanks for your effort but …
Can you comment on :
- Smart client => no problem.
- Plugin version < v 3.1.0 => no problem.
IMHO : Servoy support level on the jasper plugin is not in balance (if you use it) with the great possibilities and great importance inside the Servoy solutions of this plugin.
I sincerely hope that forging the project does not mean : If you can’t wait, make or fix it your self…
Regards,
Regarding the report working in smart client. Do you mean it works in developer or do you mean it works in smart client when the client is gotten from a deployed instance via JNLP?
lwjwillemsen:
Hi Jeff,Thanks for your effort but …
Can you comment on :
- Smart client => no problem.
- Plugin version < v 3.1.0 => no problem.
IMHO : Servoy support level on the jasper plugin is not in balance (if you use it) with the great possibilities and great importance inside the Servoy solutions of this plugin.
I sincerely hope that forging the project does not mean : If you can’t wait, make or fix it your self…
Regards,
Hi Lambert,
Could you please have a look at https://www.servoyforge.net/projects/se … ta_4_notes, at the part with using images? I hope that will help. The method of usage described there works in both Smart Client and Web Client.
Regards,
Andrei
Hi Andrei,
In the notes it says :
There are a few changes which make the plugin usage of font extensions and images easier and more effective.
Easier ? More effective ? If you mean more end user report design troubles and more headache I say yes.
Why does the ‘normal’ image file path name approach work ok in Smartclient and not in Webclient ?
And why did that approach work ok in previous versions of the plugin ?
Regards,