Hi,
i need to display images that are stroed as byte arrays in MSSQL in a Report. From what ive seen so far, the image component in reports needs a path as key. Is there a way to display byte array images in reports? I know how to do it in perspective.
There was a similiar post 2 years ago without solution:
What's the actual source of that data? You want a raw Java byte array that contains the binary data for an image (in JPG, BMP, PNG, or a few other formats), not any kind of encoded data.
The image (JPG) is uploaded via the perspective FileUpload Component and a "onFileReceived" action wich utilizes a skript. In that script i use event.file.getBytes() to get the imagebytes and save that to a database (named Query). In the report i query that db for the bytevalue.
It looks like there's some double encoding happening - you shouldn't be getting that leading XML like string if you're uploading the raw image data. Can you post your file upload script?
I assigned the select results to "imageBytes" and then took the value at first row, first column. Somehow that was the problem, if i just use the query result as a whole it works ?
If you know why thats works im interested in that.
Huh, maybe we're automatically doing something in the image component with the (presumably) dataset we're now getting, but I would've thought the same as you, that the right thing to do would be to either unpack in the script or make your query to fetch the image data a scalar query. Either way, working is working