Problem converting a media field for Jasper

Hi I´m using this code to send a media field to JasperReport. It works fine on Developer but I get an error from Server. Nothing is shown in the server log.

var logo=null;
if(fsSucursales.logo){
	logo=new Packages.java.io.ByteArrayInputStream(fsSucursales.logo);
	logo=new Packages.javax.imageio.ImageIO.read(logo);
}
aArguments={
	logoInquilino:logo,
	nombreInquilino:globals.recordCurrentInquilino.nombre,
	dFecIni:(fechaInicial==null ? new Date(1900,1,1) : fechaInicial), 
	dFecFin:(fechaFinal==null ? new Date(2999,1,1) : fechaFinal),
	nGrpIni:(grupoCliente==0 ? null : grupoCliente), 
	nCliIni:(clienteInicial==0 ? null :clienteInicial),
	nSerIni:(serieInicial==0 ? null : serieInicial), 
	nSucIni:(emisorInicial==0 ? null : emisorInicial),
	nInquilino:globals.recordCurrentInquilino.idinquilino,
	pNombreCliente: (!clienteInicial ? "Todos" : fsClientes.nombre),
	pNombreSerie: (!serieInicial ? "Todas" : fsSeriesFacturacion.nombre),
	pNombreEmisor: (!emisorInicial ? "Todos" : fsSucursales.nombre),
	SUBREPORT_DIR:plugins.jasperPluginRMI.reportDirectory
}

The error means that the object you create on the client (javax.imageio.ImageIO) cannot be sent to the Servoy server, because it is not serializable. That problem will not occur in developer…

Thanks Patrick. Any clue in how to send the image to Jasper?

Juan,

Perhaps you could put theh bytes in the parameters and convert to image in your jrxml:

net.sf.jasperreports.engine.util.JRImageLoader.loadImage((byte[]) $F{logoInquilino})

Rob

Hi Juan,

could you fix the problem and if yes how?
Does the codeline [net.sf.jasperreports.engine.util.JRImageLoader.loadImage((byte) $F{logoInquilino})] from Rob help you?
Where do I have to integrate the code in iReport?

Regards

Sorry Thomas, before I had the last reply I fixed it by getting the image in the jasper query.

jasantana:
Sorry Thomas, before I had the last reply I fixed it by getting the image in the jasper query.

No problem Juan!

I get it running by myself :D .
Normally I also set an image on a report by a subreport and a sql query, but I have a couple of especial reports with data from foundsets. For this I have to set the image by a parameter value because of the missing unique id.
In the iReport properties of the parameter “IMAGE” I set the Default Value Expression to “net.sf.jasperreports.engine.util.JRImageLoader.loadImage((byte) $P{IMAGE})” and now it works on the server-client environment.

Regards