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!

Sub-Reports Issue II

Status
Not open for further replies.

alexfromuno

Programmer
Nov 6, 2002
20
Dear All,

I too have the same problem with crystal (no sub-reports with a sub-report.) I'm using CR 11.0 attached to Oracle 9i and here's my problem.

I wrote 2 reports that show the status of a patient awaiting authorization for an evaluation. Lots of data elements on each report (fNAME,LNAME,PAT_ID, DOB) and it's dependant on a code number = 12345 (an example only) to populate. Also, on each one of these reports I have embedded a sub-report that shows the care providers (Insurance Plans) associated with that patient and linked it via pat_id. I save these as reports.

I have a need to create a Title page master report that will then on it the 2 above sub-reports embedded in the master. So, all the department user has to do is fire off the master report and after I've embedded all the reports I need to create, the master report will print all the sub-reports too.

Unfortunately I've lost the sub-sub-reports I mentioned above. Since they are linked by pat_id and the master report will do nothing but run the sub-reports, I'm kind of stuck as to where to go with this next.

So, basically, the already existing 2 reports that I created have a sub-report already linked/embedded on them. When I utilize these reports as sub-reports on a master report, the embedded sub-reports on the original reports disappear. But I need that data on the master report to show up.

Any suggestions?


 
One option would be to remove the subreports from the 2 reports and recreate them on the master report. Then use Shared variables to paas the values from subreport to subreport as required.

HTH

Gary Parker
MIS Data Analyst
Manchester, England
 
Gary,

I thought of that already. The problem is that in the 2 reports, there is a possibility of numerous patients being on those reports. Each sub-sub-report showing associated insurance company’s needs to only reflect those insurance companies attached to that patient. Does that make sense?

Pat_id date_of_admit name
12345 12/08/2005 joe blow

Insurance Cmpny address
ABC Company 12345 anywhere




Pat_id date_of_admit name
54321 11/08/2005 fred smith

Insurance Cmpny address
XYZ Company 666 anywhere
567 Insurance 333 drive

That’s what I need to duplicate.

Thanks,
alex
 
You could achieve this format without using subreports for the insurance company name. Then you could use the following suggestion both for the main report (Report 1) and for a subreport which you place in the report footer.

First, add the insurance company table to your main report, and link it by the patient ID field. You should use a left outer join FROM the main report table to the insurance table.

Insert a group on patient ID, and then a second group on insurance company. Because you might have more than one visit by a patient, place the patient fields in the detail section, remove the patientID group name, and drag the page header (patient) fields into GH#1.

Insert a second group footer #2 section, and drag the groupname (insurance) into GH#2b, along with other corresponding fields you are displaying with each insurance company. Use GH#2a for the corresponding labels by inserting text boxes and adding text like "Insurance Co", etc.

Then create two formulas and place them in the designated sections:

//{@reset} to be placed in GH#1 and suppressed:
whileprintingrecords;
numbervar cnt;
if not inrepeatedgroupheader then
cnt := 0;

//{@cnt} to be placed in GH#2 and suppressed:
whileprintingrecords;
numbervar cnt := cnt + 1;

Then go to the section expert->details->suppress->x+2 and enter:

whileprintingrecords;
numbervar cnt;
cnt <> 1

Then still in the section expert, highlight GH#2a->suppress->x+2 and enter the same formula.

Insert a subreport for your second report and repeat the same steps.

-LB

 
You could write a command object that has a subquery in the sql. That would replace the subreport.
 
Mufntuf:

What is a Command object that ahs a subquery in the sql??

I'm not familar with that.

alex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top