DESCRIPTION: Report Generator for VFP + MS Word, creates RTF/HTML files, loads in MsWord®, has filter condition for select from data, Composite reports, Grouping, VFP context Macro in MsWord document,
MacroProcedures, enters Heads & Foots right in MsWord, page style settings, wide table splitting, shared access to common reports, samples based on Tastrade tables.
Here You can download necessary files (updated oct 30 2001) :
Report Generator for your's VFP 6.0 applications (2000k)
Report Generator Source Code
How to obtain the 8 or 10-byte Time-Stamped Unique value GUID (primary key) 14k
Some usefull VFP functions for RTF text coding (funcrtf.prg 28k)
Technical notes:
Alternative Report Generator (Designer + RTF Compilator) for VFP applications with automated MS Word output. Fully functioned universal powerfull solution. To be built in your application as a 1.7mb "behind the scene" APP module. Powered by built in UNIVERSAL MULTISELECT HIGHLIGHTED GRID (Sort, Key Search, Incremental Search, Find_and_HighLight Select, Replace in HighLighted, AutoReferences, Scrolled Record Form, RunTime Save/Restore for Columns/Sort/Form_Size properties, 8-byte Absolutely Unique GUID AutoPrimary Key, Semaphore Multiuser Record/Object Lock, etc.). Can be used as a Dynamic HTML-pages Generator for IIS. Charge free. Full source code.
Generator allows to design report form and execute it. As a result RTF/HTML files are generated and loaded in MS_Word/Ms_Viwer.
This solution resolves difficult report form task due to the next flexible methodological model - user report can be defined as a set of:
1)Ordinary report,
2)Macroprocedure report (named user's run-time procedure),
3)CrossTable report (based on cross table with variable number of N_columns),
4)Composite report, as a container of 1,2,3 aboved ordinary report types.
For a Macroprocedure report (2) special author's macrointerpretator with IF_ELSEIF_ELSE_ENDIF, DOWHILE_ENDDO support is used. It allows to run any external programms, native VFP reports, visual forms, commands and functions. Up to 4000 chars in macro expression is avialable due to recursive macro evaluator (standard &cText has a 256 chars limit).
Internal Visual means and VFP-context codes in Event Methods, Word document Bodies and Macros provide wide and flexible range of solving tasks - from simple ones up to cool.
ORDINARY report is selected from source table and consist of :
Body (Table or a Card forms chain for every record),
Common Head and Foot,
Five level SubHeads and SubFoots,
Ten Event Methods (user procedures for any report building event) .
Heads, Foots and Card Forms should be design in MS Word (or RTF box), using:
1)MacroText - expression, returning text (like function). Evaluated text is
inserted in document instead of {Macro}. In Macro You can use RTF code like:
{\b\i BoldItalicText \plain)} , {IIF(cVar,"\par","")}.
2)MacroCommand - (like procedure), started with ampersand character: {&.....}.
Macrocommand is just executed: {&Messagebox("Hello, world")}.
In macro You can use any legal VFP expressions, functions, variables and fields.
Additionaly, MacroCommands may contain any of next control words:
IF _Cond_
ELSEIF _Cond_
..EXIT
..BREAK
ENDIF
DO WHILE _Cond_
..LOOP
..EXIT
..BREAK
ENDDO
IF_ENDIF and DO_ENDDO can handle text output in Word document like:
Text head:
----------------
{&IF RapTmp.Sign>0}
Debet receipt text ...
{&ELSE}
Credit receipt text ...
{&ENDIF}
The result for RapTmp.Sign>0 will :
Text head:
--------------
Debet receipt text ...
Also You can issue this construction in one string like:
Text head:{&IF RapTmp.Sign>0} Debet=.. {&ELSE} Credit=.. {&ENDIF}
And the result for RapTmp.Sign>0 will :
Text head: Debet=..
Controlling Macro allows to use IF_ELSEIF_ELSE_ENDIF, DOWHILE_ENDDO nested constructions and RTF tags like {/b/par} to control and format Word text output in resulting RTF document. RTF-modules Join and Macrointerpretator author's alghorithms are used in.
Ordinary Report document is based on SQL-Select from user source table.
This selected table is a "work horse" of report designer (with RapTmp alias, so You apply to it's fields as RapTmp.SomeField). Nevertheless, You can apply to native source fields, if You set on [Scaning] switch in [Settings] page. Selected group parent table in composite report is named as GroupTmp, so You apply to it fields as GroupTmp.Field.
Before report build, You can call some dialog form for getting
parametrs or executing macroprocedure, preparing tables and variables,
etc. Do it in LOAD method. After report is built, the UNLOAD
procedure is executed. Issued BREAK command in LOAD cancels report building and calling MS Word window.
Main features:
Select Filter Condition from source data.
Composite reports from ordinary ones chain.
Grouping, Sorting, Merging.
Five grouping levels.
VFP context Macros in MsWord document (evaluated and text controlled).
Heads and Foots designing right in MsWord.
HTML files compiles from RTF through MS Word converter.
Page Style settings.
Wide Table Autosplitting mode.
Whole Event Methods access.
A huge of user functions:
GUID() - Global Unique Identifier GUID generator,
SemLock(), SemUnlock(), SemLocked() - Semaphor multiuser locks,
CallTab() - Universal Multifunctional Highlited Grid function,
etc.
Attached Examples of report forms are based on well known Tastrade tables. Full source codes and project are avialable as opened information.
App module and source code are located on the next servers:
www.dbrad32.narod.ru/eng/dbe.htm
www.dbrad32.narod.ru/eng/dbe.htm
Report Generator is an external part of DBRAD32 project (Universal Application Engine)
DBRAD32 is an abbreviature of "Data Base Rapid Application Development for Win32".