Link to home
Start Free TrialLog in
Avatar of nadermann
nadermann

asked on

Hiding Groups when no data is present

I have a report I am working on where I am breaking the records out by lines. One record may have 2 lines, one record may have 1 line, one record may have 3 lines. I thought the easiest way to do this would be to create a group for each line then hide the lines (groups) where there is no data present to prevent the blank lines in the report. I tried to write a module based on one of the fields being empty, it would set the visble property to false, but that does not work. Maybe it is just my code...? One of the fields that is Null is called nPP2AGO. The name of the report is PPReport. Anyone able to help. Maybe it would be easier to just dump each line into one Detail area? Thanks in advance!
ASKER CERTIFIED SOLUTION
Avatar of pootle_flump
pootle_flump

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What is the grouping factor, wherein you would get a group geader, but no data?
You should set a criteria for the report not to report when the grouping factor has null sub-values.
Avatar of nadermann
nadermann

ASKER

Pootle-
I tried that but it didn't make any difference. The blank lines still appear in the report.

Jerryb30-
This report is built off of subqueries to obtain the data in one query. The data originally had 0's but using sub-queries with a left outer join the data now shows as nulls. The data was originally all on one long line in the query, but I need the lines stacked in the report. How do I "set a criteria for the report not to report when the grouping factor has null sub-values"?

Thanks.
Can you post the SQL for the report source?

sure:

SELECT [PPs1&2].tTRACK, [PPs1&2].tDATE, [PPs1&2].nRACE, [PPs1&2].nDIST, [PPs1&2].nSURF, [PPs1&2].nCLASS, [PPs1&2].nEPR, [PPs1&2].nMLO, [PPs1&2].tPGM, [PPs1&2].tHORSE, [PPs1&2].nPP1AGO, [PPs1&2].tPP1TRK, [PPs1&2].nPP1DIST, [PPs1&2].nPP1SURF, [PPs1&2].nPP1CLA, [PPs1&2].nPP1SOR, [PPs1&2].nPP1CSF, [PPs1&2].nPP1FR1, [PPs1&2].nPP1FR2, [PPs1&2].nPP1FR3, [PPs1&2].nPP1AP, [PPs1&2].nPP1EP, [PPs1&2].nPP1SP, [PPs1&2].nPP1FX, [PPs1&2].nPP1LP, [PPs1&2].nPP1EEN, [PPs1&2].nPP1RPAC, [PPs1&2].nPP1RPER, [PPs1&2].nPP1ODDS, [PPs1&2].nPP1FSZ, [PPs1&2].nPP2AGO, [PPs1&2].tPP2TRK, [PPs1&2].nPP2DIST, [PPs1&2].nPP2SURF, [PPs1&2].nPP2CLA, [PPs1&2].nPP2SOR, [PPs1&2].nPP2CSF, [PPs1&2].nPP2FR1, [PPs1&2].nPP2FR2, [PPs1&2].nPP2FR3, [PPs1&2].nPP2AP, [PPs1&2].nPP2EP, [PPs1&2].nPP2SP, [PPs1&2].nPP2FX, [PPs1&2].nPP2LP, [PPs1&2].nPP2EEN, [PPs1&2].nPP2RPAC, [PPs1&2].nPP2RPER, [PPs1&2].nPP2ODDS, [PPs1&2].nPP2FSZ, PP3.nPP3AGO, PP3.tPP3TRK, PP3.nPP3DIST, PP3.nPP3SURF, PP3.nPP3CLA, PP3.nPP3SOR, PP3.nPP3CSF, PP3.nPP3FR1, PP3.nPP3FR2, PP3.nPP3FR3, PP3.nPP3AP, PP3.nPP3EP, PP3.nPP3SP, PP3.nPP3FX, PP3.nPP3LP, PP3.nPP3EEN, PP3.nPP3RPAC, PP3.nPP3RPER, PP3.nPP3ODDS, PP3.nPP3FSZ
FROM [PPs1&2] LEFT JOIN PP3 ON ([PPs1&2].tDATE = PP3.tDATE) AND ([PPs1&2].tPGM = PP3.tPGM) AND ([PPs1&2].nRACE = PP3.nRACE) AND ([PPs1&2].tTRACK = PP3.tTRACK);
I suppose it is too simple to add
WHERE nPP2AGO is not null
to end of SQL?  
Are you statinng that if any of the key fields are null to not have data under the grouping?  If so, relook use of left join in  report source.
Have you considered using subreports to stack your lines?  

I think I got it.....based on Pootle's response I went back and yes, I did have the section set to CanShrink, but failed to do the same for the data within that section. Making sure both are set to CanShrink, all looks fine now! Thanks for your help!
Super - glad to here.
hear. I meant hear. I think I am turning dispeptic.