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

Suppress details based on group

Status
Not open for further replies.

awaywifye

Programmer
Jul 1, 2004
24
0
0
US
This is probably going to be really basic, but...

Using CR8.5, SQL7. Report is using recordsets (not live data).

I feed the report xx many records, then only dislay a random 10% of those records. I have 3 groups (RecordCount = 10):

Group1 - Based on a formula // Rnd()
Group2 - Troubletickets has a suppression formula // Recordnumber >= (((DistinctCount({Approval_txt.nTicketUID}))/100) * ({Approval_txt.RecordCount}))
Group3 - StepsTaken
Group4 - ToolsUsed

Group3 and the Details Section need to be suppressed if Group1 is suppressed.

I tried placing the same formula in Group3 and the details. The report would only display 10% of the Group2 and Details records. I also tried unsuppressing the details but I wind up with 100's of pages of records with no Group1 header.
 
You could look for records with an 8 in the 4th position of their account number, something like that. mid({your.acc}, 4, 1) = 8, and that could go in your select statement, saving work,

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
You could try the following. Create two formulas:

//{@false} to be placed in the Group #1 header:
whileprintingrecords;
booleanvar flag := false;

//{@true} to be placed in the Group #2 header:
whileprintingrecords;
booleanvar flag;
if recordnumber >= (DistinctCount({Approval_txt.nTicketUID})/100) * {Approval_txt.RecordCount} then
flag := true;

Then to suppress Group 2, 3, 4 (headers and footers) and the details, use a suppression formula like:

whileprintingrecords;
booleanvar flag;
flag = true //Note there is no colon

-LB
 
Madawc - Thanks for the suggestion, but I have to select truly random records based on x% and daterange. I should get a different report each time the report is run for the same x% and range.

lbass - The formula works, but I only get x% of my detail records.

In effect I am passing the report the following recordset:
Ticket StepsTaken ToolsUsed
1003999 0001 hammer
1003999 0001 saw
1003999 0001 forceps
1003999 0002 pencil
1004000 0004 saw
1004000 0005 pencil
1004001 0001 hammer
1004002 0002 forceps
...

Using the above formula, I get 10% of my tickets showing on the report (which I need), and then 10% of the tools (rounded up) used on that particular ticket:

Ticket - 100399
StepsTaken - 001
ToolsUsed - Hammer

I decided to cheat. I split the recordset into 2 seperate recordsets. Ticket/StepsTaken and ToolsUsed. Then I only pass x% of the Tickets to the report. I then use a subreport for the ToolsUsed and link the sub to the report based on the TicketUID. This seems to be working, and it sped up the report a little bit.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top