Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
REPORT FORM TO FILE xxx ASCII discovery
Message
De
14/02/2006 18:24:07
 
 
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:
01096371
Vues:
23
Yes, that is more compact and elegant Sergey.

Until recently I have kept reports in FPDos format from where they came, which allowed fast printing with dot matrix printers. I created a report viewing form that uses REPORT FORM TO FILE xxx ASCII and shows the result in a RTFBox and allows search and partial printing from there. I like it because it executes very fast and works.

Since most clients only use matrix printers for multipart forms these days, I moved reports to VFP8 format and am trying to modify the viewing form accordingly. By reordering fields in FRX one problem is solved but REPORT FORM TO FILE xxx ASCII sometimes combines two lines into one. That can be addressed in turn by increasing _ASCIIROWS but then the printed pages don't correspond with the screen pages. I am trying to avoid changing _ASCIIROWS by ordering fields in FRX a little differently, buy haven't suceeded yet.

Alex


>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform