Dynamically load image

Stimulsoft Reports.JS discussion
Post Reply
huangguangc
Posts: 5
Joined: Wed Jul 05, 2023 1:22 am

Dynamically load image

Post by huangguangc »

Hello,

the image data I get from the api is as follows:

Code: Select all

{
  "url": "/upload/20230425151810.jpg"
}
The image server is at http://localhost:3000.

The image download address is obtained by combining the address of the image server and the image url.

Code: Select all

http://localhost:3000/upload/20230425151810.jpg
Finally, I need to display this image in my report. How do I do that? Thanks.
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Dynamically load image

Post by Lech Kulikowski »

Hello,

You can use the following expression for the Hyperlink property of the Image:
{"http://localhost:3000" + root.url}

Thank you.
huangguangc
Posts: 5
Joined: Wed Jul 05, 2023 1:22 am

Re: Dynamically load image

Post by huangguangc »

Lech Kulikowski wrote: Fri Aug 11, 2023 2:45 pm Hello,

You can use the following expression for the Hyperlink property of the Image:
{"http://localhost:3000" + root.url}

Thank you.
Thank you for your help. How to include the Authorization field in the request header when requesting resources? Our image server requires a token to be authenticated for access.
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Dynamically load image

Post by Lech Kulikowski »

Hello,

Unfortunately, there are no ways for images. You can retrieve all images in your code and then provide to the report as resources or data source.

Thank you.
Post Reply