RTFReport EXAMPLE
The description of the extension of templates RTFReport v3.0 beta
Templates are FreeWare.
Assignment: printing of the reports into the file of the
format RTF and/or HTML.
Structure of files:
RTFCp.clw - Definitions CodePages (copy this file into the directory LIBSRC)
RTFRpt.tpl - under main templates Clarion
RTFRptAb.tpl - under main templates ABC
RTFGpRep.tpw - Contains groups for both versions
RTFRptRu.txt - this file of the description
That this such:
The template does not use neither additional libraries nor
other what or program resources - only environment Clarion and all.
At connection it Extension to standard Report the report generate
into the file (document) RTF or HTML (not on the printer).
Thus not a picture turns out, as it was necessary to expect,
and valuable document (RTF) for further editing or listing,
but already in a text editor of a type Microsoft Word.
Similarly and the file HTML is used on assignment.
Except for the usual text in the document it is possible
to receive the table, the frameworks of the table can be
adjusted both for the table, and for separate (RTF) of cells.
In the table HTML it is possible to adjust association of cells
in a column, and in string(line) the association of cells is
calculated by the template.
At generation in HTML all colour adjustments of units are used,
and also is specific for HTML of adjustment of colours.
Besides, for thin adjustment, the developer can mark a field and
enter into this field units of the language HTML.
Except for main Report in the template the support of templates
UnivReport - CPCS (v5.15) Creative PC Solutions is developed.
But is not realized for CPCS:
EXTENSION:
CPCSDynaLabels, 'CPCS Dynamic Label Generator'
CPCSFastDMprint, 'Fast DotMatrix Printing support'
CODE:
StoreBinary, 'Store Binary BLOB/MEMO'
CPCSReportColumns, 'CPCS Columnar Report'
As with it to work:
Copy files RTFRpt.tpl, RTFRptAb.tpl and RTFGpRep.tpw into the
directory TEMPLATE. RTFCp.clw copy into the directory LIBSRC.
Connect templates by resources Clarion into Temlate Registry.
If you used the previous version of templates that re-register
templates (unregister and register). For usage of templates in your
project it is necessary in Global Extensions, to connect
extension RtfReportDef. For creation/designing of the report
the standard formatter of the reports "Report" from a main
set of templates is used. To the procedure using the template
Report, connect Extension: RtfReport.
Global adjustments of the template (RtfReportDef):
In Global Extensions adjust CharSet, Code Page, Default Suffix.
CharSet and Code Page it is necessary to adjust necessarily,
it is necessary that, in the obtained document, the text looked
normal& instead of not clear hieroglyphs.
Default Suffix - probably it is required to you, that in all
used fonts the suffix, for example "Cyr" was added.
For example: if for you in properties of a unit or report
the "Arial" font is used, in the obtained document will be
entered "Arial Cyr". These values are stored(kept) in global
variables: RtfFontDefaultCharSet, RtfFontDefaultCodePage,
RtfFontDefaultPostPosition accordingly. If necessary it is
possible to change these values in execution time of the program.
Local adjustments of the template (RTFReport):
*****************
Some terms in my context for exception of different interpretations:
* Structure - Structure of the report such as Band it Page Header,
Group Foter, Detail and similar.
* a Unit - Unit such as Control placed in structure it String in
various variants - String, Variable String etc.
* In adjustments of the template, where it is required to enter
a name, is used the standard approach - Name/!Field.
That is if the value will be used from a variable, by the first
character it is necessary to enter "!"
*****************
RTF File Name, HTML File Name - enter here filename or Variable,
for a name of the obtained document.
View Procedure - will guess.
HTML (Bookmark) - Adjustment specific for HTML of the document.
(Global colours and picture for a substrate)
---------
Page (Bookmark) - List of used structures and their adjustments.
For each structure it is possible to specify, how many strings(lines)
need to be brought into the table, and also some adjustments of
this table separately for RTF and HTML. The quantity(amount) of
strings(lines) is that quantity(amount) of strings(lines), which is
visible during visual formatting of the report. The quantity(amount)
of strings(lines) into the table is underlined by a range with N on N.
Printed Lines Per Page - quantity(amount) of strings(lines) on page.
If that is equal 0 transition to new page will not be formed under
duress. In execution time this value to be stored(kept) in a local
variable RtfLinesPerPage, and counter of strings(lines) in a
variable RtfLinesPerPageCount. At desire it is possible to manipulate
these values. That, for example, what or page to make more shortly
or more longly, or in general to remove forced sharing on pages.
Besides you can use any unit of a string type and in the necessary
moment to enter in it the usual code of transition
on new page - <12> but in this case will not be generated
PageFooter and PageHeader.
----------
Fields (Bookmark) - List of used units and their adjustments.
Some individual adjustments of units:
For RTF the presence and width of each line of cell in the
table is adjusted. For HTML it is possible to specify,
that for a correctness of value in this unit the developer responds.
Such unit will not be handled by the function AnsiToHTML().
Here again it is possible to specify, how many cells in column
should be used by(with) this unit (RowSpan). But this value should
not be more than quantity(amount) of strings(lines) getting into the
table since this unit and lower. ** That is, if in structure
5 strings(lines). In the table you have specified with 2 on 4.
The unit is located in 3 strings(lines). That this unit can
borrow(occupy) no more than 2 cells in column. **
Of value less than 2 have no sense (1 and 0 are ignored).
---------
Ignore Left Position - to ignore value of the left position
for an extreme left unit in string(line).
For example: the extreme left unit is located on distance 8μμ
from left margin of a page. But if "Ignore Left Position" will be
equal 10, the string(line), in the obtained document, will not
be shifted from left margin of a page. But if a unit to arrange
on distance 11μμ that and in the obtained document string(line)
will be shifted on 11μμ from left margin of a page. It concerns
and to strings(lines) of the formed table. In this connection
it is necessary to align the left position for the left units
of strings(lines) getting in the table.
That can not do(make) the template:
At generation all user's facilities except for Control
of units such as STRING. i.e. graphics primitives, texts is
ignored, Check Box and other are not handled.
The colour for RTF is ignored.
Why and not differently:
At generation of the text of the program,
the template uses properties of structures and units accessible
at a stage of generation of the program. And this that that is
visible in Source Report. Most important for generation are the
values AT(N,N,N,N) both in adjustments Report and in adjustments
of structures and units. Here there should not be negative values,
for example, AT(-10,,50,60) speaks that in the visual formatter
of the report any structure, unit, or sectoring of page has
moved down. For units the properties AT(X,Y,,) are invalid,
though X and Y can have zero values, but length and height
should be indicated necessarily. The template uses all these
values as for definition of a sequence of output in the file,
and for definition of a position of a unit in the document and
creation of additional spaces between strings(lines) or paragraphs.
If, for example, in string(line) from 5 of units 3 to arrange
hardly that is lower others in the document it will appear
on the following string(line). Therefore units in one string(line)
align on a bottom.
Are not less important identification of structures and units on
their properties USE. Already at a stage of adjustments you will
feel it if these properties will not be registered.
If the string(line) will not be placed in the table that in
the obtained document (RTF) it will be leveled, as is
indicated in properties of an extreme right
unit (This property of the document). If you wish that in the
table of a column on a vertical were not randomly that align
units on the right edge. At creation of the document
all superfluous blanks where they are excepted were.
At development of the template the efforts are undertaken,
that the strings(lines) getting in the table, stuck together
in the uniform table. In link than, you, if necessary, not at
once it will be possible to make so that the table has turned
out torn. And for usual strings(lines) the gap is stipulated,
after which exceeding, the additional space between strings(lines)
is formed. It that the sizes of a visual unit can very strongly
differ from the obtained character set in the document.
-------
do not overlook(forget) that the formed document (RTF) can
contain the header. And number of page should be in a page
header - there its place. And Word itself will enumerate
and will enumerate. For this purpose in PageHeader place
String (where or above that has got into colontitul)
in properties of this unit put a tick on "Variable String" and
"Total Type" = "Page No" and enough. To manipulate value of
this unit it is not necessary. In HTML the colontitul is used
for property TITLE of the document. And still, do not
overlook(forget), that in result it to turn out the document.
That is, we sometimes are prevented by a habit,
to use available possibilities.
For example, on one string(line) it is possible to place of
pieces 40 units with the format @s255, in summary,
in the document, some tens strings(lines) can turn out.
*****
By me the template is tested on versions Clarion 5 and 5.5
It will be possible to work and on older versions but it
is necessary that in LIBSRC\EQUATES.CLW were defined CHARSET:...
For those who used the previous version of templates:
I ask applications for the supplied inconveniences.
But in global adjustments (Global - > Extension) adjust once
again "Default Code Page"
To all:
If you will detect out errors, write to me or in mailing
lists (ClaList, Clarion) or conference.
If something is impossible to you, it will be a pity
if you only because of it will desert the template - better ask,
do not hesitate, and it is better if through mailing lists.
Quite I admit that some things, obvious to me, can for you
be completely not clear.
The small example of usage RTFReport is enclosed to templates,
look it(him), it(he) unpretentious, but uses almost all
resources of the template.
(for demonstrating printing in HTML the database Products.tps
and set GIF of pictures from an example "Invoice" delivered
with Clarion is borrowed. Copy files *.gif into the directory GIF)
Vladimir Degtyarenko
vlad@v-ufal.chel.su (worker)
vhome@v-ufal.chel.su (home)
*******************************