>Hallo Cetin,
>
>thanks for your help. Unfortunately I think, "set fields" is too strong: in my case I have a timer that fires every 500 ms and checks for some values in certain fields. Now as soon as I "Set Fields To" these fields are not more available for the timer and it "cries".
>
>I can also imagine some other circumstances (refreshes in background forms and so on) that will prevent the "Set Fields To" - idea from being a universal method. Another problem by this approach is that the active workzone is not always involved in the grid - in this case I get an empty fieldlist.
>
>What I actually want is to make a 1:1 copy of any given grid in Excel. In the best case it must be a method of my grid-class. I thought it could be probably easier to first copy the entire grid to clipboard or something like that.
>
>Has really noone wanted it already?
No one wanted :)
On the long run you can't have a 1:1 copy of a grid in anyways in Excel. Excel is not capable of doing that (not yet at least).
set fields to still would work for what you want. ie :
Set Fields global
Use customer
Use orders In 0 order tag cust_id
Use orditems In 0 Order tag order_id
Set relation to cust_id into orders
Set relation to order_id into orditems in 'Orders'
Set Fields to cust_id, company, orders.order_id, ;
orders.order_date, orditems.line_no,;
orditems.product_id,orditems.quantity,;
orditems.unit_price,;
Price=orditems.quantity * orditems.unit_price
Set Skip to orders, orditems
Copy To myCheck.txt type csv
_cliptext = FileToStr('myCheck.txt')
You could loop and use controlsources (if you need you could create and do that in a private session too).
Cetin