Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFp 6 Using a case statement in a report field
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00339722
Message ID:
00339891
Vues:
18
>>>I created a .prg called "secorder.prg" with this code:
>>>do case
>>>case section = "A"
>>>store "Mares Foaled" to msection
>>>case section = "B"
>>>store "Mares Bred" to msection
>>>case section = "C"
>>>store "Vet. Report" to msection
>>>case section = "D"
>>>store "Absentees" to msection
>>>otherwise
>>>store " " to msection
>>>endcase
>>>
>>>Then I added a variable to my report form called "msection" and made the 'value to store' = secorder()
>>>
>>>After testing it appears that I need to add two fields to my report form, one for msection, and one for secorder().
>>>
>>>If I don't, instead of seeing "Mares Foaled", "Mares Bred", etc., etc., I get .t. as the value on the report.
>>>
>>>Do I need to keep both fields on the report? I could move the field containing secorder() in the expression to the side, as it's the one showing ".t." as its result, and make it narrow so the .t. doesn't appear to noticeable, but that's not really the best solution.
>>>
>>>Am I still missing something?
>>>
>>>Thanks,
>>>
>>>Jim
>>
>>Have your UDF return the value to display in the field. This eliminates the need to do anything about the .T. or trying to display a variable.
>
>
>Fred,
>
>Please bear with me, but I guess I don't know how to do this. Could you explain further on how I get the result of the secorder.prg to display in the field.
>
>Thanks for the help.
>
>Jim

Put a "RETURN msection" at the bottom of your UDF. Now in your report expression, you put "secorder()" and size it as big as it needs to be.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform