Results 1 to 2 of 2

Thread: Report Designer (.rdl) if statement add line return

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    126

    Report Designer (.rdl) if statement add line return

    Hi Everyone, I hope this is the right place to post this. A co-worker who is working with a new software we have is customizing a report inside Visual Studio with a file extension (.rdl). She has a line in her report she would like to split into two lines. I am from the VB.net world and kind of understand what shes trying to do, but cant figure out how to do it.

    Basically she is getting a value from our SQL database and needs to check the value if it contains a ",". If it has a "," then take the remaining part of the string and place it on the row below.

    Example: The sql value is "1245 White Lane, Sonoma, CA 95402" I would like to place in the report a string like this below.

    1245 White Lane
    Sonoma, CA 95402

    Is this possible to split a string and force a line return?

    Thanks for any help and appologize in advance for this simple question just not sure where to turn to besides everyone here.

    Mark

  2. #2
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: Report Designer (.rdl) if statement add line return

    Add a new formula field
    Name it as you like
    Place in the reports instead of the field
    Format it checking on the 'Can Grow' property
    Code:
    WhilePrintingRecords;
    numberVar ThePos := InStr ({Table1.Field1},",");
    stringVar TwoLines := Left({Table1.Field1},ThePos-1) & Chr(10) & Mid({Table1.Field1},ThePos +1);
    Trim(TwoLines);
    Only change Table1.Field1 for the real ones

    EDIT:
    Apologies... didn't read rdl report... the answer is for Crystal reports but the main idea could be apply
    Last edited by jggtz; Apr 23rd, 2012 at 06:11 PM.
    JG


    ... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...

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