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

Balnk Rows if condition fails

Status
Not open for further replies.

coolbabe2007

Programmer
Apr 19, 2007
5
0
0
GB
Hi,

I am developing a new report. My report has a field, which is a calculated field. The filed name is TotalDays and this is calculated based on other fileds. I have done he caculation of this filed in Onrow() of DataRow by decalaring a filed as Total Days. I am fetching in the Fetch(). However, I have a condn in Fetch() method such hat the Total Days should be more than 670. Now my returns blank rows if this condn fails. Please let me know, what should I do.

Thanks in Advance.
 
I guess then, that you have 'filled rows' where the value >= 670 and blank where it isn't.
I would think that you have to exit the fetch, and bring the next row where your conditions fails. This should stop it writing a blank row
or
in the frame Sub OnRow method, if the condition fails, set size.height to 0 (zero)
 
Yes you are correct. Actually, I have already included an line exit when the condition fails but still its the same. I have pasted the fetch method below. Let me know, if I have added some more lines of code. Also, as you said, if I set the frame width to zero if the condition, then I think the othe rows may get affected. Because I have to omit only the particular row which is disaplayed as balnk if the condition fails and rest should be dispalyed.

Function Fetch( ) As AcDataRow
Set Fetch = Super::Fetch( )
' Insert your code here
Dim row as DataRow2

If Contractorswithin60days::param_servicedays = True Then
Do
Set row = Super::Fetch( )
if row is nothing then
Exit Sub
End if
Loop Until row.TotalDays > 670
Else
if row is nothing then
Exit Sub
End if
End If

Set fetch = row

End Function


where param_servicedays is a user parameter, datatype being boolean. Only if it is true, I have to check whether the days is more than 670 and display rows which has more than 670. else I have dispaly all the rows irrespective of number of days.
 
Loop Until row.TotalDays > 670
Isn't this stopping the loop when at > 670, so that anything less than is the only rows 'displayed'?

Also, your not in a Sub Method, so you probably can't exit sub. You would have to be in Sub OnRow. Perhaps it should be Exit Fetch
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top