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

crystal report if, then, and prompt formual 1

Status
Not open for further replies.

roufghrider

Technical User
Aug 21, 2013
3
GB
We have a crystal report that needs amending; when the report is produced it has an address field. What i would like to do is able to say if the address field contains any of the following characters (@ or ? or < or >) then say no address and prompt for the user to insert the address manually.

Is this possible and if so how, I’m new to crystal have put together the following from google.


if ({rsp_SL683_bill_address;1.DEBTOR_ADDRESS} like ["*@*", "*?*", "*<*"]) then "No Address"
if {rsp_SL683_bill_address;1.DEBTOR_ADDRESS} = "No Address" then "prompt for user to input address manually"

many thanks
R
 
One of the 3rd-party Crystal Reports UFLs listed at adds to Crystal an InputBox() function that allows you to do that. The advantage of that approach is that:
a) parameters always get triggered while InputBox() can be conditionally triggered, and
b) a parameter returns a fixed value throughout the report, while InputBox() can be triggered multiple times (for example, once for each record or group with a missing address).

hth,
- Ido

view, export, burst, email, and schedule Crystal Reports.
 
thanks ido, as helpful as the site is unfortunately to technical for. i was hoping for a dummies guide to fixing the problem im having.
 
Is there only one address for this report, or are there many records with addresses?

If there is only one you could try something like:
//@Address
if ({rsp_SL683_bill_address;1.DEBTOR_ADDRESS} like ["*@*", "*?*", "*<*"])
then {?Address Parameter}
else {rsp_SL683_bill_address;1.DEBTOR_ADDRESS}
 
Charliy that's exactly what i need or was looking thanks, im slightly confused about setting up the {?Address Parameter}.
what do i need to set up in the parameter setting to be able to get the prompt for users input, appreciate your help.
 
You'd just create a standard string parameter. You can't put carriage returns in the parameter so if it's multiple lines you'd need to do soemthing like putting slashes where the line breaks need to be and writing a formula to break it up, probaly using Split.

I'm on my way out the door, so hopefully someon in another time zone can pick this up and help you further.
 
I think you will find that the solution offered by Charliy will always prompt for the address parameter, whereas my understanding is that you wanted the prompt to be conditional on a test of the existing address field.

Unfortunately I think your only option will be to use a 3rd party solution.

While I have not used this particular product, I have used several other products by Millet Software and have found them very reasonably priced and useful. I therefore suggest you take a look at the user manual for the "Cut Light" tool [link] [/url]. Page 23 looks to describe the functionality you are seeking.

Cheers
Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top