Loading images from datacolumn URL

Stimulsoft Reports.JS discussion
Post Reply
Inhabe
Posts: 11
Joined: Wed Nov 08, 2017 10:41 am

Loading images from datacolumn URL

Post by Inhabe »

Hello,
I have some table designed like this:

Code: Select all

"PicTable": 
{
"Column1": "123.jpeg"
}
I load it from json and have controller method that would carry about 123.jpeg request.
The thing is when i try to do follows:

Code: Select all

 for (var index in headerData.columns.list) {
             var dataColumn = data.columns.list[index];
             var sampleImage = new Stimulsoft.Report.Components.StiImage();
             sampleImage.hyperlink = "{PicTable." + dataColumn.columnName+"}";
             dataBand.components.add(sampleImage);
it does not even make request. I tried another way

Code: Select all

var stiImage = Stimulsoft.System.Drawing.Image.fromFile("{PicTable."+dataColumn.columnName+"}");
But this pulling requests like PicTable.Column1 , PicTable.Column2 etc.
Is there any proper way to load image to dataBand from hyperlink coming from json?
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Loading images from datacolumn URL

Post by HighAley »

Hello.

Do you load image from the same domain.
Please, check the console of the browser.
At seems that you should use CORS.

Thank you.
Inhabe
Posts: 11
Joined: Wed Nov 08, 2017 10:41 am

Re: Loading images from datacolumn URL

Post by Inhabe »

Hello,
Yep, it goes for same domain.
However, request looks like

Code: Select all

http://localhost:5000/v1/report/246/810a61cb-e418-4028-8061-0f5fc541d8b8/%7BSegNeutroGallery.Column1%7D
and i want value of SegNeutroGallery.Column1 except it name.
In first case when i assign hyperlink there is no request at all.
My question comes to "How do i get value of cell before it rendered?"
From headers of hequest it clearly can not be evaluated as "{SegNeutroGallery.Column1}", but how?
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Re: Loading images from datacolumn URL

Post by Edward »

Hi Inhabe,

It looks like the task you need to complete is not that easy to be implemented.

Please try to implement your own function to process the required values out of that URL. This is how you can do that: viewtopic.php?f=27&t=55853

Alternatively, if you could modify the links before registering them into the report data, then you can render the links into the image component in a similar way as it was discussed in the following topic:
viewtopic.php?f=27&t=55853

Thank you,
Edward
Inhabe
Posts: 11
Joined: Wed Nov 08, 2017 10:41 am

Re: Loading images from datacolumn URL

Post by Inhabe »

I solved it using imageURL instead of hyperlink
Andrew
Posts: 4104
Joined: Fri Jun 09, 2006 3:58 am

Re: Loading images from datacolumn URL

Post by Andrew »

Hello,

Thank you for letting us know about this.
dev3creatives
Posts: 5
Joined: Mon Apr 23, 2018 2:45 pm

Re: Loading images from datacolumn URL

Post by dev3creatives »

Hello Everyone!!!,

I have a json with a data structure, this structure is my data dictionary and I have a series of information there, including the url of the images that I need to show in the report.

My question is...

How can I insert these images from the url?

Example:

"registry": [{
"room1": "https://server.com/1.jpg",
"room2": "https://server.com/2.jpg",
"kitchen": "https://server.com/3.jpg",
"bathroom": "https://server.com/4.jpg"
}]

And I need to insert the images on a page where I have 4 image tags. This information is variable and I need that every time the JSon changes the images change

Thanks in advance
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Loading images from datacolumn URL

Post by HighAley »

Hello.

You should set the Hyperlink property of the image.
Do you get any error or issue with it?

Thank you.
Post Reply