Relative path for an image in a report

Stimulsoft Reports.WPF discussion
Post Reply
Patrick8639
Posts: 12
Joined: Wed Mar 17, 2010 10:50 am
Location: Lausanne, Switzerland

Relative path for an image in a report

Post by Patrick8639 »

Hello,
when adding an image in a report with StimulReport WPF, the absolute path of the image is saved in the report. This generates problems when the designed of the report is not made in the same machine as its use (i.e. when used in a Web server).
What would be nice is the possibility to have relative path for images, where the root path is the path of the .mrt file.
Actually, I can change the path of the image, when editing manually the .mrt file. Unfortunately, the root path is not set to the path of the .mrt file, so it doesn't work correctly.
Patrick
Andrew
Posts: 4107
Joined: Fri Jun 09, 2006 3:58 am

Relative path for an image in a report

Post by Andrew »

Hello,

It is not correct to save relative paths. You may, when adding an image, immediately edit the image path. And in the .mrt file that very path will be saved.

Thank you.
Patrick8639
Posts: 12
Joined: Wed Mar 17, 2010 10:50 am
Location: Lausanne, Switzerland

Relative path for an image in a report

Post by Patrick8639 »

Andrew,
as I say in my previous message, it doesn't work, because we have no control about the root path used when compiling the report.
Patrick
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Relative path for an image in a report

Post by Jan »

Hello Patrick,

May be we don't exactly understand you. Can you say which proeprties you use when specify image?

Thank you.
Patrick8639
Posts: 12
Joined: Wed Mar 17, 2010 10:50 am
Location: Lausanne, Switzerland

Relative path for an image in a report

Post by Patrick8639 »

Jan,
I have an Image where I would like to set the File property to something like "..\Images\MyLogo.wmf", so I can keep all the logo in the same directory, but will have no problem when the report is moved in another folder.
Patrick
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Relative path for an image in a report

Post by Jan »

Hello Patrick,

We have added new static property - StiOptions.Engine.Image.AbsolutePathOfImages. In this property you can specify absolute path which will be used in combination with path from File property of image component.

Thank you.
Post Reply