Playing around with Jasper report studio. I’m stuck with an issue. At the header band, I have an Image (Logo image). Testing the report directly from Jasper studio the image is printed, but once I export the jrxml file and set it as a template for Cuba report, an error is thrown saying the bitmap can’t be found. At Jasper studio, I set the image source from the workspace, but can’t figure out how to export this image together with the jrxml file. When I delete this image from the template at Jasper studio, the jrxml works from cuba.
bitmap - transforms the given byte array into ByteArrayInputStream and can be used for embedding images into the report. For example:
<field name="Main.image" class="java.lang.Object"/> //image from DB as byte array
...
<imageExpression><![CDATA[$P{REPORTING}.bitmap($F{Main.image})]]></imageExpression>
The Static image is at fileStorage. Should I create then at Report designer, the Band info as groovy type dataset and create a map with the bitmap string?
The report is an Invoice and each product has his own Image to be printed. This Image is a FileDescriptor associated to Product Entity and stored in fileStorage, too. Should I change dataset type from JPQL to Groovy to be able to include each Image together with Invoice Line info?
… sorry, but I’m feeling really lost at this point.
I can’t get how-where-when to pass as parameter an Image (For title band and for detail band)
I will try to explain my case:
I have a report
Using as dataset for detail band a SQL sentence which returns field from diferent entities…
Now, I need to add for each detail record an Image to be printed together. This image is a fileDescriptor field in Product entity.
I think I’ve understood how to setup Jasper template to reference an image passed by parameter, but I have no clue HOW to pass this parameter to the Template from the Cuba report designer.
Taking in count the SQL sentence (above in picture) references fields from different entities,
¿How can I add the Producto Image to each record as a byteArray?
I’m stretching my mind and I think I should use Groovy ¿is this right?
¿Could you give some aproach to do that, please? Sorry for my ignorance.