Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
REPORT FORM TO FILE xxx ASCII discovery
Message
De
14/02/2006 11:50:25
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Titre:
REPORT FORM TO FILE xxx ASCII discovery
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01096211
Message ID:
01096211
Vues:
75
I think I found an answer to the age old problem of mangled columns when using REPORT FORM TO FILE xxx ASCII.

In summary, the fields have to be stored in FRX in right to left order. Here is code to do that.
lcFileFrom = 'reports.bak\xxxx.frx'
lcFileTo   = 'reports\xxxx.frx'
SELECT *,SPACE(13) AS cOrder ;
  FROM (lcFileFrom) ;
  INTO CURSOR Temp READWRITE

REPLACE cOrder WITH '1'+TRANSFORM(RECNO(),'@L 999999') FOR INLIST(ObjType,1,2,3,4,9,10)
REPLACE cOrder WITH '2'+TRANSFORM(999999 - HPos,'@L 999999') FOR INLIST(ObjType,5,6,7,8)
REPLACE cOrder WITH '3'+TRANSFORM(RECNO(),'@L 999999') FOR ObjType > 20

SELECT * ;
  FROM Temp ;
 ORDER BY cOrder ;
  INTO TABLE (lcFileTo)
USE

ALTER TABLE (lcFileTo) DROP COLUMN cOrder
USE IN (JUSTSTEM(lcFileFrom))
USE IN (JUSTSTEM(lcFileTo))
USE IN Temp
Alex
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform