Page 1 of 1

Loading Images from JSon (External URL)

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

Code: Select all

"registry": [{ 
     "room1": "http://server.com/1.jpg",
     "room2": "http://server.com/2.jpg",
     "kitchen": "http://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 JSon (External URL)

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

If you need to load an image form an external URL.
You should use CORS.

Thank you.

Re: Loading Images from JSon (External URL)

Posted: Wed Apr 25, 2018 3:38 pm
by dev3creatives
Hello,

Yes, i need to load an image from a JSon, how i was explain.

Asign a URL stored on JSon Column to an image...

Are you follow me?

Can you help me?

Re: Loading Images from JSon (External URL)

Posted: Wed Apr 25, 2018 8:16 pm
by HighAley
Hello.

You sent us JSON with URLs of the images.
Could you specify your scenario more detailed?
Do you store images or URLs in your JSON data?

Thank you.

Re: Loading Images from JSon (External URL)

Posted: Wed Apr 25, 2018 8:36 pm
by dev3creatives
Ok, its my problem..

I need insert an image in the report but the URL come from my JSon data source (Dictionary)
and that image cant display dynamically from the data source, the only way that i can display one image is by hypervincule manually..

I want to set a Column Data from JSon like a Source of those images

Example JSon

Code: Select all

[{
   "id":"001",
   "first_name":"Jhon",
   "last_name":"McDonald",
   "pictures": [{ 
         "room1": "http://server.com/1.jpg",
         "room2": "http://server.com/2.jpg",
         "kitchen": "http://server.com/3.jpg",
         "bathroom": "http://server.com/4.jpg"
    }]
}]
Thanks in advance

Re: Loading Images from JSon (External URL)

Posted: Thu Apr 26, 2018 9:00 am
by HighAley
Hello.

If you need to show several images dynamically and their quantity is variable you could make some changes in your JSON:

Code: Select all

[{
		"id": "001",
		"first_name": "Jhon",
		"last_name": "McDonald",
		"pictures": [{
				"name": "room1",
				"url": "http://server.com/1.jpg"
			}, {
				"name": "room2",
				"url": "http://server.com/2.jpg"
			}, {
				"name": "kitchen",
				"url": "http://server.com/3.jpg"
			}, {
				"name": "bathroom",
				"url": "http://server.com/4.jpg"
			}
		]
	}
]
Please, look at the attached report template.

Thank you.

Re: Loading Images from JSon (External URL)

Posted: Fri Apr 27, 2018 3:59 pm
by dev3creatives
Thank you, that works fine!!

Re: Loading Images from JSon (External URL)

Posted: Mon Apr 30, 2018 3:29 am
by Andrew
Hello,

You are welcome!