Many thanks Marcel!
Your approach indeed works, but I did not implement it exactly as suggested. Since other users might find this answer useful, I figured I should give a bit more information.
The reason why I modified the approach a bit is because the Filesystem component of ReportServer uses IDs instead of filenames as below:
http://localhost/reportserver/reportserver/fileServerAccess?&id=226
This is not very portable and is quite error prone. But since my ReportServer runs within a tomcat instance, I simply added a directory called “ReportResources” and under that a directory “images” and a directory “styles”. That way I could have URLs of the form:
http://localhost/reportserver/ReportResources/images/image1.jpg
Then, in my report I define a parameter “ResourceRoot” and use the expression
$P{ResourceRoot} + "/images/image1.jpg"
to refer to the location of the image. In my ReportServer I define the parameter “ResourceRoot” to be hidden and non-editable, and give it a default value of “http://localhost/reportserver/ReportResources”. That makes sure all of this works in my ReportServer environment.
In my case, I don’t want to have ReportServer (and tomcat) running at all times (laptop with limited memory) but I still want my development environment to work. In my development environment, I recreate the structure of the ReportResources directory in the workspace where I have the report (a folder called “ReportResources” at the same level as the report jrxml containing “images” and “styles” directories). Then I set the default value of the “ResourceRoot” parameter in the report itself to be something like:
file:///path/to/workspace/ReportResources
This way the preview of the development environment uses the local files.
One note: when trying to set the URL of a Style Template Reference, the dialog window that comes up does not seem to like complex expressions such as the one shown above. However, if you create a reference pointing just anywhere, then edit the expression within the properties tab of the reference, it all works fine.
Hope that helps,
George
PS: Thanks again Marcel.