Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
REPORT FORM TO FILE xxx ASCII discovery
Message
 
 
À
14/02/2006 11:50:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01096211
Message ID:
01096222
Vues:
22
Alex,

I think, reordering can be done in one select
SELECT *, ;
	ICASE( INLIST(ObjType,1,2,3,4,9,10), '1'+TRANSFORM(RECNO(),'@L 999999'),;
			INLIST(ObjType,5,6,7,8), '2'+TRANSFORM(999999 - HPos,'@L 999999'), ;
			'3'+TRANSFORM(RECNO(),'@L 999999')) ;
				AS cOrder ;
  FROM (lcFileFrom) ;
  ORDER BY cOrder ;
  INTO CURSOR Temp READWRITE
>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
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform