Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert graphic as Parameter?

Status
Not open for further replies.

CraigBest

Programmer
Aug 1, 2001
545
US
Hope someone can help...

In a few days I need to alter an existing single-page report to include a graphic, the signature of the person the report page is referencing. The graphic file will have to be passed as a parameter to the report. Can anyone tell me how I need to set up the parameter to handle this type of data properly?

Also, what graphic format is most compatible with Crystal? tif? jpg? gif? What will look best?

Thanks

Craig in NJ
 
OK, I did a little more research. There appears to be NO facility for displaying a graphic file in Crystal except for selecting an existing physical graphic file with the display picture tool. Is this right?

If it's true, what happens if I copy a new file with the same name over the old one in production? Will the new photo or graphic replace the one the report originally used, or is it stored in the report file?

If it doesn't save with the report, I can just save the graphic I want to the same generic filename before printing the report, and have the image I want show up in the report. Not the way I wanted to do it, but if it's all I can get I'll take it.

Hoping someone else has a better idea...

Craig in NJ
 
You can place several graphic object on top of each other, then use a paramter field to conditionally suppress all but the one you want to see. I hope this helps. Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
thanks dgillz...

A better solution than having separate report files for each employee, but maybe a bigger problem when it comes to maintenance (people leave or worse, new people get hired). I'd be going into the file deleting and adding images a few times a month, and I'd rather find a way to make the maintenance less painful.

Surely there must me some way to pass a graphic into the report as a table cell, or a field from an ADO Data Source? It seems incredible to me this would be the only way to include a graphic file!
 
See thread149-214487 and thread766-91750 for a couple of discussions of how to do this with VB and the Crystal report designer component. I have never been able to actually make this work, however I am not a strong VB programmer. Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
If the image is stored as a BLOB field in a table, you can pull it in dynamically. Otherwise, you will have to resort to adding a linked image with a generic name, and then replacing that image file with the appropriate one at runtime. I have had the best luck with BMP files when using the second option. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Hi Ken, thanks.

Yes, this would be an acceptable method. But from the product documentation it looks to me like the contents of the picturebox is saved with the report? If so, you couldn't update the generic image before runtime and have it reflect that change... Or am I wrong about this? If I overwrite the source image file with a different image but the same name before runtime, will it reflect the new image when the report is invoked?

Thanks

Craig in NJ
 
If you do it correctly - at least I have done this with BMPs.

Make sure you insert an OLE object with the appropriate path, and check off "Create from File" and "Link". One challenge isthat the path at insertion (on the dev PC) has to be the same as the path on the target PC. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top