Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Percentage calculation in expression of report
Message
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00588031
Message ID:
00588236
Views:
34
Glad, I can help.

I'm working on some application now, which is supposed to be simple, but I'm working on three days already and it still doesn't behave, as it should :(

For instance, here is the peice of code, which I can not make to work correctly.

The idea is to check for gaps between two days and report them excluding weekends and holidays. What's wrong with this code or how it should be changed?
* -- Checking for missing data compared against last data received
* -- Check for Friday or Saturday for old and new is Monday date then we're not missing any data
		if (dow(Record_fm)=2 and Record_fm - PriorRec_To > 3) ;
		    or (dow(Record_fm)<> 2 and Record_fm > PriorRec_To+1) 
			tmpDays = Record_fm - PriorRec_To
			if m.tmpDays > 1
				for i = 1 to m.tmpDays-1
* -- Check against holiday for each missing record && Sundays & Saturdays
					if dow(PriorRec_To+m.i)<>1 and dow(PriorRec_To+m.i)<>7 ;
							and !seek(PriorRec_To+m.i,'Holidays')
						lcTempStr = "May have Missing Recorded data for "+ dtoc(PriorRec_To+m.i)+"."
						if not m.lcTempStr $ m.tmpNotesStr
							tmpNotesStr = iif(empty(m.tmpNotesStr),'',m.tmpNotesStr+chr(13)) + m.lcTempStr
						endif
						llMDFlag = .t.
					endif			&& Missing Data
				endfor				&& Going to the next date to check for missing data
			endif
		endif					&& Checks for Fri or Sat and Mon
>Thanks Nadya. I think I understand the idea now. Coding can get really complicated for me sometimes as it's hard to visualize how to put things in the correct place.
>Thanks again!
>Max
>
>> You still can use variable. Give this variable sum of each field (either in expression window or as a result of function call).
>
>> If you need sum of this value, just put the same field in the summary band, but check Sum in calculations. If you need to use this Sum in some sort of calculations, you would need another report variable, which would be the same, as normal variable, but with Sum checked.
>
>> Does it clarifies or confuses more? :)
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform