Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
I need your help!!!
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00110183
Message ID:
00110188
Vues:
20
Hs,

Does the data from the sub-file need to be formatted where the columns that need printing to be aligned seperately?

If not, you can just add a text field to the report and make it wide, then make sure to check on the property to allow strech with overflow. Then have the value that it prints be a UDF(). ex:MyDetails(). Then in this function you can select the next work area and build a string of the desired fields... and return just the text value. Be sure to re-select the original work area though.

ex:
function MyDetails()
lnSelect = select()
select otherdata
lcText = ""
scan for sub_detail_condition
  lcText = lcText + Fld1 + chr(13)
endscan

select( lnSelect )
return( lcText )
If you need fields seperately in their own columns, I would suggest building a preliminary cursor to hold the original data fields add allow more fields to the cursor to hold the "extra" fields that need to be printed for the sub-details. Have one final field to identify that "this record is for sub-details".

ex:
select fld1, fld2, fld3, fld4,;
       space(10) as sub_fld1, 00000.00 as sub_fld2,;
       space(30) as sub_fld3, .F. as IS_DETAIL;
  from MainTable;
  into cursor TmpReport

*/ Now re-open as updateable cursor
use (dbf()) again alias TmpReport2 in 0

*/ Now scan through and add any necessary details
select TmpReport2
scan
   */ Keep current key field for grouping...
   CurKey = TmpReport2.fld1

   select otherdata
   scan for sub_condition
      insert into TmpReport2 ( fld1, sub_fld1, sub_fld2, sub_fld3, is_detail );
         values ( CurKey, otherdata.fld1, otherdata.fld2, otherdata.fld3, .t. )
   endscan

   select TmpReport2
endscan

*/ Now build an index keeping whatever key field grouped together
index on fld1 tag tmptag1

*/ Now run the report
report form ...
Now, just add your extra fields to the report with the "Print When" = IS_DETAIL.

Hope this helps you proceed.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform