Embedding images [message #67395] |
Thu, 11 August 2005 13:54  |
Eclipse User |
|
|
|
In postgres i'm storing images as bytea types. I'm selecting the data from
the
document table and when I go to access it and create an image in the report
from
it it won't render. I've traced the problem down to these lines in
ImageItemExecutor.java :
byte[] blob = null;
if ( value != null && value.getClass( ).isArray( ) &&
value.getClass( ).getComponentType( ) == byte.class ) {
blob = (byte[]) value;
}
These lines effectively limit the type of the column containing the image
data
to blobs. THe problem is blobs aren't that great in postgres and have tons
of
problems. So I use bytea objects that come back as strings in BIRT. I'm
trying
to embed an image in the report. via this tag:
<image source="expr">
<expression name="typeExpr">row["mimeType"]</expression>
<expression name="valueExpr">row["donorPicture"]</expression>
</image>Anyone figured this out? I'm going to try patching
ImageItemExecutor
|
|
|
|
|
Re: Embedding images [message #67864 is a reply to message #67742] |
Fri, 12 August 2005 19:19  |
Eclipse User |
|
|
|
Hi Joe,
Thanks for your contribution.
We are indeed planning to add support of the BLOB and CLOB data types in BIRT and the ODA framework in the next release.
See Bugzilla #95793: https://bugs.eclipse.org/bugs/show_bug.cgi?id=95793
Linda
Joe Rybacki wrote:
> Well, I finally figured it out, I had to change 3 birt jars. data,
> data.oda, and report.data.oda.jdbc, the plugin.xml and manually edit my
> report. I"ve attached the source changes in 3 zip files. Basically the
> problem was that the binary column was converted to a string effectively
> destroying the image coming out of the database. Also had to support the
> byte array as an oda type.
>
> The plugin.xml change for report.oda.jdbc:
> FROM:
> <dataTypeMapping
> nativeDataType="BINARY"
> nativeDataTypeCode="-2"
> odaScalarDataType="String"/>
> To:
>
> <dataTypeMapping
> nativeDataType="BINARY"
> nativeDataTypeCode="-2"
> odaScalarDataType="byte"/>
>
> To embed the image element as an expression in the report file:
>
> <image source="expr">
>
> <expression name="typeExpr">row["mimeType"]</expression>
>
> <expression name="valueExpr">row["picture"]</expression>
>
> </image>
>
> Hope this helps, Maybe this could be incorporated into the birt source code.
>
> Thanks,
> Joe
>
>
> Name: org.eclipse.birt.report.data.oda.jdbc-changes.zip
> org.eclipse.birt.report.data.oda.jdbc-changes.zip Type: WinZip File (application/x-unknown-content-type-WinZip)
> Encoding: x-uuencode
>
> Name: org.eclipse.birt.data.oda-changes.zip
> org.eclipse.birt.data.oda-changes.zip Type: WinZip File (application/x-unknown-content-type-WinZip)
> Encoding: x-uuencode
>
> Name: org.eclipse.birt.data-changes.zip
> org.eclipse.birt.data-changes.zip Type: WinZip File (application/x-unknown-content-type-WinZip)
> Encoding: x-uuencode
|
|
|
Powered by
FUDForum. Page generated in 0.04287 seconds