Can't set report image path at runtime in a crystal report
Posted on 2008-10-27
I am having problems with dynamically setting image locations (paths) in Crystal Reports. Just to give you a rundown on the environment I'm using:
I'm designing the reports in Crystal Reports XI Release 2.
- Images loading works fine in the designer.. I can pass it path values from the database or simply give it a path to an image in a string and it works fine, no problem at all. The image is correctly loaded from the specified path.
The problem is at run time.. I'm developing in Microsoft Visual Studio 2008 (version 9.0.21022.8 RMT), which references version 10.5.3700 of the CyrstalReports.Engine to interpret crystal report files.
I have tried using VB.NET code to change a formula field dynamically. I've tried passing in a string parameter with the full or relative path to the image.. and I've also tried loading the image path from a schema in an OLE DB(ADO) style database connection.
None of these have worked, it just loads the default image that I embedded into the report during design time.
To check that the path is being passed correctly each time I loaded it into a text object.
Has anyone got any ideas?