2
votes

I have a rather simple problem that I haven't managed to workout for myself despite many hours of searching the web.

I have a report containing timestamped data from a few thousand devices (loggers), to present the data in a sensible manner, I set up two groups in the report; Loggers and Timestamp so the data first grouped by logger id and then by timestamp which is working fine

Group 1 Logger 1
  Group 2 Timestamp 01/08/2012
    Data...
    Data...
    Data...
  Group 2 Timestamp 02/08/2012
    Data...
    Data...
Group 1 Logger 2
  Group 2 Timestamp 01/08/2012
    Data...
    Data...
    Data...

Now the data (detail) fields are hidden from the user and I only want to display the header for group-2 if there are 4 or more records in each group-2. To achieve this I have used the following suppression formula on group-2

Count ({GMAC_spDg2Report;1.tTimeStamp}, {GMAC_spDg2Report;1.tTimeStamp}, "daily") < 4

The trick is that there are certain level 1 groups where all group-2 headers are suppressed and where this is the case, I want to hide the group-1 header as well. Using the same suppression formula as group-2 in group 1 did not yield the desired result. I have also tried to use a running total (called {#Count Unsupressed Days}) in the group-1 footer with a distinct count and the formula below being reset on each group-1

Count ({GMAC_spDg2Report;1.strLogger}, {GMAC_spDg2Report;1.tTimeStamp}, "daily") > 4

The running total works perfectly, returning a 1 in group-1 footer if the group has sub groups that are not suppressed and 0 if all group-2 headers are suppressed.

So here is the CHALLENGE, I cannot seem to apply a suppression rule in the header of group-1 using the output from the running total. To demonstrate the problem I created a formula field containing only the output from the running total and placed this in the group-1 header. The results are confusing to say the least... the formula field does not show the same value as the running total and hence the suppression rule is not working.

I hope this makes some kind of sense... I feel like I have tried everything

2
+1 Very nicely laid out question. The problem is that Running Totals must be used on or after the records they are counting because of the way CR does its evaluation passes. By having your data you're trying to suppress in the Group Header, you are limited in what functions you can use (no print time formulas, no running totals, but basic summary functions should be OK). - Ryan

2 Answers

1
votes

I don't have a definite solution, but using a formula field starting with

WhilePrintingRecords;
...

the formula will be processed after all records are read, and therefore you will be able to use it in section headers with correct result.
Now there is the problem of finding a formula logic that will be of use for you, but perhaps this first step can help you in the right direction.

0
votes

I had a similar problem once. As I remember, the trick was to check Suppress blank section in every detail section and checking some similar sounding option Suppress blank group (?) in group header section.

Sorry I can't give you the exact name, it's long ago and I used the German version. I know it's possible without formulas, though.

I take it you don't use sub reports. If you do, note that the trick only works if the sub report has the option Suppress empty report (?) checked along with what I wrote above.