Project

General

Profile

Feature #587

Passing Servoy's media jasperReport

Added by Imre Tokai over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Start date:
11/16/2012
Due date:
% Done:

100%

Estimated time:
Browser (if web client):

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

#1

Updated by Fabrice Roger-Dalbert over 11 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);

#2

Updated by Imre Tokai over 11 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100

Thanks Fabrice -it works!
JRImageLoader.loadImage does the trick

Regards

#3

Updated by Andrei Costache over 11 years ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF