# Foundset Report and Image

**URL:** <https://forum.servoy.com/t/foundset-report-and-image/17492>\
**Category:** Classic Servoy\
**Created:** [September 26, 2013, 3:57pm UTC](https://forum.servoy.com/t/foundset-report-and-image/17492 "2013-09-26T15:57:05Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![rieder](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/rieder/32/4950_2.png) [@rieder](https://forum.servoy.com/u/rieder)\
**Post date:** [September 26, 2013, 3:57pm UTC](https://forum.servoy.com/t/foundset-report-and-image/17492/1 "2013-09-26T15:57:05Z")

</div>

Hi

I followed the instruction:

but get a compilation error: Loder cannot be resolved to a type. What am I missing?  
I’m using iReport 4.0.

Thanks  
Birgit Rieder

---

<div class="post-metadata">

**Author:** ![rieder](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/rieder/32/4950_2.png) [@rieder](https://forum.servoy.com/u/rieder)\
**Post date:** [October 1, 2013, 6:57am UTC](https://forum.servoy.com/t/foundset-report-and-image/17492/2 "2013-10-01T06:57:46Z")

</div>

Hi

Any idea on how to use an image in a foundset report?

Kind regards  
Birgit

---

<div class="post-metadata">

**Author:** ![Andrei\_Costache](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@Andrei\_Costache](https://forum.servoy.com/u/Andrei_Costache)\
**Post date:** [October 2, 2013, 6:26am UTC](https://forum.servoy.com/t/foundset-report-and-image/17492/3 "2013-10-02T06:26:09Z")

</div>

Hi Birgit,

Using an image in a foundset based report is described in here [https://www.servoyforge.net/projects/se … Guidelines](https://www.servoyforge.net/projects/servoy-jasperreports/wiki/Foundset_Based_Reports_Guidelines).  
How are you compiling the report: using iReport or via the plugin’s compileReport function?  
Also, what version of the plugin (and Servoy) are you using?

Regards,  
Andrei

---

<div class="post-metadata">

**Author:** ![rieder](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/rieder/32/4950_2.png) [@rieder](https://forum.servoy.com/u/rieder)\
**Post date:** [October 2, 2013, 10:56am UTC](https://forum.servoy.com/t/foundset-report-and-image/17492/4 "2013-10-02T10:56:11Z")

</div>

Hi Andrei

Thanks for the reply.

I did follow the instruction you described (see my copied and pasted code). If I compile the report with iReport, I do get the error I did post. If I compile with the plugin, compiling is successful. But I do get an runtime error:

ERROR: Exception from plugin: message: \<java.lang.Exception: Error evaluating expression :  
Source text : com.servoy.plugins.jasperreports.JasperReportsResourceLoader.loadImage(“kantiLogo.jpg”)\>

The image resides in the same folder as the reports source. What am I doing wrong? Any idea?

iReport 4.0  
Servoy 5.2.16  
JasperPlugin 3.2.0

Thanks and regards  
Birgit

---

<div class="post-metadata">

**Author:** ![Andrei\_Costache](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@Andrei\_Costache](https://forum.servoy.com/u/Andrei_Costache)\
**Post date:** [October 2, 2013, 11:19am UTC](https://forum.servoy.com/t/foundset-report-and-image/17492/5 "2013-10-02T11:19:31Z")

</div>

Brigit, what are the values for your report directory and for the extra dirs properties? (from the admin page plugin settings)

Regards,  
Andrei

---

<div class="post-metadata">

**Author:** ![rieder](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/rieder/32/4950_2.png) [@rieder](https://forum.servoy.com/u/rieder)\
**Post date:** [October 2, 2013, 3:34pm UTC](https://forum.servoy.com/t/foundset-report-and-image/17492/6 "2013-10-02T15:34:20Z")

</div>

For both:  
/Users/birgit/workspace\_reports/compiled/

Do I have to import a library?

Regards  
Birgit

---

<div class="post-metadata">

**Author:** ![Andrei\_Costache](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@Andrei\_Costache](https://forum.servoy.com/u/Andrei_Costache)\
**Post date:** [October 3, 2013, 6:12am UTC](https://forum.servoy.com/t/foundset-report-and-image/17492/7 "2013-10-03T06:12:22Z")

</div>

> rieder:  
> For both:  
> /Users/birgit/workspace\_reports/compiled/
> 
> Do I have to import a library?
> 
> Regards  
> Birgit

Birgit, please try also with a clean install of the [newest 3.x version of the plugin](https://www.servoyforge.net/attachments/download/1360/ChartNScript_Servoy_JasperReports_Plugin_v.3.3.2.zip).

Regards,  
Andrei

---

<div class="post-metadata">

**Author:** ![tgs](https://avatars.discourse-cdn.com/v4/letter/t/f19dbf/32.png) [@tgs](https://forum.servoy.com/u/tgs)\
**Post date:** [October 3, 2013, 8:47am UTC](https://forum.servoy.com/t/foundset-report-and-image/17492/8 "2013-10-03T08:47:29Z")

</div>

Hi Birgit,

I also had a cuple of problems with this. The solution that is working for me is:

In iReport i have two Parameters “SUBREPORT\_DIR” (java.lang.String) and “MEDIA\_DIR” (java.lang.String).  
On the Report I place the Image Element with the Expression “$P{SUBREPORT\_DIR} + $P{MEDIA\_DIR}”.

The report parameters for plugins.jasperPluginRMI.runReport() are set like:

SUBREPORT\_DIR = plugins.jasperPluginRMI.relativeReportsDirectory  
MEDIA\_DIR = Image\_Folder + “/” + image\_name

Hope this helps  
Thomas

---

<div class="post-metadata">

**Author:** ![rieder](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/rieder/32/4950_2.png) [@rieder](https://forum.servoy.com/u/rieder)\
**Post date:** [October 3, 2013, 9:42am UTC](https://forum.servoy.com/t/foundset-report-and-image/17492/9 "2013-10-03T09:42:07Z")

</div>

Thank you, Andrei  
I’ll try the newest plugin.

Thank you, Thomas, for the hint.  
I did try it and it did not work. I think, the problem is still the one for foundsets: The reference to the resource cannot be resolved on the client  
I think the image must somehow be compiled “into” the the report. Thats what the wiki pages tries to describe in the guidelines. But I must miss something.

Kind regards  
Birgit

---

<div class="post-metadata">

**Author:** ![tgs](https://avatars.discourse-cdn.com/v4/letter/t/f19dbf/32.png) [@tgs](https://forum.servoy.com/u/tgs)\
**Post date:** [October 3, 2013, 12:46pm UTC](https://forum.servoy.com/t/foundset-report-and-image/17492/10 "2013-10-03T12:46:14Z")

</div>

> rieder:  
> Thank you, Thomas, for the hint.  
> I did try it and it did not work. I think, the problem is still the one for foundsets: The reference to the resource cannot be resolved on the client  
> I think the image must somehow be compiled “into” the the report. Thats what the wiki pages tries to describe in the guidelines. But I must miss something.

The images folder is in the reports direction on the server. The parameter SUBREPORT\_DIR points to that and the MEDIA\_DIR expands direction string to the image you would like.  
Works for me with plugin version 3 & 4, iReport 4 & 5, Servoy 6, foundset & SQL.

Regards  
Thomas
