>>>Long story - But the Fields listbox of the Expression Builder of the Report Expression window (wow!), will only show fields of tables in the data environment. I have a temp table that i want added to the data environment so that its fields will show in the Fields List Box.
>>>
>>>any ideas?
>>>
>>>thanks - brenda
>
>>With thisform.dataenvironment && It has one already ? If not createobject(DE)
> .addobject("myTempCursor","cursor")
> .myTempCursor.CursorSource = dbf("crsTemp") && crsTemp is temp cursor
>endwith
>
>>Cetin
>
>I want to add a cursor (maybe a table built from the cursor fields) to the dataenvironment of a report, not a form. Tried getting your code to work but had no luck.
>
>in the command window
>
>select * from testtable into cursor mycursor
>create report myreport from mycursor column
>modi report myreport
>
>** now the report designer is up. is there automatically a dataenvironment associated with myreport? or must i add one? if i have to add one, what is the code?
>
>report5.dataenvironment.addobject("tempcursor", "cursor")
>** "object report5 not found" is the error message
>
>really lost on this one. any help is appreicated.
Brenda,
You can add it automatically if you select into a temp table and later erase it. But it has the problem user also adds alias to new fields. Next time you would need to process frx programmatically to remove aliases. Yet there is another better way but fields show in memvar list (advantage you use unaliased expressions) :
select * from ;
home()+"samples\data\customer" ;
where Contact = trim(thisform.text1.value) ;
nofilter ;
into cursor (lcCrs)
scatter memvar blank
modify report myreport
report form myreport preview
Cetin