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!

Subreport isEmpty ? 1

Status
Not open for further replies.

ricolame

IS-IT--Management
Nov 9, 2005
82
CN
Hi folks,

Working on subreports, and another question:

Is there any kind of formula that i can write to detect if the subreport is empty? Kind of subreportIsNull formula..

As I am working on two subreports per record set on my main report, I would like to put up flags to indicate which subreports have records in it.

My other feasible method is to create a shared variable which counts the no of records drawn from a subreport.

Any other easier methods for advise?

Thanks!
 
When I use a subreport, I include a section in the subreport that says "*** Nothing Found ***" and has a suppression formula, Not IsNull({Acc.no})

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
ha, I'm trying to shrink my available space, thus even if there's no records, i wouldnt even want it to appear a "No records found" text =)

Hiaks, cos i'm pulling selling history and purchase history for each part...

Thus i would need to determine what to do if there's no records (empty subreports) =)

 
If the goal is to shrink empty space, and since you are using CR10, then format each subreport to "suppress blank subreport" (format subreport->subreport tab), and then go into the section expert and format the section the subreport is in to "suppress blank section".

-LB
 
hi, i did all of that.

work another way round by reading the no of records pulled from the subreports. Have a subreport that will only appear if the other 2 subreports return empty data.

anyway thanks for the reply so far.
 
in this post, i'm asking if there's any available formulas i can use in main report that detects if a subreport is empty.

i have another subreport that will only be utilize if this current subreport is empty.

Anyway i have gone the tedious way, which is again, perform a total count for the subreport, and return it to my main report. Base on this number returned, I've successfully suppress subreports conditionally.

Thanks!
 
See my post in your other thread. If you use a reset formula in the main report for the subreports, any empty subreport will result in a 0 value for number or currencyvars, or a "" for strings. You can then test the value in a formula, e.g.:

whileprintingrecords;
shared numbervar x;
if x = 0 then {table.amt} else x

-LB
 
you are right! i didnt think of that then cos i had a problem resetting the shared variable value then.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top