Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Feb 2010
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to suppress part of a string in Crystal Reports XI

    Hello,
    I have a report using Crystal Reports XI and I need to be able to supress part of a description.

    We are using a tilda (~) to separate what we want to see from what we want suppressed.

    So we have a description which says "Please do not leave in the driveway ~ stock valuable"

    We want the document to only show "Please do not leave in the driveway".

    Can anyone help with a suppression formula?

    Many thanks
    Joanne

  • #2
    Regular Coder
    Join Date
    Apr 2009
    Posts
    244
    Thanks
    1
    Thanked 20 Times in 20 Posts
    Hey Joanne,

    The formula can be defined something like this:

    Code:
    Left("my~string", InStr("my~string", "~")-1)
    In this case, the output would by "my"

    Mike

  • #3
    New to the CF scene
    Join Date
    Feb 2010
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks so much for your help.

    Would I need to define the my you used? Can I use a wildcard as the part before the ~ will vary.

    Thanks again
    Joanne

  • #4
    Regular Coder
    Join Date
    Apr 2009
    Posts
    244
    Thanks
    1
    Thanked 20 Times in 20 Posts
    Well, when you edit the formula (inside the formula workshop), just replace the string I used with the actual report field. You can just drag and drop it in there. I only used "my~string" as an example.

    Mike


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •