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

Suppress Record which appears previously in report

Status
Not open for further replies.

GSwan1980

Programmer
Mar 29, 2006
17
GB
Hi all,

I really hope someone can help with this as i've completed everything else regarding the report i am doing and found a small glitch.

Is there any way to suppress a row in the details section if the same entry appears in a previous grouping?

I have a group of date range bands which i'm using to find out if a company has recieved a service call in a set period of time. The trouble is that there can be a number of activities attached to each company and i only want the latest one in this case. I order the data by company ID and then by date of service. I then calculate a running total that counts the activities per group and a suppression calculation removes the row if it is greater than 1 (hence the latest date). I then want to roup by age bands but when i do this it shows the latest company service date in each date range banding which i do not want duplicated.

Hopefully that made sense. any help is much appreciated.

Cheers

Grant
 
hi
yes
select the detail section and format
in the suppress x2 insert InRepeatedGroupHeader

Durango122
Remember to used all fingers when waving to policemen :)
 
Hiya,

Thanks for the response. That didn't seem to work. As far as i can make out it seesm that this function just deals with group headers that cross pages etc.

What i'm looking for is if a specific company ID appears in one group i don't want it to appear any where else in the report.

Thanks for your input though
 
Is your date range band the first group with companyId group 2? Where are the date range bands coming from? Can you show a sample of current output and desired output.

MrBill
 
lbass,

completely forgot. Its crystal reports version 9.

MrBillSc,

The date bands are coming from a function which checks the maximum Date of the service order. Since adding the bands field the problem has arisen. It now appears that the maximum date for each company is also shown for each banding.

Current output

{group}Less than 2 months
[CompanyID] [Company name] [Date ServOrder Resolved]
1 company1 8 Feb 2006
2 company2 13 Feb 2006
{group}2-3 months
[CompanyID] [Company name] [Date ServOrder Resolved]
3 company3 4 Jan 2006
4 company4 5 Jan 2006
1 company1 18 Jan 2006
.
.
.
.

This continues. The problem is what is occuring with Company1. Really i only want the last date when a service order was carried out, hence i don't want it to appear in group 1 (less than two months).
It works fine without the date band grouping as all fields not pertaining to the maximum service date are suppressed. The addition of the group means that the maximum date is taken per date range group.

Does this make sense?

Is there some way that i can select within the record selection formula the maximum date (service order) for each company ID and only use those records?

Many thanks

Grant
 
Go to database->database expert->your datasource->add command and create a command like:

Select max(table.`date`) as maxdate,table.`companyID`
From `table`table
Group by table.`companyID`

Link this to your main report tables by linking {command.maxdate} to {table.date}, and {command.companyID} to {table.companyID}. Select the links and make sure->link options->check "Enforce both". This will cause only the most recent date per company to appear in the report. You can then successfully group them into your age bands.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top