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!

Recognising number of rows returned from an SP

Status
Not open for further replies.

ianholmes

Programmer
Mar 24, 2001
61
GB
I have XI.
My rpt accesses an SP to retrieve the data set.
I need to suppress a detail line if there are no rows returned from the SP.
This detail line contains a text field from the SP, and a drawn box.
When there is no return from the SP, I still get the detail line with the box, even though I use Section Expert : Suppress (No drill down), and set a formula to suppress the line if isnull(text). This is obviously insufficient for when there are no rows.

Can I setup a formula that will store the number of rows from the SP, so that I can test against a value of zero ?

Or is there a better way to achieve what I need ?

Many thanks
 
Use IsNull to check a field returned by the SP. Suppress the unwanted sections when it is null. Maybe also have another section saying No Rows Returned that is suppressed when the field is not null.

For selective suppression, right-click on a section and choose Section Expert. Then choose the formula icon (x+2 and a pencil) for suppression. Enter a formula.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thanks for your help Madawc.
My problem is I don't know how to build the formula to identify when the SP returns no rows.
 
Your original solution should work:

isnull({table.string})

Make sure your box is entirely within the section on which you are adding this suppression formula.

-LB
 
I did test this by drawing a box in the detail section. Maybe try using a different field for the test--one that is found in every row, like a unique ID. Also go to file->report options and make sure you do not have "convert nulls to default values" checked.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top