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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditionally adding rows to the report. Very Urgent!

Status
Not open for further replies.

caster

Programmer
Jan 3, 2003
32
IN
Hi All;
In my report I've written logic in the fetch method to process the data. This processing is done based upon a count whihc is calculated in the Fetch methosd itself. What I want to do is if this count is zero then that row should not be added to the report. I tried id like following:

If NetPresentCount > 0 Then
Set Fetch = Row
AddRow(Fetch)
Else
Set Fetch = Super::Fetch()
End If

But seems like it is not working. The row for which the count is zero are getting displayed on the report.Any suggestios regarding this?
Or Can any one tell me how to delete the rows that are going to appear on the report?

Bye
Cas

 
Hi Cas,

The way I would handle this would be to first declare a new datarow variable:

dim aRow as DataRow 'the name of your report's datarow

Then use a loop; if you want the row, pass it thru. If not, simply do not Fetch the record and loop:

Do While True
Set aRow = Super::Fetch()
If aRow is Nothing Then
Exit Function
End If

If NetPresentCount > 0 Then
Set Fetch = aRow
Exit Function
End If
Loop


Hope this helps.

Bill
 
Hi Bill;
Thanks for your invaluable suggestion!
Any way I've done it in some other way and following is how I did it. I will really appreciate your comments on it.

If NetPresentCount > 0 Then
Set Fetch = Row
AddRow(Fetch)
Else
Set Fetch = Me::Fetch()
End If

Thanks
Cas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top