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!

supress the details

Status
Not open for further replies.

akar33

Programmer
Dec 13, 2004
39
0
0
US
Hi There,
In my report there are 7 grouping there are names they need to be in the details section, my problem is that detail information is appearing 4 times in the report, I just want to dipaly it once. Is there anyway I can control it by using counters.

If anybody has any suggestion that would be great.

Thanks again for all the suggestion I have received from this forum, have found it very useful.

Annie
 
Not sure why you want to use counters, and your post doesn't include much technical information so it's more difficult to assist you.

Successful posts tend to include the basics:

Crystal version
Database/connectivity used
Example data
Expected output

Under the Database pull down you might find Select distinct values, this is version dependent.

More often queries return row inflation rather than duplication, so the best means to only display the rows that you want would be to use the NAME_ID field as the innermost grouping, suppress the details, and display the data in the group header or footer, suppressing the other.

If the above doesn't resolve, try posting some specifics about the data and your software being used.

-k
 
I am using Crystal 9.0 to create the report, the report is grouped as studentID and FamilyID, it has other groupings they are not so important.
the report needs to list students demographics information in the one section of the report and list of siblings, I tried using subreport and linking the subreport with Family ID, but was not able to find a way to supress the the students name whose name appears in the main report out of the siblings name.

For example
Student A: STDID(34567), Last Name(Roy), First Name(Tina)

FamilyID: 5678 (all of them have same family ID)

Siblings (Tina has three siblings in the database)

last name: Roy
first name: Dona

last name: Roy
first name: Reena

last name: Roy
first name: Aloya

CORRECT/Desired output
Student Name: Tina Roy

Siblings name:
Aloya roy
Reena roy
Dona roy

If I use sub report connecting by family ID I am getting the following (Tina's name appears in the siblings name)

Student Name: Tina Roy

Siblings name:
Aloya roy
Reena roy
Dona roy
Tina Roy

If I use grouping as mentioned above(STDID and FamilyID, put the name of siblings in details) then I get following, entire chunk of siblings appears 4 times as following

Student Name: Tina Roy

Siblings name:
Aloya roy
Reena roy
Dona roy

Siblings name:
Aloya roy
Reena roy
Dona roy

Siblings name:
Aloya roy
Reena roy
Dona roy

Siblings name:
Aloya roy
Reena roy
Dona roy



annie
 
I'm not sure why you're using a subreport.

At any rate, you can store the name of the person you're linking in a shared variable prior to running the subreport and reference it in the subreport for suppression. This formula would occur PRIOR to running the subreport, as in:

whileprintingrecords;
shared stringvar TheName := {maintable.name}

Then in the subreport reference the name in the details suppression formula, as in:

whileprintingrecords;
shared stringvar TheName;
{subreporttable.name} = TheName

Id's could be passed if that's possible, or you may be able to omit the subreport entirely by joining the table to itself in the main report.

-k
 
I omitted the sub report, but as I mentioned earlier for e.g.
For Student Tina Roy
instead of apearing only once all the three siblings are appearing 4 times same applies for all students.

I included the sibling name in details area if I put it in header of FamilyId then it only displays first sibling, in this case Aloya Roy.

example of how the outcome looks

Aloya Roy
Reena Roy
Dona Roy

Aloya Roy
Reena Roy
Dona Roy

Aloya Roy
Reena Roy
Dona Roy

Aloya Roy
Reena Roy
Dona Roy



Annie
 
You could either use the subreport with the shared variable to suppess the student's name, or you could create a formulas that would accumulate the sibling names in the detail section and display them in the group footer for the student, as in:

//{@reset} to be placed in the student group header:
whileprintingrecords;
stringvar sibs := "";

//{@accum} to be placed in the detail section:
whileprintingrecords;
stringvar sibs;
if instr(sibs, {table.sibling}) = 0 then
sibs := sibs + {table.sibling} + ", ";

//{@display} to be placed in the student group footer:
whileprintingrecords;
stringvar sibs;
left(sibs,len(sibs)-2)

-LB
 
It works great but it does not suppress the student who is in the main body of the report, it adds his/her name as well

for example
Student name Tina Roy(Group header student ID)

has three siblings

Aloya Roy
Reena Roy
Mona Roy


NOTE (Tina Roy is part of the family tree as well)
so when I am accumulating all the siblings it adds "Tina Roy" back in the report, in display of the StudentID footer

tried adding another if statement to disregard STDname but does not seem to give the desired output

Annie
 
Try:

//{@accum} to be placed in the detail section:
whileprintingrecords;
stringvar sibs;
if instr(sibs, {table.sibling}) = 0 and
{table.sibling} <> {table.STDname} then
sibs := sibs + {table.sibling} + ", ";

I'm not sure about this because I don't know what fields you are using. This assumes that you are grouping on {table.STDname} and that you have a separate field {table.sibling} for all children's names, including the student name.

-LB
 
It is my fault I did not explain in details, every student has STDID and FAMILID

So in the family table every sibling including the student who has STDID is part of it. So the desired outcome for a certain student would be all the siblings NOT the student itself.

Annie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top