#1 2023-09-05 21:12:35

cyclik
Member
Registered: 2023-09-05

JXLS / Jasper - File upload parameter to insert image into report

Hi!
I tried to search the forum and other online resources with no luck so I'm trying to check if there is any available solution to my issue.
I'm on community edition.
I have a JXLS template that fetches some product data from our database and it works fine. Now I'm trying to use file-upload parameter to let the user upload an image and use this image inside a jx:image tag or a simple ${parameters.image} without success.
I have the same problem with jrxml report, having the image expression evaluated as the parameter. No success.
So basically I have two questions:
1. How the uploaded file is stored and referenced inside report server? Is it accessible as raw data (like using team spaces' file upload?)
2. Is there any method to insert an image inside a JXLS or a jrxml report, considering the image will be uploaded during report execution?

Thanks

Offline

#2 2024-02-23 15:09:37

Uddeep
Member
Registered: 2024-02-14

Re: JXLS / Jasper - File upload parameter to insert image into report

Hello cyclik,
I've same question as yours. Did you find any solution?

Offline

#3 2024-02-26 07:29:35

IF_Felix
Moderator
Registered: 2022-08-01

Re: JXLS / Jasper - File upload parameter to insert image into report

hi!

If you're embedding an URL into any document that points to a file in the reportserver filesystem please make sure that the directory that contains your file is "available for web access" (the small checkbox). Then you can use a URL like: http://path.to.reportserver/reportserve … /image.xyz (i assume that there might be some permission issues for the jxml renderer... you can also test an image that is hosted somewhere accessible from somewhere else)

I'm not absolutely sure if you can insert an image into a jxml template... but maybe stored images are overwritten if they are inside of the specified jxml area? Can you try to insert an image into a template outside of your specified area?

This might be JXML (or JRXML?!) related... so i'm affraid that we can only help you to a certain point sad

kind regards

felix


Softwareentwickler bei Infofabrik

Offline

#4 2025-09-24 21:34:22

repsak
Member
Registered: 2025-09-24

Re: JXLS / Jasper - File upload parameter to insert image into report

WORKING WITH IMAGES
Adding Images to an Excel Template
Step 1: Query the Image from the Database
jx:each(items="jdbc.query('select dataimage from employes where id=2')" var="img" lastCell="B2")
Step 2: Insert the Image
jx:image(lastCell="B2" src="img.dataimage" imageType="JPEG")

Important Considerations:

The query must obtain the bytes of the image (BLOB/BYTEA field type).
The image size adjusts from the cell where the note is placed to the lastCell.
The default imageType is PNG.
Supported Formats: PNG, JPEG, EMF, WMF, PICT, DIB

Note Location:

jx:each: In the cell where you want the note to appear. image
jx:image: In the same cell or defined range

BEST PRACTICES
Note Positioning

Place jx: notes in the exact cell where you want processing to begin.
The lastCell defines how far the work area extends.


SQL Queries

Use escaped single quotes: \'text\'
Make sure field names match the variables in the template.
Queries should return data in the expected format.

Offline

Board footer

Powered by FluxBB