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

Error

Status
Not open for further replies.

Dukester0122

IS-IT--Management
Mar 18, 2003
587
US
I get this error when printing a compiled crytal report:

A number, currency amount, boolean, date, time, date-time, or string is expected here.
 
What is the formula that is generating the error? Without seeing the formula that the error is associated, it will be hard to help.

Mike
 
there is no formula. the report has been working for almost 2 years then suddenly we're getting the error. here's the full message:

Error Exporting File: A number, currency amount, boolean, date, time, date-time, or string is expected here. Error Number: -2147191859
 
I formula field within the report is driving the error then. Are you able to open the report within Crystal?

Mike
 
You have a formula that is using a UFL, and the workstation that you are running this on does not recognize the .dll that creates this function, therefore crystal does not see it as a function and returns this error.

Run this report from within crystal reports designer, not the .exe, from the same workstation, and you will see what formula is erroring out. Post that formula to this forum.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
here's the formula:

{IV40700.LOCNDSCR} +
(if {IV40700.ADDRESS1} <> "" then
chr(13) + {IV40700.ADDRESS1}
else
"")
+
( if {IV40700.ADDRESS2} <> "" then
chr(13) + {IV40700.ADDRESS2}
else
"")
+ ( if {IV40700.ADDRESS3} <> "" then
chr(13) + {IV40700.ADDRESS3}
else
"")

+ chr(13) + {IV40700.CITY} + ", "
+ {IV40700.STATE} + " "
+ {IV40700.ZIPCODE} + chr(13)
+ {@webaddress}

+
(if {IV40700.PHONE1} <> "00000000000000"
then chr(13) + "Phone: " + ToPhoneNumber (tonumber({IV40700.PHONE1}))
else "")
+ (if {IV40700.FAXNUMBR} <> "00000000000000"
then chr(13) + "Fax: " + ToPhoneNumber (tonumber({IV40700.FAXNUMBR}))
else "")

The error is coming from the ToPhoneNumber field
 
As dgillz points out the UDF, in this case the ToPhoneNumber functioon, is causing the problem.

How does the ToPhoneNumber alter the phone/fax numbers? It may be possible to use Crystal's built in functions to achieve the same results.

Mike
 
I can't seem to find a built-in function to replace it. Does aynone have an alternative?
 
I'm offering an alternative.

What is the original data: {IV40700.PHONE1} or {IV40700.FAXNUMBR}? (several examples if the number of digits are different.

What is the output once the ToPhoneNumber function is applied?



Mike
 
Both have char as Data type with length = 21.

Without the formula its showing the phone and fax as 123456789000

With the formula its showing as (123)456-7890
 
You could try:

picture(left({table.phone},10),"(xxx)xxx-xxxx")

This picks the first 10 digits. I wonder what the last two digits in the field reference though.

-LB
 
I get an error on the formula and say's its missing a ) and shows after ,10) but when I tried it tells me that the remaining text does not apprear to be part of the formula.
 
Do you have the comma (in red) afer the ,10)?

picture(left({table.phone},10), "(xxx)xxx-xxxx")

Mike
 
Had an extra ) after the table. Now its working fine. Thanks to all.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top