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

Subreport Sort Problem - Crystal 10 1

Status
Not open for further replies.

ainkca

Programmer
Aug 26, 2002
111
0
0
CA
Hi all,

My report is an electronic version of a form that is partially a carbon copy, for Medication Reconcilliation before surgery.
Page 1 - Medications on Admission
Page 2 - Medications at Discharge

Both Pages are ALMOST the same, but different info is written about the meds. Page 2 is a subreport in one of the footers.

Main Report ("Page 1") Layout:
Page Headers - Patient info, Allergies subreport
Group Headers - Group is on casemain.casemain_id
Detail - shows list of medications, dose, frequency, etc
Group Footers - Allergies subrpt for "Page 2", "Page 2" subrpt
Page Footer

"Page 2" Subreport Layout
Group Headers - group if on casemain.casemain_id
Detail - shows list of medications, dose, frequency, etc
Group Footers

The two reports are almost the same really, the differences aren't data, but the boxes and spacing that is handwritten on the report from one page to the next. (so group headers and footers etc are esentially repeated in Page 2). There is only the one grouping (many headers)

The report prompts for the casemain_id, so only ever looks at one at a time.

The link for the subreport is casemain.casemain_id
(same field linked to same field, same table in both reports)

The sorting in the main report is
Group casemain.casemain_id
pathomemedslistwt.med_name ascending

the sorting for the subreport is
Group casemain.casemain_id
pathomemedslistwt.med_name ascending

Is there a way I should be doing a programatic sort on a parameter or something? I just used the sort expert.

The weird thing is the allergies subreports are sorted by the group and allergen name, and they sort fine. (used the sort expert, sort is on group casemain_id, then allergen).

Is it because the sort fields are the same for the main and subreport? I'm stumped.

Having them sort in the wrong order could be a patient risk if any notes get copied from one page to the next and they don't pay attention to the order of the medications.

Any suggestions?



 
I cannot tell from your description what results you are getting,i.e., it is unclear what is going wrong.

Also there appear to be two instances of an allergies subreport--one in the page header and one in a group footer--are these two different reports?

And why are there multiple group headers and footers is there is only one group?

-LB
 
I'll start with the allergies explanation, sorry, I should have said Part 1 and Part 2, instead of Page 1 and 2, since they both can span more than one page, and to save paper they only want the allergies there once per Part, not every page. I'm all ears if there is a better way.

The multiple group headers are because the hospitals using it want different wording, logos, etc. I've chosen to conditionally suppress a section instead of object by overlapping object, it was just too hard to see it all properly. I could overlap if you think that is the issue, but it doesnt' seem like that would be it.

What I'm getting is everything printing exactly where it belongs for both parts. In Part 1, the meds sort alphabetically, and in Part 2 they don't.

Does that help clarify?


 
No, not really. Part I and II mean nothing to me. Please show how the meds are sorting in the subreport, if they aren't alphabetically. Also go into sort records and report back what you see in the box on the right.

Also, does the subreport use tables as the datasource or possibly a query that could have an order clause built into it?

-LB
 
You'll see a mix of upper and lower case, it's supposed to be that way (a drug safety protocol of some kind I think). I thought it could have something to do with that since it does seem to be those that are sorting wrong.

med list on Page 1, (Part 1 of the form)
CELEBREX*
FOLIC ACID
GLUCOSAMINE
HALIBUT LIVER OIL
hydOXYQUINE
METHOTREXATE 2.5 MG
SYNTHROID
XALACOM EYE GTTS 50UG/ML

med list on Page 1, (Part 2 of the form)
CELEBREX*
FOLIC ACID
GLUCOSAMINE
HALIBUT LIVER OIL
METHOTREXATE 2.5 MG
SYNTHROID
XALACOM EYE GTTS 50UG/ML
hydOXYQUINE

The sort expert, I did put that in the first mail
but not with the Group #1 and the A, so here it is:

Main report:
Group #1: casemain.casemain_id - A
A - pathomemedslistwt.med_name
radial button is on Ascending

Subreport:
Group #1: casemain.casemain_id - A
A - pathomemedslistwt.med_name
radial button is on Ascending

They are exactly the same (I've checked over and over and had another pair of eyes look too in case I just wasn't seeing a small difference)

I'm going to see if I can find a way to put a pdf somewhere you can see the output so it makes more sense.
 
In the subreport, please go to report->group sort and see if a group sort is set.

Also go to report options for both main and subreport and make sure that "database server is case-insensitive" is set the same way.

Finally, might there be a leading space in front of some instances? Try wrapping the field in trim() in a formula and use that for your sort field.

-LB
 
The Group Sort Expert is greyed out... I hadn't even noticed that. What can I do to make it not greyed out?

Report options for both have database server is case-insensitve checked.

Here's a link to a pdf that shows two examples of the output, one from each campus.

I will try the trim idea and see what happens.

Thank you so much for helping lbass, I appreciate your efforts.
 
Well, I still can't tell WHY this is happening, but you can correct it creating a formula:

ucase({table.drugname})

Add this formula as your sort field instead of the actual field, but leave the drugname field in the body of the report so that is displays in mixed case.

You might want to do this in both main and subreport, just in case. I should have suggested this earlier--sorry.

-LB
 
Thanks so much lbass, that worked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top