>Hello Group.
>
>I would like to make a report from a cursor. I ran Select * from transdata into cursor temp. The temp cursor showed up on the data session window and I was able to browse it.
>
>I opened up the report designer in manual mode and placed a field textbox on the report. I opened the expression builder and there where no fields from the temp cursor there when I typed in temp.tcname and tried to run the report I got tcname variable not found.
>
>How do I run a report from a cursor. My goal here is to create a report from a SQL Back end without using odbc.
>
>Thanks
>Jim
Hi Jim :)
This little cheat can do the trick ;
1. While in development mode, simply copy resulting sursor
into temp.dbf on your harddisc
e.g.
select blah,blah,blah into cursor temp
copy to temp
return
(!) Long field names will be cut off
to 10 Chars in resulting free table.
2. Then using report builder create ordinary report (frx) using this way created free table \whereveritis\temp.dbf added to it's dataenvironment.
You will be able to use all report builder advantages like drag&drop, preview etc etc
Upon finishing building report frx, you simply switch off
dataenvironment by setting it's properties
.AutoOpenTables=.f.
.AutoCloseTables=.f.
(!) Correct long field names if you hv any.
3. After that in your code you simply take off
'copy to' line and put appropriate report form line.
Like
select blah,blah,blah into cursor temp
*copy to temp
report form myreport.frx to printer ...
.
.
Report should work just fine :)