Ek RTF Report for Delphi
Version 3.12 (Win32)


CONTENTS
1. Component description
2. History
3. License
4. Installation
5. Troubleshooting.
6. Contact information

1. COMPONENT DESCRIPTION
TEkRtf report is non visual component that allows you to use all power of MS Word or other rtf-compatible editor
to create, preview, edit and print your reports.

How to use it:
- create report template in MS Word
- save it in RTF format
- place TEkRTF component on form, fill required properties
- prepare data in your application
- run report using one of Execute methods
- run MS Word (or other editor) if you want to view, edit or print your document

For more information see demo applications.
go top


2. HISTORY

Version 3.12

- Fixed the range check error, wich may appear in some minor cases.

Version 3.11

- Minor bugs fixed;
- Support for Delphi XE4 and XE5;

Version 3.10

- Unicode symbols support;
- DB Fields of type ftWideMemo are processed as text;

Version 3.09

- frtf() function improved for Word 2007 rtf tags;
- fixed bug in ROUND function when number of 0.005 could be wrongly handled;
- FileOpen mode is changed for InFile to fmShareDenyNone;

Version 3.08

- frtf() function improved in order to support new MS Word 2007 rtf tags;
- added additional support of tables rtf attributes to frtf() function;
- fixed bug with fdtm() function - format mask with comma raised an error;

Version 3.07

- Report commands were processed in a hidden shape results blocks of rtf document;
frtf() function:
- Fixed bug when inserted text was outside of the table on the next page of document;
- Some special characters were skipped in result document;
- If source rtf has smart tags, it was incorrectly inserted into result rtf;
- If source rtf has numbered list, it was inserted with wrong numbers into result rtf.

Version 3.06
- frtf() function inside a table. Fixed bug when inserted text was outside of the table in some editors;
- Msftedit.dll rich text control. Fixed bug whith incorrect color table in output document;
- DataSet, which name is one char length, was parsed as not existing alias name.

Version 3.05
- frtf() function improved in order to be compatible with Word 2003 rtf documents.

Version 3.04
- Fixed bug with incorrect color table in ftrf() function, when report was executed for the second time;
- Optimized behaviour of iif function;
- Iif function may be used inside \Scan...\ commands;
- New keyword \elsif\:
\if(...)\
\elsif(...)\
\elsif(...)\
\else\
\endif\
- New assigment operator :=, for example \a:=4\;
- New function pos(substring, string) the same as Delphi pos function;
- New option eoKeepFrtfPar. If set to True, ftrf() format function doesn't delete paragraph symbol in inserted rtf text.

Version 3.01
- Optimized code to make faster report compilation;
- Page breaks are not ignored inside inserted rtf text;

Version 3.00
- Created DataType property for report variables;
Variables previously created in design time will have data type "Unknown";
- New design time editor for report variables;
- Decimal separator for numeric constants in report template set to ".";
- Arithmetical operations and formulas in report template:
>, <, =, <=, >=, <>, != (not equal), +, -, *, /, % (mod)
- Logical operations and formulas in report template:
&& (and), || (or), ! (not)

Built-in report functions:

SET(VarName, Value) assigns Value to variable VarName
IIF(Condition, Value1, Value2)

Text functions:

str(Number,[optional length, optional decimals])
if length set to 0, but decimals<>0, result will be equal trim(str(...))
val(s)
upper(s), lower(s)
copy(s,startpos,[optional count]),
mid(s,startpos,[optional count]),
substr(s,startpos,[optional count])
trim(s)
formatfloat - the same as Delphi FormatFloat

Dataset functions:

eof, bof, last, first, next, prior
for example eof(a), next(table1)

Numeric functions:

round(n,decimals)
round is different from Delphi round function
here 0.5 is always processed to largest integer number
this is NOT banker rounding

int, frac
power, intpower

Date/time functions:

now, date, time, datetostr, datetimetostr, timetostr,
strtodate, strtodatetime, srttotime, year, month, day,

SYEAR(date)
string representation of year

SMONTH(date)
string representation of month
month<10 have zero in place of first symbol - 01, 02 and so on ...

SDAY(date)
string representation of day
day<10 have zero in place of first symbol - 01, 02 and so on ...

DTOS(date)
the result is string yyyymmdd

STOD(string)
converts string like yyyymmdd to date value

Version 2.02
fixed bugs:
- picture inserted trough the frtf() function was duplicated in output file;
- report generator didn't process MS Word fields inserted through the frtf() function;
- couldn't set UDFList property to nil;
- in some cases report executing status was "true" after exception;

Version 2.01
fixed bug when some fields with spaces in name didn't work.

Version 2.00
new construction \if(...)\ \else\ \endif\;
scan "while" keyword now works with report variables and data fields;
new formats: frtf() - for rich text fields, fbool() - boolean;
constants support: \True\ \False\ - boolean, {yyyy-mm-dd} - date constants;
new methods: CreateTmpFileName, CreateFileName;
symbol "." in field names in this version always considered as ":", scan blocks must be defined only with "scan-endscan" keywords;
new help, integrated with Delphi help system.

Version 1.85
new procedure InsertRTFMemoStream in the unit ekrtfstream
new procedure InsertRTFMemo in the unit ekrtfstream
double click on TEkUDFList component opens "Functions" editor window
fixed bug with scan while() function on skipping empty scan block

Version 1.82
fixed bug with fdtm() format and constant parameters with database fields
if dataset is on a eof position after OnScanRecord event, scan block skips the empty record
states of report datasets are returned back to EnableControls, if exception raised while processing the report

Version 1.81
format functions and user defined functions accept string and numeric constants as arguments
extended format of scan block with new keyword "while": \Scan(DataSet), While(UDF(...)), .... \ scan block terminated if result of UDF(...) is "false"
scan-endscan block works on a single line of text
new report template function VAR(var1, ..., varN) - creates variables var1 - varN if they don't exist
new option eoNumericFormatClearZero - deletes zero numbers in numeric formats output
fixed bug with output blob jpeg images
new method ShellOpenFile

Version 1.70
created new component TEkUDFList for user defined functions
new property UDFList in TEkRTF component
extended syntax of report template in according with UDF support

Version 1.62
fixed bug with incorrect exception in method SetTemplateBuffer

Version 1.61
more than 26 datasets support
fixed bug with FormatIndex=0 in event OnImageFormat

Version 1.6
new methods for manipulating with report variables: VarByName, ClearVars, CreateVar, FreeVar
extended format of scan block
new keyword \ScanFooter\
total and count functions sum(), ctn(), cts() for scan block commands
new format functions fdtm, ffixr, fnumr
properties DecimalRSeparator, DecimalRTerminator for using with "ffixr" and "fnumr" formats
new option eoDotAsColon
cached structure of dataset files

IMPORTANT: In this version option eoDotAsColon is True by default. It means that all field names like \DataSet.Field\ will be considered as \DataSet:Field\
If you use implicit cycles on MS Word table with field inside that has syntax \DataSet .Field\, you should replace it with \DataSet:Field\ and use keywords \Scan(DataSet)\ and \endscan\
If you still wish to use old (not reliable) method to make cycles, you must set option eoDotAsColon to False in corresponded EKRTF components.

Version 1.50
"noeof" option in "Scan" keyword \Scan(DataSet)[,page][,noeof]\ - scan block will be missed on eof of scanned dataset
new keyword \ScanEntry\
extended syntax for fields with spaces in names
optimized core of report engine
#11 will appear as "line break" control in output file,
#12 will appear as "new page" control in output file

Version 1.48
property ExecuteSuccessful (true if no errors)
property LastErrMsg (contains last error message if Execute report fails)
fixed bug with omitted exceptions
added additional checking to ExecuteOpen method

Version 1.47
"page" option in keyword \Scan(DataSet)[,page]\. Forces to begin new record of scanned DataSet with new page.
New extended syntax for field names: \DataSet:(NNN)\ , NNN is field number in DataSet.

Version 1.45
ExecuteStream method.
New format function flnk() - hyperlink format
ExecuteOpen works from console applications.

Version 1.42
Methods: SetTemplateBuffer, FreeTemplate.
go top

