|
|||||||||
|
|
![]() |
|
|
|
![]() |
![]() |
|
Crystal Reports Tools: Improve Performance While Saving Time and Money |
|
Crystal Reports: How to Display Images in a Crystal Report
By Bruce Ferguson, Chelsea Technologies See also: Dynamic Image in Reports (especially if you use XI or later) We usually have text and numeric data displayed in our Crystal Reports. Sometimes our database has image data and we might like to include this in our report as well. There are several approaches to displaying a data driven image in your report. The first is to ensure
the image is of a sufficient size and quality.
There is no point in trying to display a large high quality image as
a thumbnail on your report. Use one
of the image editing programs to create an image you can display at an
adequate resolution and size. The format of the image is also important. While a BMP is a fairly universal format, it can require a large space. So it might be desirable to convert the image to a compressed format like JPG. Crystal Reports supports several formats.
1.
Database solution:
Easy,
but requires significant disk space You can store image data in fields in your database. MS access calls these OLE fields, while Oracle and SQL Server refer to them as BLOB (Binary Large Object) fields. An example of this
technique is the Xtreme sample database supplied with Crystal Reports.
In the Employee table is a field containing the photo of each
employee. You just place these fields
on your report in a similar way to other fields. On the positive side,
you can directly relate an image field to database values.
On the negative side, these images can take up considerable space
inside your database. This means they
can also have an adverse effect on performance and storage. In some Crystal Reports
books, we have read about how you can write a Crystal Report viewer in a
language such as Visual Basic. Inside your program you can trap such events
as the formatting of a section, and you could then change the OLE objects in
your report to load a different image. On the positive side,
this lets you loosely couple your data and images.
On the negative side, it requires a complex application to be
developed and it will work with only specific reports. We were considering
developing such a viewer until we came upon the following two techniques.
We also heard recently that the format event is not available to CR9
developers. Driver
Solution: Fast and flexible 3rd party product. One of the great features in Crystal Reports 8 and 9 is that you can use a COM data source. This means you can create a recordset from within some application code and then use it as the source of data for your report. And even better is you don't have to write, test, and rewrite your own. We have done all the work for you! Now you can dress up your reports the easy way, with cViewIMAGE. To find out more, click here: http://www.mindconnection.com/Merchant2/merchant.mvc? We have developed cViewIMAGE, a com data source that takes three fields from any ODBC table (an identifier, a description and a filename of the image file). The COM data source creates a fourth field, which is the image that the file name contains. Use this in a subreport to display that filename as an image in your report. The big benefit is that the entire recordset gets loaded into memory, so it is very fast to load and process some images, and it is totally flexible about what images and database fields you use. It just requires an ODBC data source. On the negative side,
some initial setup is required to identify the location of the image, but we
have made our driver flexible so you can support multiple configurations.
cViewIMAGE is a COM data driver that can reference an image file in a field and return the embedded image to use in your report. This is a very handy utility--we all know a picture is worth a thousand words--why not add that power to your Crystal Reports? cViewIMAGE: Pricing | Buy Now |
|
Delivery
Solution: Simple and inexpensive to install a UFL Another solution is to
Export to HTML, using our SMTP
UserFunction Library.
We have other User Function Libraries that send output to Outlook,
XML or a disk file. Some call this
“Report Bursting,” where your report engine uses a function library to
generate multiple output files. We now have an SMTP library that can embed images in an HTML message as the report is processing. This is a standard function in our SMTP library. |
These keywords may have brought you here: images in crystal reports, com drivers, dynamic images, include images, crystal reports tutorials, how to add an image to a crystal report, image inclusion, crystal reports articles, crystal reports information, images inclusions for crystal reports, training on crystal reports software, crystal reports training, crystal reports downloads, crystal software, crystal downloads
|