cancel
Showing results for 
Search instead for 
Did you mean: 

Joining Strings

Former Member
0 Kudos

I have a dlima that I am hoping someone can help me with. I am trying to join a set of strings that appear as separate sequences for a given record. These are collection notes entered by the user and are broken into multiple 'sequences' for each instance. I suppose this is done because of field length, but I want to join them so that it reads cohesively per instance. This is an example of the text fields per call date:

Call Date Sequence Text

11/17/2011 1 Called Lisa and got voice mail indicating

2 that the voice is full and can no longer leave

3 messages. I have sent an email to her to contact

4 me. HDP

As you can see, if I report on this text field, it will take up valuable space within the body of the report and does not read cohesively. I am not as savy with CR as I would like to be, but I know there must be a way to join these text fields into one long text field per call date.

Any help you can provide is greatly apprecaited.

Marlene

Crystal Reports 2008

Version 12.3.0.601

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Marlene,

A formula like:

Field_1 & Field2 & etc ?

Are the sequences listed numerically ?

Is the number the first character(s) in the string ?

Are there unlimited numbers of sequences

where you might need a "For" statement ?

Thanks,

Jimmy

JWiseman
Active Contributor
0 Kudos

Marlene, you can create a manual running total to do this...in this case the type of running total is string.

step 1: create a declaration / reset total to put in the Group Header

whileprintingrecords;

stringvar srt:= '';

step 2: create the running total formula for the Details section

whileprintingrecords;

stringvar srt:= srt + + ' '

step 3: create a display for your Group Footer

whileprintingrecords;

stringvar srt

cheers,

jamie

Former Member
0 Kudos

The 'sequence' is a separate field. There are x number of sequences for any given instance (contact date).

These records are first grouped by 'Invoice Number' then by 'contact date' and then there can be any number of 'sequence's and associated text fields for each call date.

Thanks for your help..Marlene

Former Member
0 Kudos

Hi Marlene,

Thanks.

So how can you tell the correct order of sequences ?

Is there a "Position" order, is it by a Date/Time field, etc ?

Thanks,

Jimmy

Former Member
0 Kudos

Hi again,

In fact, if the sequenced fields come in Date or numeric

order, you can group on that ( that will automatically bring them

in in order) and then use the formula that Jamie has posted above,

and that should do it.

Even if the number is in the sting itself, you can use "instring"

to get it out and group on that.

Hope this helps,

Jimmy

Former Member
0 Kudos

THANK YOU~! I knew it seemed like a 'running total' would solve the problem, but I just couldn't piece it together. Thank you very much for your help!

Marlene

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

You will have to write a formula to eliminate new line character, try the following :

REplace(, chr(13),' ')

Place the above formula in our report.

Thanks,

Sastry