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!

Formula based on empty or populated sibling suberport

Status
Not open for further replies.

ChristianWhite

Programmer
Jun 14, 2004
41
US
Assume a main report with subreports 1 and 2. For a given set of parms, if sub 1's stored procedure returns no resultset, I would like to suppress subreport 1 and renumber the text-box caption of sub 2, which can use a formula, as sub 1.

Is there a method available to discover sub 1 is empty?
 
You should be able to create a shared variable in the sub1:

whileprintingrecords;
shared stringvar x;

if isnull({table.field}) then
x := "" else
x := {table.field};

Place this on the subreport.

Then in sub2, use a formula like the following for your caption:

whileprintingrecords;
shared stringvar x;

if x = "" then "Sub 1: Your Caption" else
"Sub 2: Your Caption"

-LB

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top