Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
No table names, Please!
Message
From
27/01/2004 13:51:25
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00869464
Message ID:
00871063
Views:
17
>>>Unfortunately ... there's nothing you can do to enable that option. I reported it as a bug a while back but it hasn't been fixed. You just have to strip out the table names for every field.
>>>
>>>Sorry!
>>>Cathy
>>>
>>>
>>>>I am using Vfp v8.0 SP1 and do not know how to suppress table names from the expression builder and drag and drop from the data environment. The radio button is dimmed and not available in the expression builder.
>>
>>The _getexpr system variable can be set to point to your .prg, and I was doing similar tricks already. For Glenn's case, something like this:
>>
>>
* _getexpr points to this little .prg, save it
>>lcSaveGetEx=_getexpr
>>* set it to point to default VFP expression builder
>>_getexpr=""
>>getexpr to lcTemp
>>* clean the current alias from the expression, keep other aliases
>>lcTemp=strtran(lcTemp, alias()+".", "",-1, -1, 1)
>>* restore for next call
>>_getexpr=lcSaveGetEx
>>return lcTemp
>>
>>I've written a few little prgs like this, and in some cases the purpose was to see the dataenvironment while editing a report. The trick was to set the datasession before the GETEXPR command, and to restore it afterwards, so the expression builder would see all the tables. I used to store it in a custom property of _screen, as soon as I had all the cursors ready, Set Datasession to _screen.nds, GETEXPR, Set Datasession to nSaveDS. Worked perfectly.
>
>I would only recommend one little enhancement:
>
>lcSaveGetEx=_getexpr
>* set it to point to default VFP expression builder
>_getexpr=""
>getexpr to lcTemp
>* clean the current alias from the expression, keep other aliases
>*****lcTemp=strtran(lcTemp, alias()+".", "",-1, -1, 1)
>if at('.',lcTemp) > 0
>    lcTemp = JUSTEXT(lcTemp)
>endif
>* restore for next call
>_getexpr=lcSaveGetEx
>return lcTemp
>
>
>Thanks Dragan, I will add this to my bag'oTricks.

You're welcome.

I'd advise against this enhancement (no matter how much of a soft spot I have for the functions originating from FoxTools) - if lcTemp contains anything more complex than just alias.field, you may get a very wierd and invalid expression. Just try it with "Alltrim(user.firstName)+' '+alltrim(user.lastname)", and you'll get "lastname)".

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform