Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse data from memo field that contains lines with chr(10)

Status
Not open for further replies.

CrystalReports74

Technical User
Dec 20, 2011
3
US
Good Day,

I am using Crystal Reports XI. I am connecting to a DB2 database.

I have a memo field called assignment_groups.

The field could contain data like this:

Operator Name Assignment Groups
============================================================
jdoe NETWORK GROUP
SECURITY GROUP
============================================================
bobjay NETWORK GROUP
============================================================
rayjay SERVER GROUP
SECURITY GROUP
NETWORK GROUP
============================================================
eeyjay
============================================================
testerguy SECURITY GROUP
NETWORK GROUP
============================================================
helpdesk guy

SECURITY GROUP
============================================================

What I would like to see is this:

Operator Name Assignment Groups
============================================================
jdoe NETWORK GROUP, SECURITY GROUP
bobjay NETWORK GROUP
rayjay SERVER GROUP,SECURITY GROUP, NETWORK GROUP
eeyjay
testerguy SECURITY GROUP, NETWORK GROUP
helpdesk guy SECURITY GROUP

I don't know how to get the data from the memo field formatted so the assignment groups are on the same line separated by a comma.

Note: if instr({operatorm1.ASSIGNMENT_GROUPS},chr(10)) > 0 then 1 (this equals 1)


Any help is greatly appreciated!

Crystal Reports 74
 
create a formula :
replace(<your field name>,chr(13)+chr(10),",")
and use it instead of <your field name>

Viewer, scheduler and manager for Crystal reports.
Send your report everywhere.
 
Hi Rtag,

Thanks for looking at my post.

When I use that formula, the information looks the same.

If the field itself looks like:

NETWORK GROUP
SECURITY GROUP

The fomula field looks like"
NETWORK GROUP
SECURITY GROUP.

It doesn't look any different. :(
 
Did you place the formula in your report ?
Formula :replace(<your field name>,chr(13)+chr(10),",")
will replace the combination "chr(13)+chr(10)" with ",". If it is not doing it then your end of the line may be different. Try also
replace(<your field name>,chr(10),",")
and
replace(<your field name>,chr(13),",")

Viewer, scheduler and manager for Crystal reports.
Send your report everywhere.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top