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

Suppress a Subreport with a Shared Variable

Status
Not open for further replies.

rhper14

Technical User
Oct 23, 2002
16
US
I am using a subreport (in group header 2) to generate a shared var that conditionally suppresses the details in the main report. I don't want to see the data in the subreport. But if I suppress GH2, I don't get any data from the shared var. My workaround was to suppress everything within the subreport itself and shrink the field in the main report. Only problem is the report is reading thousands of records, most of which the details end up being conditionally suppressed...so then I end up with pages of the shrunken GH2. Is there any way I can hide/suppress GH2 so I only see data?
 
Make the short as physically possible, and suppress all the sections within the subreport.

Right click the GH2 in the main report, and check underlay following section.

Naith
 
Try a some of these

Set linking on subreport to main report so that it only returns data relevant to that group, this should reduce amount of data.

You should be able to suppress all lines in the subreport so that no blank lines are produced.

In format tick the box of the Group Header to underlay all following sections.

Ian Waterman
UK Crystal Reports Consultant
 
Thanks for the suggestions, but I've already got all of those things going on already. The subreport isn't creating my blank lines (since everything in it is suppressed), it's the fact that in the main report, the subreport is taking up space in the GH. So no matter how small I shrink the GH, that 1/8" or whatever adds up over 1000 records.
Let me give you an general idea of what I'm trying to do...the report is like a charting list for a medical record that is looking to see if the notes were cosigned correctly. It should only show those notes that were not cosigned correctly.

Group #1 is by patient.

Group #2 is by ChartingID (the database field for each distinct charting entry) and contains the subreport which is trying to identify if that entry was cosigned correctly. So a shared variable in the subreport "exports" either "correct" or "incorrect."

The details would be who did the note and when and would be suppressed if the shared var = "correct".

The underlay for GH2 doesn't work too well because there's a GH for each record. So any other ideas I can try? Or is there a better way to write this report? TIA for all the help.
 
Hey RH,
Tough to follow just why you're using a subreport at all. What kind of fields are the cosignings in?

Can you do without the subreport altogether and simply use a seperate formula for each cosign field, to test & count within the suppressed detail section, returning the results to the GF or else suppressing both GH & GF if all formulae are 0???
 
The key to the solution offered by Ian and myself is activating the Underlay Following Sections option, which you don't seem to have done.

Naith
 
My mistake! You've said you tried this at the end of the post - and yes, if you had a grouping for each record, this solution wouldn't be the smoothest. But then, if you have a group at the lowest level of detail, I'm not sure why you are grouping at all.

Can you confirm REMill's query?

Naith
 
REMill,
Unfortunately, the report is a little more complicated than what I had described. It's really an audit report to see if the note was cosigned by someone from the correct area (eg. 1st floor vs 2nd floor, Physical vs. Occupational Therapy, etc.). I had to use a subreport (I think) because the db table that has who cosigned the note (CHARTCOSIG) would be linked to the same table (PRACTITIONER) as the table showing who did the note (CHARTING). PRACTITIONER gives me the area for each therapist. So I'm using the subreport to determine the area of the cosigner.
I mis-spoke in my earlier post, the sharedvar is returning the cosigner's area from the subreport. Then the main report compares the area of the cosigner with the area of the original author.
I originally wrote the report w/o the subreport, but every time I asked for area, it only gave me the original author's area. Naith, I had to (again, I think) group on the lowest level of detail (each charting) in order to run the subreport on each charting.
Hope that made sense.
 
Add in the (CHARTCOSIG) table a second time, and join it accordingly.

You supply very little about the environment, rather state tidbits about how you're trying to implement, with scope creep in each post.

Often times you're better off to state your environment and requirement, rather than state how something must be done. Some of these folk just might think of a way to do it that you had not.

-k
 
good point...will do that in the future.

Not sure I understand what I should do after adding CHARTCOSIG into the main report.

Main report has CHARTING with (1) an equal join to PRACTITIONER via PractID and (2) an equal join to CHARTCOSIG via ChartID.
The subreport has CHARTCOSIG equal joined to PRACTITIONER via CosignID and using CHARTCOSIG.ChartID to link to CHARTING.ChartID in the main report.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top