Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Report Help!! :) Post Reply Post New Topic
Author Message
chloesnowling
Newbie
Newbie
Avatar

Joined: 29 Jan 2009
Location: United Kingdom
Online Status: Offline
Posts: 7
Quote chloesnowling Replybullet Topic: Report Help!! :)
     Posted: 29 Jan 2009 at 9:24am
Hi Guys,
 
I'm pretty new to learning Crystal Reports but just wondered if someone out there would be able to help me.
 

I have a table which contains all order numbers (sord).

This is linked to another table which records the date a letter was sent to the customer (if sent) and what type of letter was sent. (letter)

 

Sord                                       Letter

order_number                        order_number

           date_letter_sent

                                               letter_type

 

The linked field is order_number.

 

 The report currently looks like this:

 

(Figure a)

order_number

date_letter_sent

letter_type

100

 

 

101

01/01/2009

A

102

 

 

103

01/01/2009

B

104

01/01/2009

A

105

01/01/2009

B

106

 

 

107

05/01/2009

D

108

01/01/2009

F

109

03/01/2009

A

110

 

 

 

I want it to show all order numbers but only show letter types of A.

Like this:

 

(Figure b)

order_number

date_letter_sent

letter_type

100

 

 

101

01/01/2009

A

102

 

 

103

 

 

104

01/01/2009

A

105

 

 

106

 

 

107

 

 

108

 

 

109

03/01/2009

A

110

 

 

 

I tried a record selection to say where letter_type = A

But this gave me the following results:

 

(Figure c)

order_number

date_letter_sent

letter_type

101

01/01/2009

A

104

01/01/2009

A

109

03/01/2009

A

 

What formula can I use to get to figure b?

 

It works if I use a sub report but I don’t want to do this because I need to be able to group and sort by letter date.

 

Hope you can help!

 

Thank you very much.

 
Thanks, Chloe.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Jan 2009 at 9:52am
Use a formula to replace your letter_type value and use that instead:
if (letter_type)='A' then 'A' else ''
IP IP Logged
ricky969
Groupie
Groupie
Avatar

Joined: 03 Jul 2008
Location: United States
Online Status: Offline
Posts: 53
Quote ricky969 Replybullet Posted: 29 Jan 2009 at 10:19am
I'd use the "suppress" feature. right-click on both date_letter_sent  and letter_type, chose the tab "Common", do NOT check "suppress", click on the X+2 formula editor and type: letter_type <> 'A'
You will use the same formula for both fields. You do not need and if in front of the formula.
What this formula is doing is suppressing both date and letter if the letter is not equal to 'A'.
that's what I would do.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Jan 2009 at 10:51am
Oops, did not see the date portion. Suppresion would work better in that case or you can replace the date with a similar formula field as indicated above.
IP IP Logged
chloesnowling
Newbie
Newbie
Avatar

Joined: 29 Jan 2009
Location: United Kingdom
Online Status: Offline
Posts: 7
Quote chloesnowling Replybullet Posted: 30 Jan 2009 at 3:46am
Great Thank You!
 
When I then group by the date field the supressed fields show as group headings (but blanked out).  I tried to surpress these but didnt work!
 
Any ideas?
 
Thanks Guys
Thanks, Chloe.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Jan 2009 at 9:30am
Hi Chloe,
I am a little confused as to why you wanted to keep all the rows but you are grouping on the Date. You stated you did not want to remove records because you wanted to count or sum items. The grouping on the date will impact this unless it is at the report footer level.
Regardless here is what you can do,
Replace the date field with a formula field and group on the formula instead of the original date field, this will then group your A and Dates as distinct grouped items and everything as as one group (a blank date).
Date repalcement formula:
if (letter_type)='A' then (Date_letter_sent)
Once you have your group on this formula a BLANK will be your first group. You can suppress it by clicking on the section expert, selecting the group level that it is on and clciking on the "Suppress Blank Section" as TRUE.
THis will only suppress the Header row, not any details. If you need them to be suppressed you can donditioanlly suppress them as well suing other formula.
Hope this helps.
 


Edited by DBlank - 30 Jan 2009 at 9:33am
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum