Feature #587
Passing Servoy's media jasperReport
100%
Description
Hello,
How to pass media:///logo.png to .jrxml built in iReport?
Familiar with below approach:
https://www.servoy.com/forum/viewtopic.php?f=15&t=16909
but now need to submit Servoy's media object
Any hints? Are there any preferred formats, extensions?
Regards
History
Updated by Fabrice Roger-Dalbert over 12 years ago
did you try this kind of jasper usage:
- create a logo parameter in your report (parameter class java.lang.object) then from your ireport palette place an image component (cancel the path wizard)
- in the image component check that expression class is java.awt.image and change the source expression to
net.sf.jasperreports.engine.util.JRImageLoader.loadImage((byte[]) $P{logo})
- then from servoy
parameters['logo']=solutionModel.getMedia('mylogo.png').bytes;
plugins.jasperPluginRMI.runReport(databaseManager.getDataSourceServerName(controller.getDataSource()),
'yourreportwithlogo.jrxml' ,null,plugins.jasperPluginRMI.OUTPUT_FORMAT.VIEW,parameters);
Updated by Imre Tokai over 12 years ago
- Status changed from New to Feedback
- % Done changed from 0 to 100
Thanks Fabrice -it works!JRImageLoader.loadImage
does the trick
Regards