Crystal Reports Tools: Improve Performance While Saving Time and Money

  Resources  
Best sellers:
cView
Report Analyzer
cViewSERVER
ReCrystallize
 

Buy Crystal Reports


Articles:
Administration
Advanced
Basic
Crystal eNL
Database
Financial
Problems Solved

Books:
CR Books

Database Books
Developer Books

 
Tools:
All CR Tools
CR Analyzers
CR Bestsellers
DataBase Tools
CR Graphics
International
CR Mail UFLs
ReCrystallizePro
CR Schedulers
CR UFLs
CR Viewers


Add'l:

About us

Contact Us
cViewSUITE Ppt
Support

CR trial
 

Crystal Reports
on Steroids

Crystal Reports: Dynamic Images in a Crystal Report

  • Contains important information for users of XI or later

  • Contains security information

By Bruce Ferguson, Chelsea Technologies
(we like to refer to Bruce as the "King of Crystal Reports")

One of the great new features in Crystal Report XI is dynamic images. You can insert an image into your report and then set the picture properties to select a different image at run time. This works well and it can locate an image on your local or network drive and can even retrieve an image from a web server and folder.

The first thing to check is to make sure your new image actually exists. If the image can’t be found, the original image will remain. This can cause confusion if you expect each appearance of the image to be different. There are several solutions to this problem.

  1. Use a default "Not Found" or blank image as the original image file. We have a sample file for this available from http://www.chelseatech.net/images/imagenotfound.jpg
  2. Use our Disk File User Function Library to check the file exists and to suppress the image or the section it is in, if the file isn’t there.
  3. Use our cViewIMAGE utility to retrieve the image in a subreport. This displays a Null or empty image if it isn’t found and works with Crystal Reports 8.5 or later. (cViewIMAGE is also an option for you if you haven’t upgraded to Crystal Reports XI and want to pick up your images from a file directory instead of a database)

Another thing to watch out for if you want dynamic images in your reports is to make sure all the images are the same height and width. If they are not, they will be stretched or squashed to fit the original image dimensions.

If your images vary in size, use the cViewIMAGE.ImageSize driver which will include the image height and width as fields in the record. You can then use this to select a different image aspect for more accurate presentation in your report.

More, below...

 

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

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  

 

 

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.

 

Security Issues

At a client site, images in a report raised a set of security-related questions. The report we were asked to modify required a signature to be displayed on the page. The customer wanted the signature of the user running the report. Users were spread over several sites with multiple users at each site. With a shared PC, we couldn’t use the system user id to restrict access to the images.

There were other complications to be resolved. Security considerations about individual signatures meant that we had to lock the image to individual users. Report delivery was via our cView report viewer. The solutions we discuss below could equally apply to Crystal Reports Server, Business Objects Enterprise or any other 3rd party report delivery. The key issue is that the users did not have access to the Crystal Reports Designer, and were using a delivery method that gave them the report to view.

Authentication Issues

Who is running the report? It was vital to have a secure way to do this. Because several users shared access and user id, it was impossible to use that approach. In the end, all the solutions required the users to enter a Personal Authentication Number (PIN) to uniquely identify them.

Individual Solution

Why not create a report for each user? Store the image in the report for that user, and give them their own copy of the report, saved on a local drive. This would work well for sites with a couple of users. But the report was complex, we found there were several others that also needed the secure dynamic image, and there were enough users to make this impractical.

Multiple Images in one report

So we could take one report, save all the signatures into a section each, and use the PIN number to select which section to display. This would be manageable, but the multiple images created a single security point of failure. If someone could break in, all the signatures would be available to them.

Database Approach

We did consider storing the images in a database table. Everywhere we looked with this opened up major security issues. Any other database retrieval tool such as MS-Access or even Excel could extract the data and images from the table. By putting the images in a table, the security moved outside the Crystal Reports framework.

Developer Solutions

Several developer solutions presented themselves. A custom viewer, encrypted RPT files, or encryption support inside our cViewIMAGE driver all seemed too difficult and expensive.

File System Approach

Dynamic Images are supported in Crystal Reports XI, and our cViewIMAGE COM driver (if you are running and older version of Crystal Reports. Both of these let you change the image location at run time. The solution we selected was to store site specific images in a local secure folder. The PIN would then calculate the folder and file name to extract.

 

Where to store?

Crystal Reports XI includes the ability to have a dynamic image location. This is useful because it means you do not need to store your images in your database in order to display them in your report.

(If you are on an older Crystal version, you can still have that functionality by using our cViewIMAGE utility to display a dynamic image on the page. It is available for Crystal Reports 8.5 or later).

You place an image on the report and then use a formula to replace that image with another. So it is important to decide what data you store in your database to identify the image location.

One approach is to give the field a fully qualified drive and path name to the image. If you do this you need to make sure that everyone who views the report has the same drive, path and image file available to them.

A network or web folder might help here, but you need to make sure the images are always available to the report.

  • Or you could use a formula and a field value to calculate the image. Perhaps take the product code and append a path and file extension to identify the image.

  • You could also have a parameter in the report to point to the image folder so you could move it at some point in the future.

When you design a report with dynamic images, make sure folder names and permissions are not limiting your viewing options.