Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Knowing the last record in the detail line
Message
De
21/05/2003 17:01:55
 
 
À
21/05/2003 16:42:46
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00790979
Message ID:
00791361
Vues:
22
This message has been marked as a message which has helped to the initial question of the thread.
Renoir,

Are you printing from a report cursor? I'd make the report cursor a read/write cursor, with an additional field (a logical field). Before printing the report, make a pass through the data and set the flag to .t. for those you want to be red.

This is just an example...you should have an additional field to order on so that the last record of each date has some real meaning.
* easiest way might be to go backwards through the cursor
* this is not thoroughly tested
select date, amount, .f. as redFlag ;
	from table1 order by date ;
	into cursor reportTemp


** if using VFP7 or later, add READWRITE clause to the above SELECT,
** and remove the following 5 lines....
if used("reportCursor")
	use in reportCursor
endif
use dbf("reportTemp") alias reportCursor in 0 again
select reportCursor
***********  end of optional VFP6 code

goto bottom

ldDate = reportCursor.date

if amount < 0
	replace redflag with .t.
endif
skip -1
do while not bof()
	if ldDate <> reportCursor.date and amount < 0
		replace redflag with .t.
	endif
	ldDate = reportCursor.date
	skip -1
enddo
>Let's say I have a table with 5 records:
>
>Date Amount
>========== ==========
>05/19/2003 987.65
>05/20/2003 1234.56
>05/20/2003 -7890.12
>05/20/2003 -99.99
>05/21/2003 5678.90
>
>I want to be able to identify that the -99.99 value is negative or not. I will then use the PrintWhen to display it as red. I do not want the -7890.12 to be red. It is only the last record for that date that should be evaluated. The very little bit that I unsucessfully tried using variables and groupings really isn't an issue here. What I tried didn't work and I was looking for other solutions.
>
Steve Gibson
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform