Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update REPORT Form (.FRX) problem.
Message
 
 
À
03/06/2010 23:49:32
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01467289
Message ID:
01467291
Vues:
32
Your code will only work if the report is external to your project and the files are not readonly.

It is much better to copy the report to a temp file and update the temp report instead of your actual report.

>Hi,
>I have a procedure to change the report form's print out page size,
>when I update ther report form, it occurs an error message that
>the cursor RPTFRM is read only, cannot update.
>
>why ? please advise.
>
>Thanks.
>
>
>DO SETPAPERSIZE WITH "C:\WTS\MID\PRNINV2.FRX",128
>REPORT FORM c:\WTS\MID\prninv2.frx TO PRINTER NODIALOG NOCONSOLE
>
>
>************************************
>* SETPAPERSIZE.PRG
>************************************
>LPARAMETER lcFRX, lnPapersize
>LOCAL lcNewExpr, lnStartCopiesLine, lcStartAtCopiesLine, lnEndCopiesLine, ;
>	lnLenCopiesLine, lcTop, lcBottom
>#DEFINE vfCRLF CHR(13) + CHR(10)
>IF !(UPPER(RIGHT(lcFRX, 4)) = ".FRX")
>	lcFRX = lcFRX + ".FRX"
>ENDIF
>
>USE (lcFRX) IN 0 ALIAS rptfrm
>SELECT rptfrm 
>LOCATE FOR objType = 1 AND objCode = 53
>
>IF EMPTY(EXPR)
>        lcNewExpr = "PAPERSIZE=" + ALLT(STR(lnPapersize)) + vfCRLF
>ELSE
>        lnStartCopiesLine = ATC("PAPERSIZE", EXPR)
>        lcStartAtCopiesLine = SUBSTR(EXPR, lnStartCopiesLine)
>        lnEndCopiesLine = ATC(vfCRLF, lcStartAtCopiesLine)
>        lnLenCopiesLine = LEN(SUBSTR(lcStartAtCopiesLine, 1, lnEndCopiesLine))
>        lcTop = SUBSTR(EXPR, 1, lnStartCopiesLine - 1)
>        lcBottom = SUBSTR(EXPR, (LEN(lcTop) + lnLenCopiesLine))
>        lcNewExpr  = lcTop + "PAPERSIZE=" + ALLT(STR(lnPapersize)) + lcBottom
>
>ENDIF
>SELECT rptfrm
>DO WHILE !RLOCK()
>ENDDO
>REPLACE EXPR WITH lcNewExpr
>UNLOCK
>SELECT rptfrm
>USE IN rptfrm
>
>
>Thanks.
>Derek
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform