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!

Suppress detail in crystal reports

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I am calling crystal reports from VB COM object. I have a header, footer and details.
I am printing special instructions in the footer. I am populating 15 fields there and it is printing fine. My question is if I have only 2 fields in it showing special instruction, then I want the group detail for rest of the fields to get suppressed.So, that the footer will not take up all the 15 lines space and let more details come in. I tried using the suppress attribute and formula, to check for null or blank string and suppress accordingly. But it still takes up the space, not allowing more details to be printed.
Any help, hint or suggessions.
 
I think, that in addition to suppressing the Field Object itself, you have to have the "Suppress Blank Section" turned on, otherwise even though your field is suppressed, Crystal will hold space for it. It can be done through the VB code, ex.
oRpt.Sections.Item("D").SuppressIfBlank = True
 
If I understand your question correctly, you have a Page Footer with data like this:

Line 1 contains Field 1
Line 2 contains Field 2
...
Line 15 contains Field 15

And sometimes Fields 3-15 are blank.

If this is the case, you cannot suppress the section easily because there is always going to be data in Field 1 and Field 2.

What you can do (but usually not 13 times), is to split a section in sub-sections. So, you'll have Page Footer A, Page Footer B, etc. You do this put right-clicking on the bar of the Page Footer section and choosing "Insert Section Below." If you keep doing that, you'll keep creating sub-sections. You can then put each field in its own section and then set that sub-section to "Suppress Blank Section."
So each field in its own section will determine whether or not it will be displayed. No data means no space being taken up on the output because the section is suppressed. Brian J. Alves
Terrier Consulting, Inc.
Email: brian.alves@worldnet.att.net
VB / Crystal / SQLServer
 
Actually that doesn't work in page footers, only in group footers. So, I hope you're using group footers. :)
[red]From CR Help:[/red]
By default, Crystal Reports reserves space at the bottom of each page for your Page Footer sections. This space is reserved whether or not the Page Footer sections are conditionally suppressed. Normally the space reserved is equivalent to the combined height of all Page Footer sections that are shown or conditionally suppressed.

Malcolm Wynden
I'm for sale at malcolm@wynden.net
 
Malcolm is correct. You can set up multiple page footer sections, set them to suppress when blank, and Crystal reserves the space anyway.

Crystal should probably disable the checkbox for "Suppress Blank Section" for page footer sections if the function doesn't work.

According to the Crystal KB, the reason the functionality isn't there is because Crystal cannot determine at the beginning of painting the page whether or not the page footer will be suppressed. So it assumes the worst-case, that it will not be suppressed. Brian J. Alves
Terrier Consulting, Inc.
Email: brian.alves@worldnet.att.net
VB / Crystal / SQLServer
 
Actually, it still makes sense to use this option, but only if you also check the option to Reserve Minimum Page Footer. This forces Crystal to reserve only the height of the tallest Page Footer section, which is useful (for example) when you have several page footers from which you are conditionally printing one.
This would not be a useful option in the problem indicated in this thread, but it is a reason for this option still to exist in the Page Footer. Malcolm Wynden
I'm for sale at malcolm@wynden.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top