-
1
- #1
Mike Lewis
Programmer
Over in thread184-1813451, we fount that a particular report problem arose because the report had the "Printer Environment" setting ticked (in the Report menu). This is usually undesirable. So the question arose of whether there was some automatic way of checking for this.
With that in mind, I put together this very simple program.
Please note the comment about it not guaranteed to be 100% correct. If anyone can improve it, please do so - in particular the line that begins with [tt]llClear =[/tt]
EDIT: I just noticed a possible mistake in the above code, which I have now fixed (indicated by the yellow highlight).
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Visual FoxPro articles, tips and downloads
With that in mind, I put together this very simple program.
Code:
* List the report files within the active project, with an indication
* of whether "Printer Environment" was ticked.
* NOTE: Absolutely no guarantee that this will work 100% of the time. It is based
* only on my attempts to understand the FRX structure, not on any
* documented behaviour. -- M.L. Jan '22.
* Create a cursor to store the results
CREATE CURSOR RepFiles (RepName c(32), EnvClear L)
oProj = _vfp.ActiveProject
FOR EACH oFile IN oProj.Files
IF oFile.Type = "R"
* This is a report file
USE (oFile.Name) IN 0 ALIAS CurRep
SELECT CurRep
llClear = (EMPTY(Tag) AND EMPTY(Tag2) AND AT("DEVICE", UPPER([highlight #FCE94F]Expr[/highlight])) = 0)
INSERT INTO RepFiles (RepName, EnvClear) VALUES (JUSTSTEM(oFile.Name), llClear)
USE IN CurRep
ENDIF
ENDFOR
* In the resulting cursor, EnvClear will be .F. if Printer Environment
* is ticked.
SELECT RepFiles
BROWSE NOWAIT
Please note the comment about it not guaranteed to be 100% correct. If anyone can improve it, please do so - in particular the line that begins with [tt]llClear =[/tt]
EDIT: I just noticed a possible mistake in the above code, which I have now fixed (indicated by the yellow highlight).
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Visual FoxPro articles, tips and downloads