You can get at the clipboard data that's available if you copy a selection of form controls to the clipboard.
But I doubt you get happy with it, i.e. it takes a lot of work to transform the clipboard data you get from copying a selection of form controls vs the data you need to paste into a report.
If you copy form controls you get records that are in the same structure as records of an SCX or VCX form or form class.
If you copy from a report you get records that are in the same structure as records of an FRX report.
Try it yourself:
Step 1:
Execute this line by line in the command window
Code:
CD Home()
Set Library To Foxtools.fll
? OpenClip(0) && should be .T.
Step 2:
After doing this, open the form, select all form controls and copy them with CTRL+C. You can optionally cCeck, whether you have all controls by creating a new form and use CTRL+V to paste what you have in the clipboard.
Step 3:
execute this line by line in the command window
Code:
nFormat = EnumClipFm(0)
? nFormat && should be something in the range of 50000
? GetClipDat(nFormat) && should be a TMP file
USE (GetClipDat(nFormat)) Alias clipdata && only works, if GetClipDat(nFormat) is a TMP file, which is a DBF.
? CloseClip()
Browse
You should see data in the same structure as SCX/VCX. You can look into the Objname and Properties memos to find the object names (like label1, label2, etc.) and their properties (top,left,width,height, caption etc.)
Now you would need to translate this into the structure of FRX records of report labels and report fields. The task starts at finding out how to translate top,left,width,height into report control positions and sizes, which are stored in the records of an FRX.
The same code and steps 1-3 also work, if you open a report n step 2 and copy report controls into the clipboard. The clipdata workarea will then have the data structure of an FRX.
If you're willing to write a data transformation for that you could reuse it and program a tool that can transform clipboard data of a form to clipboard data of a report or vice versa and then perhaps even paste that, but I stopped here after finding out how to get at the clpboard data. It's less work to redo the form layout in a report for one form-to-report conversion. What Rajesh told you, will help you get all table fields into a report quickly, so you only have to arrange the labels and fields.
Chriss