Results 1 to 3 of 3

Thread: Help me with this formula.

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Malaysia
    Posts
    345

    Help me with this formula.

    Hi!

    I have to make a formula in Crystal Reports.Net, where I need to cut a field till a particular word and put the rest of the words left in a new line. e.g.

    If my field contains "There was a boy who requsted a toy"

    I have to show this as the following in my report.

    There was a boy who
    requested a toy

    I am using the follwing formula

    numberVar iCountLeft;
    numberVar iCountRight;


    iCountLeft=InStr ({RemedyDaily.customer_notes},"Requested")
    iCountRight=InStrRev ({RemedyDaily.customer_notes},"Requested" ,0 )

    Left ({RemedyDaily.customer_notes},iCountLeft ) & Chr (13) & Right ({RemedyDaily.customer_notes},iCountRight )

    But, it gives me error "the remaining text does not apear to bepart of the formula".

    Pls help how to achieve this. I am relatively new to Crustal Reports.
    Thanks.

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Help me with this formula.

    When setting variables you need to use := not just the equal sign.
    Also, the statements which set variables need to end with a semi-colon.

    iCountLeft:=InStr ({RemedyDaily.customer_notes},"Requested");
    iCountRight:=InStrRev ({RemedyDaily.customer_notes},"Requested" ,0 );

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Malaysia
    Posts
    345

    Re: Help me with this formula.

    Thanks.

    Pls help me with this.

    My string is like this:-

    The boy who was blah blah blah 01/02/2003 11:12:32 AM was in blah blah 09/08/2005 12:11:15 AM blah blah

    The output I desire on the report is like the following. It must be noted that string could be blank (so need to check that also)

    The boy who was blah blah blah
    01/02/2003 11:12:32 AM was in blah blah
    09/08/2005 12:11:15 AM blah blah

    Pls help me achieve this. I am relatively new to Crystal Reports.

    Thanks.
    Thanks.

Posting Permissions

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



Click Here to Expand Forum to Full Width