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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to sort email by subject in Crystal Report 9?

Status
Not open for further replies.

Lilyli

Programmer
Jul 27, 2004
41
US
Hello everybody,

We have some product emails are stored in the database. Our user want to find some emails by the subject name. I want to make the subject, such as "abc", "Re: abc" and "Fw: abc" into one group, say group 2. Group 2s are under project number (Group 1 name). Dose anyone know to do it?

Thanks in advance,

 
You could use a formula that takes the 'Subject' field and removes certain prefixes by nesting the Replace function, then create your group on the formula:

//@SubjectGroup
Replace(Replace({Table.SubjectField}, "Re : ",""), "Fw : ", "");

-dave
 
Thanks Dave, your answer resolved one of my problems. Now the other problems are:
1. using @SubjectGroup as group 2 name, the related subjects, such as xxx, RE:xxx and FW:xxx did not get togather. They stay in their own group separately, although they have the same subjectgroup name. (I mean duplicated names in group 2, because of removing "re:" and "fw:")

2. The names of group 2 (subjects) are not sorted according to the @SubjectGroup name. They are as the same as before, just remove "RE:" and "FW:" from their subjects.

Do you have any idea?

Thanks once again.
 
Yes, instead of using the formula as the Group Name, use it as the actual Group field. That will resolve both issues.

That was my original intent, sorry if I wasn't clear.

-dave
 
I am sorry that I could not follow you. I am a newer for crystal report. Could you please show me in detail? What should the group name (group by what?) be and what dose it mean "actual group field"?

Thank you very much.
 
Since I don't know your version of CR, these are the steps to change a group in CR 8.5.

Report menu > Change Group Expert > highlight whatever Group 2 is currently > click 'Options' > change the "When the report is printed... Grouped By" dropdown to the @SubjectGroup formula. That should do it.

-dave
 
I am using CR 9.0. That is what I did in my first reply (there are two problems).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top