3. LICENSE
PLEASE READ THIS SOFTWARE LICENSE AGREEMENT CAREFULLY BEFORE USING THE SOFTWARE. BY CLICKING ON THE "ACCEPT" BUTTON, OPENING THE PACKAGE, OR USING THE EQUIPMENT THAT CONTAINS THIS PRODUCT, YOU ARE CONSENTING TO BE BOUND BY THIS AGREEMENT.

This license agreement covers your use of the EK RTF report components, its source code, documentation, dcu, bpl, dll and other files, hereinafter referred to as "SOFTWARE". You may use it and distribute it according to this following License Agreement. If you do not agree with these terms, please remove the SOFTWARE from your system.

SOFTWARE IS DISTRIBUTED "AS IS". NO WARRANTY OF ANY KIND IS EXPRESSED OR IMPLIED. THE AUTHOR WILL NOT BE LIABLE FOR DATA LOSS, DAMAGES OR ANY OTHER KIND OF LOSS WHILE USING THIS SOFTWARE. THIS PRODUCT IS FREE ONLY FOR EVALUATION USING.
YOU MUST REGISTER YOUR COPY OF THE SOFTWARE IF YOU USE IT IN REAL PROJECTS. THE EVALUATION VERSION OF SOFTWARE FILLS THE "AUTHOR" AND "COMMENTS" PROPERTIES OF OUTPUT DOCUMENT WITH INFORMATION ABOUT THIS PRODUCT. EVALUATION VERSION MAY ALSO HAVE SOME LIMITATION, DESCRIBED IN DOCUMENTATION OR README FILES.

The unregistered evaluation version of the SOFTWARE may be freely distributed, provided the distribution package is not modified.

You may not modify, disassemble, apply reverse engineering to the SOFTWARE.

You may Install and use the SOFTWARE for the purposes of designing, developing, testing, and deploying application programs which you create. However,your programs must add primary and substantial functionality, and may not be merely a set or subset of any of the libraries, code, packages or other files of the SOFTWARE;

You may not create a components, library or standalone executable application (whether it be freeware, shareware or a commercial product) which directly or indirectly competes with the SOFTWARE.

The registered SOFTWARE may not be rented or leased, but may be permanently transferred, if the person receiving it agrees to terms of this license. If the SOFTWARE is an update, the transfer must include the update and all previous versions.

Any part of the source code may be changed by author of the SOFTWARE in future versions. These changes may include the removal of classes, properties and methods or the creation of new classes, properties and methods.

This license is subject to change without notice in future updates to the SOFTWARE.

For Russia and CIS see License in License.RUS.txt

Registered users will receive source code and updates applicable for current version.
To register this product go to the registration page
go top


4. INSTALLATION

1. Uninstall previous version of EkRTF:
Select "Component/Install Packages" from the Delphi IDE. Select the package file ecomp.bpl,
click "Remove" button, click "OK". Select the package file edsn.bpl, click "Remove" button, click "OK".
Delete any old ecomp.bpl edsn.bpl and *.dcu files of the components.
2. If you have sources of the component, compile two packages ecomp.dpk and edsn.dpk.
3. Install package ecomp.bpl:
Select "Component/Install Packages" from the Delphi IDE. Press "Add" button. Select file ecomp.bpl,
3. Install package edsn.bpl the same way as ecomp.bpl
4. Select "Tools/Option/Environment Options/Delphi Options/Library" from the Delphi IDE.
5. In Library Path remove path to old *.dcu files
6. Set the path to the new *.dcu files in "Library Path" edit box. It must reference to location where is the
new version of EK RTF components. Installed component will appear on "Data Access" panel.

go top


5. TROUBLESHOUTING

Before running demo projects, check that you have application associated with doc and rtf files.
Otherwise output files will be saved on disk, but will not open automatically.
Delete all pathes from menu Tools\Enviroment options\Library\Directories\ which references to
old versions of component. If compiled programm cannot find input rtf file and generates exception place
your compiled exe file into project source directory (directory with source rtf files) or type full path and file
name in property "InputFile".
Check a FAQ page
go top


6. CONTACT INFORMATION

if you have any questions, comments or suggestions email to eca4@rambler.ru
See the latest version of Ek RTF Report on component home page at www.128byte.ru

go top