Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grade com alinhamento numérico a esquerda.
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00632104
Message ID:
00634125
Views:
17
Fabiano,

Somente hoje (18/03) eu fui aplicar isso ao programa original. E para minha surpresa não funcionou... :(
Mas como já havia identificado o problema acabei conseguindo resolver da seguinte forma:
With loForm.Grade
	.Width = 650
	.Visible = .T.
	.RecordSource = ""
	Set Safety Off
	Select * From MyTable Into Table MyCursor
	Set Safety On
	.RecordSource = "MyCursor"
	.ColumnCount = -1
	.ColumnCount = 4
	With .Column1
		.ControlSource		= "Field1"
		.InputMask		= "9,999"
		.Width			= 100
		.Header1.caption	= "1"
	EndWith
	With .Column2
		.ControlSource		= "Field2"
		.InputMask		= "999.99"
		.Width			= 100
		.Header1.caption	= "2"
	EndWith
	With .Column3
		.ControlSource		= "Field3"
		.InputMask		= "999,999,999.99"
		.Width			= 100
		.Header1.caption	= "3"
	EndWith
	With .Column4
		.ControlSource		= "Field3"
		.InputMask		= "999,999,999.99"
		.Width			= 100
		.Header1.caption	= "4"
	EndWith
EndWith
DoDefault()
loForm.Grade.Column4.ControlSource = "Round(Field2 * Field3,2)"
Observe o DoDefault() antes de atribuir o valor a coluna. Se eu colocar o comando com o "Round(...)" acima desta linha, o erro continua a aparecer. Se eu colocar depois (como no exemplo) o problema não acontece...

Enfim: Resolvi o problema, mas precisei "simular" um campo numérico antes de atribuir a expressão a coluna (veja na coluna 4 que eu deixei apenas o FIELD3 e somente após o DoDefault() eu atribui o valor correto a coluna que seria a quantidade * valor unitário!

[]s
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Rodolfo Duarte
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform