Page 1 of 1

Loading images from datacolumn URL

Posted: Wed Nov 08, 2017 10:51 am
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?

Re: Loading images from datacolumn URL

Posted: Wed Nov 08, 2017 3:28 pm
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.

Re: Loading images from datacolumn URL

Posted: Thu Nov 09, 2017 5:32 am
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?

Re: Loading images from datacolumn URL

Posted: Tue Nov 14, 2017 1:24 am
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

Re: Loading images from datacolumn URL

Posted: Fri Dec 01, 2017 8:06 am
by Inhabe
I solved it using imageURL instead of hyperlink

Re: Loading images from datacolumn URL

Posted: Sat Dec 02, 2017 5:00 am
by Andrew
Hello,

Thank you for letting us know about this.

Re: Loading images from datacolumn URL

Posted: Mon Apr 23, 2018 4:28 pm
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

Re: Loading images from datacolumn URL

Posted: Tue Apr 24, 2018 10:00 pm
by HighAley
Hello.

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

Thank you.