Dynamic Image Issue

Stimulsoft Reports.PHP discussion
plantant
Posts: 17
Joined: Sun Jan 30, 2011 8:40 pm
Location: NY, USA

Dynamic Image Issue

Post by plantant »

I'm having trouble implementing dynamic images for my reports. I want a the customers logo to appear on the page and therefore need to change the name of the JPG based on the customers ID. I've read the forum all day and tried everything I saw but nothing works.

I created an image object, and the only way I can get the image to appear is to enter the entire url in the Image URL tab.

I have a variable of the supplier id set as {supplier}, I also have the full image url (http://www.plantant.com/1000002.jpg) in the database and can access it with {Supplier_Info.logo}

I've tried the following with no success:

1. Entering in either the Image URL box or the Image Data box: http://www.plantant.com/{supplier}.jpg
2. Entering in either the Image URL box or the Image Data box: {Supplier_Info.logo}
2. Entering in either the Image URL box or the Image Data box (not that I think this one was gonna work, but wanted to try everything): {Image.FromFile(Supplier_Info.logo)}

The image just doesn't display. I don't get any errors. Is there a debug window I can enable?
I'm using this download: FXPHP_2011.01.25_Trial

Please help, I'm down to this and one other issue before we purchase!
plantant
Posts: 17
Joined: Sun Jan 30, 2011 8:40 pm
Location: NY, USA

Dynamic Image Issue

Post by plantant »

Also wanted to add, that even if I enter the image using the full URL and get it to appear, it does not appear in the PDF. Is there any way to fix this?
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Dynamic Image Issue

Post by Vladimir »

Hello,

Please tell us, an image URL is in the same domain as the report designer (or viewer)?

Thank you.
plantant
Posts: 17
Joined: Sun Jan 30, 2011 8:40 pm
Location: NY, USA

Dynamic Image Issue

Post by plantant »

Yes, the URL I showed you is an example. I'm working locally so i used the same IP address in my browser window to call the image. I tried outputting the value of {Supplier_Info.logo} to a data band, copied and pasted it into a new tab, and the image does appear.

For example, here is my designer URL:
http://192.168.1.12/stimulsoft/index.ph ... er=1000002

and my image url:
http://192.168.1.12/images/suppliers/logos/1000002.jpg

Thanks
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Dynamic Image Issue

Post by Vladimir »

Hello,

Please send us a report in what you are using the image. Or, please post there an expression that you use in the Image URL.

Thank you.
plantant
Posts: 17
Joined: Sun Jan 30, 2011 8:40 pm
Location: NY, USA

Dynamic Image Issue

Post by plantant »

I have uploaded an example which can be reached here:

http://www.getdanny.com/stest/stimulsof ... 000002.jpg

I have 4 images on the page. The first links to the file using a relative path and is the only one that displays. The absolute path for the image is http://www.getdanny.com/stest/reports/1000002.jpg

I tried using the absolute path, and a relative path with no success.

Thanks for your help,

Danny
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Dynamic Image Issue

Post by Vladimir »

Hello,

In your report the variables, used in the Image URL, are not defined. Please create variables with the same names in the data dictionary, leave the type of variables as string, then you can use them in the report.

Thank you.
plantant
Posts: 17
Joined: Sun Jan 30, 2011 8:40 pm
Location: NY, USA

Dynamic Image Issue

Post by plantant »

Hi Vladimir, that fixed the issue. I created a variable with the same parameter name, as a string, and left it blank. Then I was able to access the variable in my image object.

I'm still having the issue with the image output to the PDF though. How can I get my image to appear when I save as a PDF?

Thanks
plantant
Posts: 17
Joined: Sun Jan 30, 2011 8:40 pm
Location: NY, USA

Dynamic Image Issue

Post by plantant »

I solved the issue. I had the image too close to the top right. After I gave it a little space, it started appearing in the PDF output.

Thanks
Andrew
Posts: 4108
Joined: Fri Jun 09, 2006 3:58 am

Dynamic Image Issue

Post by Andrew »

Great!

Have a nice day!
Post Reply