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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can Crystal report a missing OLE object? 1

Status
Not open for further replies.

Madawc

Programmer
Sep 5, 2002
7,628
GB
I'm writing a report that will select one of several OLE images from a specified folder, using a file name entered using a parameter. That much works fine.

If I enter a file name that does not exist, I get the image of a little black square, but no other indication that there is a problem. This means that a live report that was given a bad or out-of-date parameter would waste time printing unusable letters on pre-printed stationary. Is there a way to pick up and report the error instead?

Note that I plan to have the signature as a subreport within each letter, but mostly using just the one signature, so if it fails once it would be best to stop the entre report. Or I might do it just once and pass back the file path. In either case, it would be good to know about a non-existent file.

Is there a method? Please let me know.


[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
You must be using the parameter in a formula--please show the content and explain in what report screen you are using it.

-LB
 
I'm using either
Code:
// Tell the letter where to pick up the graphic
"H:\_Crystal\INC026837 Signatures\Signature_Store\Test10.bmp"

Or else
Code:
// Assemble path from parameters
{?MainPath} & {?Item Number} & {?PictureType}

If the specified graphic does not exist, it displays a black square. It gives no indication that the formula has failed.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
crystalkiwibruce, is there a way to check FileExists within a standard Crystal report?

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
Have you thought of using a subreport to test then path first.

I do not have Crystal open but you can set a datasource as your drive H or possible a folder H:\_Crystal\INC026837 Signatures\Signature_Store\. If file cannot be found there then you can use a Boolean shared var to suppress report or specif document.

Ian
 
This is intended for routine running out of hours. People are supposed to check that letters look OK before physically sending them out. But if there were a simple way to identify an error, that would be useful.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
Thanks

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top