Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Display three tables correctly Post Reply Post New Topic
<< Prev  Page  of 2
Author Message
mac-duff
Newbie
Newbie
Avatar

Joined: 22 Apr 2010
Location: Spain
Online Status: Offline
Posts: 21
Quote mac-duff Replybullet Posted: 27 Apr 2010 at 4:39am
Hi,

thank u very very much. I think it looks good.

But I have another question, of course.

I want know to sum the table NumMoldes just when Ok =1 is

For this I have a formular but the value is then for all pages the same

If {Produccion.OK} = 1 Then
Sum ({Produccion.NumMoldes})
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Apr 2010 at 5:58am
create a formual field as:
If {Produccion.OK} = 1 Then {Produccion.NumMoldes} else 0

 
Now SUM this formula at any group level
IP IP Logged
mac-duff
Newbie
Newbie
Avatar

Joined: 22 Apr 2010
Location: Spain
Online Status: Offline
Posts: 21
Quote mac-duff Replybullet Posted: 27 Apr 2010 at 9:02pm
Hi,

THANK u. It seems to work exactly like I wanted :) really happy.

Two things I dont understand, why was my code not working and second why is the GroupHeaderSection1 on the first page a bit more up and on the other pages?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Apr 2010 at 3:41am
Your code ...
If {Produccion.OK} = 1 Then

Sum ({Produccion.NumMoldes})

did not work because you can not conditionally SUM a row. You were trying to do a WHERE clause per row to include or exclude the row in the SUM. Crystal won't do that. What this formula was doing was showing for each row a 0 if the condition was false or the the entire SUM of the NumMoldes (for all records) if the condition was true.
Crystal does not let you conditioanlly sum like that. YOu can either write a formula like we did and sum that, or use a formula with a shared variable to conditinally include or exclude each row, or you can use a Running total (like my earlier post suggested) to conditionally include or excldue rows.
 
Your first page has the Report header on it.
If you suppress that your group header will appear in the same location on the first page as each following page


Edited by DBlank - 28 Apr 2010 at 3:43am
IP IP Logged
<< Prev  Page  of 2
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