×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Formulas switching from number to string when copied?

Formulas switching from number to string when copied?

Formulas switching from number to string when copied?

(OP)
I'm using CR 8.

I have several formulas that I'm copying from one report to another.  All of these formulas are numeric.  They represent month-to-date and year-to-date numbers at various levels of detail.

I copy and paste them one at a time.  After doing so, I want to select them all and apply numeric formatting to them at the same time.  The trouble is, some of them become strings instead of numbers at some point in the process of copying them.  The formulas themselves haven't changed, i.e. they still return numbers.  However, when I hover my mouse over them, I get the formula name plus "(string)" in the help message.

If I delete the string formulas and re-copy them, they are numeric, but now some of the formulas that were numeric to begin with have become strings.

Has anyone seen this strange behaviour or am I hallucinating?

RE: Formulas switching from number to string when copied?

This is odd.

Are you copying and pasting the entire objects from one report to another, or copying the contents of the formula to the formula editor?

If you open one of these 'string' formulas, add an extra space between any two arguments (ie a change that doesn't change anything), check the formula, and resave it, does the data type become correct?

Ken Hamady
http://www.kenhamady.com/
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)

RE: Formulas switching from number to string when copied?

(OP)
Oops!

I was copying the entire object, not just the formula text, because I was also intersted in copying the associated tool tip formula, and some conditional formatting as well.

The problem turned out to be this:  The destination report did not have a parameter defined that is used by virtually every formula in this set of reports I'm working on.  So the objects copied fine, but when I tried your suggestion of changing a formula by adding a space, that's when I found that the formula did not pass the error checking.

The interesting thing, and what was throwing me off, was the way each object would appear as a number and then when I tried to format it, it changed to a string.  I tried this with groups of objects and with single objects.

Hope this makes some sense.

Anyway, your suggestion helped me solve my problem.  Thanks

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close