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!

Crystal Decisions Subreports with borders

Status
Not open for further replies.

PamP

Technical User
Apr 4, 2002
5
US
I am using Crystal Reports 8.5. I have a main report that has several subreports attached. All reports are linked by an id number. If there is no data in a particular subreport then nothing prints. This is fine except if the border is left on the sub report it shows up as just a blank box. My question is how can I make the border print only when there is data in the subreport? Under File/Options I have checked "suppress printing if no records selected." That doesn't work for the subreports.

Any help is greately appreciated. I am not that familiar with writing formulas.

Thanks in advance for your help.

PamP
 
right click the section that the subreport is in and select "suppress blank section" Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
Thank you for you quick response. I tried what you suggested, but I still get a blank box showing up on the report.

I am willing to try any other suggestions.

Thanks again
Pamp
 
Dgillz - that doesn't work....Crystal treats a subreport as a non-blank object even though it returns no values. Many posts have been made here trying to do what you have suggested.

PamP - if I understand you corectly you just want the border of the subreport field to disappear if there is no values returned.

There is a FORMAT FIELD for the Subreport field itself (just like a normal report field) and there should be conditional conditions for the borders. I usually get rid of these borders totally so I never have this problem.

However, Perhaps you can create a shared variable called say... BorderFlag which can be placed in a subreport formula such that if it executes then it is set to "TRUE"

In the reportheader of the subreport put the formula:

@BorderFagSet (report header suppressed)

Whileprintingrecords;
shared booleanVar BorderFlag := False;

then in a formula within the subreport put

WhilePrintingrecords;
shared booleanVar BorderFlag := True;

(... rest of the formula...)

then in the main report,in the "Format Field" for the subreport, for the conditional conditions for the border edges place the following formula for each side

shared booleanVar BorderFlag ;
if not BorderFlag then SingleLine else NoLine;

that might work...I say Might since I am not sure about the timing of getting that shared flag.

Hope it works for you
JimBroadbent@Hotmail.com
 
Ok I understand the concept of what you are saying, but I am new to formulas....so that being said....I don't know what the "rest of the formula" would be or where to put the formula that goes within the subreport...

Thanks again for your help.

Pamp
 
tell me this then...

Do you really want the borders around the subreport...are they necessary for the look of the report??

if not then just remove them entirely from the subreport field in the main report...then there will be no empty "box" when nothing is returned by the subreport. JimBroadbent@Hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top