select cust_id, Company, .t. as 't1' ; from customer ; where cust_id = 'B' ; into cursor tablo1 nofilter afields(arrT1) && Save Structure select order_id, emp_id, order_date, order_net, .t. as 't2' from orders ; where cust_id = 'C' and order_date < {^1994/07/01} ; order by cust_id, order_date ; into cursor tablo2 nofilter afields(arrT2) && Save Structure select emp_id as 'employeeId', first_name, last_name, .t. as 't3' ; from employee ; into cursor tablo3 nofilter afields(arrT3) && Save Structure dimension arrNewStruc[alen(arrT1,1)+alen(arrT2,1)+alen(arrT3,1), alen(arrT1,2)] acopy(arrT1,arrNewStruc,1,-1,1) acopy(arrT2,arrNewStruc,1,-1,alen(arrT1)+1) acopy(arrT3,arrNewStruc,1,-1,alen(arrT1)+alen(arrT2)+1) create cursor myCursor from array arrNewStruc append from dbf('tablo1') append from dbf('tablo2') append from dbf('tablo3') browse && Check what cursor holdsHere unrelated records from customer, orders and employee are selected just to show fake cursor creation. Notice that in each select there is an extra logical .t. field (as 't1', 't2', 't3'). That serves as the grouping expression. It's only true for the table where content should be printed. In report you use as a 'print when' expression. Put fields from all 3 tables overlapping (you'd want to design as separate detail lines then group fields). It's a little cumbersome to create report layout but works nice (IMHO). Superior to other approaches as you aren't forced to monotyped fonts to provide column layout. BTW here in this sample fields were few to fit in a single cursor. You might as well select into different cursors and have one fake cursor keeping relations to those cursors. Its structure woud be somethin like :
create cursor myDummy (RepField m) insert into myDummy values (GetText()) function GetText lcTempFile = sys(2015)+'.tmp' set textmerge delimiters to '%','%' && Just for the sake of HTML tags here set textmerge on set textmerge to (lcTempFile) noshow select FirstDetail \My First Header \%padr('MyHeader',fsize('myField1','FirstDetail'))% \\ %padl('MyNumHeader',len('999,999,999.99'))% scan \%myfield1% \\ %transform(myNumField,'@Z 999,999,999.99)% endscan \MyFirstFooter \MySecondHeader *.... set textmerge off set textmerge to handle = fopen(lcTempfile) lnSize = fseek(handle,0,2) =fseek(handle,0,0) lcContent = fread(handle,lnSize) =fclose(handle) erase (lcTempfile)And another approach is to use word automation or execl automation.