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

How do I check to see if a file exists?

Status
Not open for further replies.

mercenguk

Programmer
Joined
Dec 1, 2006
Messages
8
Location
GB
Hi All,

Crystal XI Developer
Windows XP Pro

I need to colour the backgraound of a Crystal Reports text object depending on whether a file exists in a particular folder on the server.

I know how to conditionally change the background colour but is there any way to check whether the file exists from within Crystal Reports?

Many Thanks,

MercEng
 
Do you mean, the record exists in File A, and may also have an entry in File B?

First, you need to have a 'left outer' link from A to B, otherwise you'll only get records that have both.

To identify, test a field in File B for being null - something like an account number, that will never be null if there is a real record. If isnull({fileB.accno}) then... . Use this as your condition.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
You may want to consider a 3rd-party User Function Library (UFL). See list at:
My "CUT Light" UFL provides a FileExists() function that you can use within your Crystal reports.

- Ido

view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top