Images in Crystal Reports 8
I am using Crystal Reports 8 for reports and wish to stay with that version, as upgrading would effect many clients and have a significant overhead. What I am trying to do is have an image in a report file, and have the file name and path of the image be stored in a table. This way i can make the image dynamically change based on what part of the report I am in. If anyone knows a way to do this, please let me know. Thank you.
Yes we can insert Images into a Database for use with Crystal Reports.
The SQL Server Image data type is capable of containing image data. Image data is inserted into Image fields through the use of a Microsoft utility called BCP. BCP is a command line application that is installed as part of the SQL Server client installation.
In SQL Server, complete the following steps to create a table with an Image field and to insert image data into this field.
1. Create a table and define a field as Image data type.
Syntax of command line:
CREATE TABLE yourtablename (yourfieldname image)
2. Using the BCP utility, enter the command line syntax as shown below. To insert image data, the syntax has been streamlined.
C:\> BCP <database>.<owner>.<table_name> in <path>\<filename> -S<server_name> -U<username> -P<password>
<database> is the SQL Server database referenced,
<owner> is the owner of the table,
<table_name> is the name of the table,
<path> is the fully qualified folder that the image file resides in,
<filename> is the name of the image file, with extension,
<server_name> is the name of the SQL server,
<username> is the name of a valid user with INSERT rights on the table,
<password> is the useru2019s password.
C:\> BCP Techtest.vantech.ImageTable in C:\Images\Xtreme.jpg u2013Sdbconn1 u2013Uvantech u2013Pvantech
When running the BCP utility, you will be prompted for several parameter values.
1. Hit ENTER for the file storage type prompt.
2. Enter 0 for the prefix-length prompt.
3. Enter the length (size) of image file in bytes for the length of field prompt.
4. Hit ENTER for field terminator prompt.
5. Enter n for save format information prompt.
Crystal Reports 8 and later can now report off image data that has been inserted into the SQL Server Image field
Which is the database that you are using?