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!

How to group on table field names and not on their values ?

Status
Not open for further replies.

zwieback89

Programmer
Mar 8, 2001
42
US
I have the following fields in the table which is the basis of my report PatientName Glu Na HGB I already have a grouping (ascending) based on the Patient Name and I get to see the PatientName on the left side tree. Now I want to add another subset of grouping under each patient - Glu, Na, HGB. So it looks like the following: PatientName - Glu - Na - HGB I tried to group on glu but I would get the values under each patient. I do not want that. I just want Glu typed under each patient, so when I click on it, I get to see the details and graphs for that Patient. Is this possible ?

I saw that the article c2007251 on the seagatesoftware.com is similar to this case but it is related to the Crysal Reports designer of VB. I do not how to do it in CR.

Please do offer suggestions. Thanks, Padmaja
 
Grouping is always about values, so that isn't what you want. Can you post a more detailed visual example of what a few lines of the report would look like?

Also, how many records are there per patient? How many of these do you want to see?

You could try widenning the details section and putting the other fields under the patients name. That might be what you are describing.

Or you could try adding a text objects in the details that you can type into. Labels that say "GLU" etc. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
zwieback89: The solution to your problem is to use Specified Order groups. These will have the effect of 'lumping together' all values of glu into 1 group within patientname, generate 1 header and 1 footer and will not display the individual records for each value of glu.

The only issue I can see looming however is that each group is 'within' the previous one e.g. glu is within patientname so therefore the assumption is that Na would be a subgroup of glu and HGB would be a subgroup of Na. If this is true then just go ahead and create specified order groups for these as well. If however this is false (i.e. Na and HGB are both subgroups of patientname) then you'll probably have to use embedded subreports with shared variables to get this to work. David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
To use embedded subreports I suggest that you first create a resport which is grouped by PatientName then by HGB (don't include Na). This will enable you to create totals by HGB within PatientName. You will also need to create a formula field for each total with the following structure:=

shared numbervar send_Na_case_count := DistinctCount({case},{Na}) etc. etc.

The important parts are:=
the use of 'shared' - this shares the value between main and sub reports
the use of the appropriate var declaration e.g. numbervar if you are transferring a number etc.
the use of a name you can remember (all will be revealed later!)
the use of the assignment characters :)=) which place the following result into the variable

You will then need to insert the subreport into your main report in the PatientName GroupHeader/Footer and link main to sub by PatientName.

In the main report create a matching formula field for each shared formula in the subreport e.g.:

shared numbervar send_Na_case_count

It is important that the variable names are identical to that used in the subreport!

Use this last formula to display the transferred result into your main report.

You can if you wish 'hide' the subreport from view - don't hide or suppress the section containing the subreport or nothing will get passed. Instead format the subreport so that only the section in the subreport with your shared variable formulas is visisble and then make the fields as small as possible and change font colour to White - White on White is difficult to see ;-))

Hope this helps
David C. Monks
david.monks@chase-international.com
Accredited Crystal Decisions Enterprise Partner
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top