Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Suppress data that meet conditions Post Reply Post New Topic
Page  of 2 Next >>
Author Message
SteveDLC
Newbie
Newbie
Avatar

Joined: 27 Jan 2016
Location: Australia
Online Status: Offline
Posts: 21
Quote SteveDLC Replybullet Topic: Suppress data that meet conditions
    Posted: 25 Apr 2016 at 7:25pm
Hi,

I have a main report with subreports and need to suppress some of the data in the main report.

The main report is setup as follows.
RH = text
PH = text
GH1 = field labels and subreports with shared variables
Da = field data
Db = field data
GF1 = text, summary data, formula's based on shared variables
RF = suppressed
PF = page footer stuff

I've read a lot of google material and in forums but still can't get this to work. I've had to redesign some reports a few times because element placement was wrong.

So the report design above does what it's supposed to do. I've used the section expert and created in the 'Suppress (No Drill-Down)' formula something like @formula 1 + @formula 2 >= @formula 3

This report prints about 20 pages but I only want to see the important information which is about 2-3 pages. Essentially removing all groups meeting the suppress formula.

I've placed the above suppress formula in the group header, footer, detail header and detail lines and a combination thereof but I'm having mixed results. No matter how I try it doesn't give me the results I'm expecting.

I hope I've worded this correct and hope it's just something simple that I've overlooked.

Thanks,
Steve.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Apr 2016 at 3:31am
one of the easiest things you can do for this is to place all 3 formulas in each of the sections you are trying to suppress. Ru the report and read carefully read the formula results from section to section and group to group.
You will then understand which ones are meeting the criteria or not and why and this should lead you to why your suppression results are not as you want. Not knowing the formula makes it impossible to really tell but most likely at least one of these is altering it's value on each section. Therefore the overall result is changing in each section. Shared variables and running total values occur in in a later pass and don't move 'back up' the report. Your a, b and c formula results will change in the first group from the group header to each detail to the group footer. Therefore when you are looking at a group as a whole to suppress you can't think of your group values being the same across all sections in the group.

Edited by DBlank - 26 Apr 2016 at 3:32am
IP IP Logged
SteveDLC
Newbie
Newbie
Avatar

Joined: 27 Jan 2016
Location: Australia
Online Status: Offline
Posts: 21
Quote SteveDLC Replybullet Posted: 26 Apr 2016 at 7:50pm
Thanks for the reply.

I tested this as you've suggested and it does what is expected.
The values being passed from the subreport shared variables appear correctly in all of the detail lines so I can safely say they are working.

The formula is testing if the shared variables' total is greater than or equal to a Sum in the footer area. When applying this to suppress the Detail sections and Group Footer section, they suppress as expected. However if I apply this to the Group Header, that's where the problem is. I know it won't do what I want because as you've mentioned, the information is passed in a downward direction.

If I do what I've written here and leave the Header alone, the report isn't as long but it prints a lot of Group Header information which I'd like to hide.



Edited by SteveDLC - 26 Apr 2016 at 7:51pm
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Apr 2016 at 2:52am
Did you test what happens (what sum value is displayed) when you place the group sum in the group header?
If that value is not using a group function it will have different values in the header than the footer.
IP IP Logged
SteveDLC
Newbie
Newbie
Avatar

Joined: 27 Jan 2016
Location: Australia
Online Status: Offline
Posts: 21
Quote SteveDLC Replybullet Posted: 27 Apr 2016 at 2:40pm
I think I'm missing something here.

I'm not sure what you mean by Group Sum.

I've achieved a 'Sum of field data' in the Group Footer using 'Insert Summary'.

I moved the 'Sum of field data' in the Group Footer to the Group Header and it shows the correct value.

However whenever I do some kind of calculation using a formula the result changes.

The result is grabbing the values from the shared variables from the previous Group.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Apr 2016 at 4:07am
The insert summary functions allow you to have the result int eh header as well as footer.

What exactly do you mean by
"However whenever I do some kind of calculation using a formula the result changes."
What result? What calculation?
IP IP Logged
SteveDLC
Newbie
Newbie
Avatar

Joined: 27 Jan 2016
Location: Australia
Online Status: Offline
Posts: 21
Quote SteveDLC Replybullet Posted: 28 Apr 2016 at 1:28pm
Sorry if this is confusing. I'm trying to explain it clearly.

Based on the layout in my first post.....

GH contains a product code plus subreports. Two of the subreports collect values which are quantity available plus quantity on purchase order.
Details a+b simply show field data for customers and what stock is outstanding (no formula's or subreports).
GF has the summary value of how many are outstanding, plus the formulas for the shared variables.
The calculation I want to use to suppress the group is when the quantity available plus the quantity on purchase order is greater than how many I have on back order for customers. I only want to see on the report when the total of customer order quantities exceeds how many I have in stock + on purchase order.

Hope this helps.

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Apr 2016 at 2:29am
I think this might be your issue...
"GF has the summary value of how many are outstanding, plus the formulas for the shared variables."
I assumed "GH1 = field labels and subreports with shared variables" meant you had pulled the shared variable values into field in the GH as field values that wer part of the main report. I now am interpretting this to mean you display the sub report variable results inside the sub reports and the value has not been transferred to a shared variable in the main report until the GF.
Am I describing this correctly?

The shared variable values , although displayed in the main report (as part of the sub report display) do not actually exist as those same values in the main report until you get tot he footer. so when you are using the suppress formula I think it is is using the returned value from the prior group (the GF shared variable results just above the GH you are trying to suppress).
IP IP Logged
SteveDLC
Newbie
Newbie
Avatar

Joined: 27 Jan 2016
Location: Australia
Online Status: Offline
Posts: 21
Quote SteveDLC Replybullet Posted: 29 Apr 2016 at 5:10pm
Please forgive me as I think perhaps I have the subreports setup incorrectly.

The subreport is setup with a shared variable declaration as follows:-
Shared NumberVar abc := {field.name};
abc

This is then placed into the detail line of the subreport with all other sections in the subreport suppressed.

The subreport is then placed in the GH1 of the main report.


Edited by SteveDLC - 29 Apr 2016 at 6:13pm
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 02 May 2016 at 3:13am
I am not entirely sure what value you are trying to get from the sub report but unless you also place the main report shared variable in the main report group header you have no actual sub report data to use in the main report GH. Do not confuse seeing the sub report in the GH as being able to use that data. You have to pass it back into the main report in that GH before you can use. Passing it back in the GF will not work for the needed values in the GH.

Edited by DBlank - 02 May 2016 at 3:15am
IP IP Logged
Page  of 2 Next >>
Post Reply Post New Topic
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



This page was generated in 0.027 seconds.