Table of Contents
- 1 Calculation Functions and Formula Basics
- 2 Referencing Fields and Field Contents
- 3 Basic Calculation Types
- 4 Trigonometry
- 5 Special Values
- 6 Types of Data for Table Fields and Database Fields
- 7 String Operations
- 8 Searches Queries and Conditional Calculations (IF / THEN)
- 9 Fractions and Number Properties
- 10 Probability and Statistics Calculations
- 11 Time and Date Format Operations
- 12 Analysis Functions for Tabular Database Reports
- 13 Computer and User Data and Text Statistics
- 14 Contact Details for your Document
- 15 Formatting and Commands for Database Reports
- 16 Variable Names for Sending Emails from Database Reports
Calculation Functions and Formula Basics
The following calculation functions belong to “Papyrus Base,” the Papyrus Author database…
- in the “Formulas for Field” tab of the “Field Properties” dialog
- in the “Database Field” dialog for database reports
- in the dialog for Full Text Search in database tables
… as well as in the “Calculation Field” dialog for tables and calculations (“Insert” menu → “Table” → “Calculate in Field…”). The calculation fields are specially marked. In a table, the calculation fields will have a small triangle in the upper right-hand corner. Calculation Database fields will be displayed in green.
In the formulas, there are various parts in which a different value can be entered.
In Papyrus Author tables, for example, we use the field “A1” in our examples, but you can change this to any field you like (e.g. “C4”). The same goes for other field references (e.g. “[FIELDLABEL]”), for fields from other tables, or you can also simply use a number. In the database, you can use the name of a database field or another variable.
How the calculation functions work is described in more detail in the these parts:
- 1.1 The Formula Interpreter (Working Syntax)
- 1.2 Errors in Formulas
- 1.3 Converting Other Data Types to Strings
- 1.4 Relational Links in Database Calculation Fields
The following is a list of all available calculation functions in Papyrus Author:
- Referencing Fields and Field Contents
- Trigonometry
- Basic Calculation Types
- Special Values
- String Operations
- Types of Data for Table Fields and Databases
- Search Queries and Conditional Calculations (IF/THEN)
- Fractions and Number Properties
- Probability and Statistics Calculations
- Time and Date Format Operations
- Analysis Functions for Tabular Database Reports
The Formula Interpreter (Working Syntax)
In the search line of the database table window the following syntax is accepted:
- Strings (a sequence of characters) can stand as they are, but if they contain any ambiguities such as a blank space or keywords, they must be surrounded by either single or double quotation marks.
- <Field Name> <Relational Operator> <Value>
- <Field Name> <Relational Operator> <Field Name>
- AND (a blank space can be used as a synonym), OR, XOR, NOT (and synonyms)
- Brackets and parentheses
Everywhere else in Papyrus Author where formulas are used (in Reports, in the “Calculation Field” of the database field properties as well as the “Calculation Field” dialog for Papyrus Author word tables) stricter syntax must be used. This means that strings always need to be entered inside quotations marks.
Function names and operators take priority over field and relational names, the latter take priority over synonyms for function names/operators. This means a field “Str” will not be accessed, as Str is also a command for converting a numeral into a string. A field “unicode” could be accessed, even though it also is a synonym for the ASCII command.
After you have edited a formula and open the dialog again, the formula will be displayed in standardized syntax which is known as “canonical syntax.” This also means that the appearance of your formula could change slightly:
- Function name synonyms can be converted to their main function name
- Field names will appear as the original field name
- Strings will appear with single quotation marks (SQL standard)
Each time you change the formula for a calculation field the preview will be updated (when the entry is a syntactically correct formula).
You can also write commentaries for your formulas.
To do this, simply write your commentary at the end and separate it will “//”:
Field_3: Field_2 * 1.19 // Commentary: Sales tax
Commentaries that are longer than one line can be surrounded by “/*” and “*/”:
Field_3: Field_2 * 1.19
/* Commentary longer than one line: Sales tax calculation
This field contains information that
is used for filing taxes */
Errors in Formulas
As soon as you enter a calculation command in the “calculation field” box in the “Field Properties” (menu: “Database”) dialog, the database will immediately analyze the syntax you have entered. The calculation for this field will also be displayed in the list of the fields.
This gives you immediate feedback about whether Papyrus Author has accepted and can interpret your entry.
In Papyrus Author table calculations, errors (for example, dividing by zero) will be displayed as ***error***.
Invalid types of data (for example if a string cannot be converted to a number) will be marked with ***invalid***.
Cyclical field references (for example if you enter a formula for field C4 that refers to this very same field C4) don’t work because they simply create a vicious circle. These cyclical field references will not, however, cause Papyrus Author to work in an endless circle, but will instead give you an ***error*** message. The formula “Field := Field + Field” can, however, calculate very long (see data limit).
Converting Other Data Types to Strings
The following conversions are valid for converting into a string (“string” refers to a chain of characters, e.g. “abc”), which can be done by changing the characters used in “field properties” or under VAL (stands for “value”).
To change a number into a string, normally the decimal point format (for example in SQL) is used, e.g. 1234.56, always without zeros before and after.
If a number is < -1012 or > 1012 or a very small fraction -10-6 < or < 10-6, then an exponent form will be used in electronic format (3456 => 3,456 x 103 => 3.456e3).
To change out of a string, either a decimal point format or the electronic format can be used (but without a thousand separator).
Date and Time conversion to/from strings:
When changing a date into a string, the form YYYYMMDD is used; for times, HH:MM[:SS[.FFF]], which means that seconds and milliseconds are only shown when they are not zero. Other display options can be used by adding sub-string, which can be done with string operations such as “LEFT” etc.
Date+Time will come out as <Date>T<Time>.
When converting from a string, you can also use the format “YYYY-MM-DD” (SQL standard format) or “MM.DD.YYYY” (Papyrus Author’s own). You do not need to add zeros before your dates. If you enter a year with as only two digits, years under 50 will be assigned 20YY, 50 and over, 19YY.
To compare dates:
Date > ‘11.17.99’
Relational Links in Database Calculation Fields
To create a relational link, use the tab “Relational Link” in the “Field Properties” dialog. Relational links can also be entered in the Calculated Field dialog.
You can use the value calculated by a relational link for further calculations. This value will also appear as a relation in the Calculated Field dialog. The result of the relation can then be used for further calculations.
Relational links are written as “relation name” → “primary field name”, for example “Address→Company”.
Relation names and field names are handled separately, which means that the relation name and field name can be the same without causing any problems. Be careful, though, that you yourself do not get confused if you use the same name.
Referencing Fields and Field Contents |
|
C4 | Papyrus Author Table: Reference a cell for a calculation or to use the contents. Here for example, the value from row 4, column 3 (C) |
A3..C5 | Papyrus Author Table: Cell range, the includes all cells in a rectangle from “A3” in the upper left to (= operator “..”) “C5” in the lower right. |
[FIELDLABEL] |
Papyrus Author Table: Absolute table field reference using a field name (assigned in “Table Cell”- or in the “Calculation Field” dialog) The brackets are optional, only necessary when the referenced field label has not yet been created |
Databasefieldname | pap. Base: Contents of a defined cell for this record in this table |
Relation→Fieldname | pap. Base: A cell that has been linked from another (or the same) table |
[C:\GetMe.pap# FIELDLABEL] |
An absolute field reference from the cell named in “FIELD LABEL” from the document F »C:\GetMe.pap« |
COLUMN | Number of the column in which the calculation formula is located (only in Papyrus Author Tables) |
LINE | Number of the row in which the formula is located (only in Papyrus Author Tables) |
/* comment, several lines long */ |
Everything between the “/*” which begins the comment and the “*/” which ends it, will not be interpreted (the symbols themselves will also not be interpreted) and can contain any text you choose /* … … */ |
Content // Comment | In this line, everything to the right of the “//” (incl.) will not be interpreted |
Basic Calculation Types |
|
+ – * / | Basic calculations: addition, subtraction, multiplication; division; formula e.g. “A1+B1”; “A3*1,16” |
( ) | Sets off the calculation to be carried out first in parentheses; e.g. “A1(B2+3)” |
A1^3 | Power, e.g. “A1^3” is the cell “A1” to the third power |
SQRT(A1) ROOT(A1) |
Square root, here, for example, the square root of field “A1” |
LOG(A1) LOGARITHMUS(A1) LOGARITHME(A1) |
Natural logarithm of field “A1” (with “e” as its base) |
LOG10(A1) LOGTEN(A1) |
Logarithm of field “A1” to base 10 |
EXP(A1) | Exponent: “e” to the power of cell “A1”, synonym of “E^A1” |
FAC(A1) FACULTY(A1) |
Factorial of field “A1” = A1! = A1 * (A1-1) * (A1-2) * … * 1; if A1=5 then 5*4*3*2*1=120 |
MOD(), x MOD y |
Modulo value (lt. mathematics, important for encryption) |
LET var = … | Database: assigns the variable “var” a specific value |
Trigonometry |
|
SIN(A1) / SINUS (A1) COS(A1) / COSINUS(A1) TAN(A1) / TANGENS(A1) |
Sine / Cosine / Tangent of field A1 |
ASIN(A1) ACOS(A1) ATAN(A1) | Arcsine / Arccosine / Arctangent of field A1 |
SINH(A1) COSH(A1) TANH(A1) | Hyperbolic Sine (Cosine hyp. / Tangent hyp.) of field A1 |
Special Values |
|
PI | The Greek number “Pi” with at least 16 decimal places |
E | The number »e« as a base for natural logarithms with at least 16 decimal places |
COLUMN | Number of the column, in which the calculation formula is located (only for Papyrus Author Tables) |
LINE ROW | Number of the row in which the calculation formula is located (only for Papyrus Author tables) |
ERROR | Writes the word “Error” in red in the field |
MISSING |
The field is blank (which is logically different than having the value “0” and means that nothing will appear in the field) |
COPY | Current form letter number when generating a form letter (does not work when you print out a form letter immediately) |
variable | In Papyrus Base under the menu “Database” by “Properties” you can set a variable to be used universally throughout Papyrus Author, which can then be used for all calculations |
Types of Data for Table Fields and Database Fields |
|
The type of data produced by a calculation mostly depends on the data field of the formula. For calculations with two operands, the field type will take priority over the literal operand, which is a pre-defined value. Rule 1: Field before value. If both operands are data fields, the results and the type of data produced depend on the left operand. Rule 2: <Number Field> + »1« } »1« + <Number Field> } => 1 + <Number Field>, follows Rule 1 <Number Field> + 1 } <Number Field> + <String Field> => Number Addition (Rule 2) and here the order is reversed, so we have a string addition: <String Field> + <Number Field> => String Addition If, in this last example, you do not want a string addition, but rather a number addition, you need to write (“VAL” which changes a string into a number, see next chapter): VAL(<String Field>) + Number Field => Number Addition |
|
String | Chain of characters – Field types standard, text, picture |
Floating Point Number | (»Double«) precision of the type »double« in Windows: double is a 64 bit format: 1 for sign bit, 11 for exponent width and 52 for significant precision. Thus results a range of +/- 1.7308 with 15 digits. |
Whole numbers or numbers with 1-6 decimal places | (Fixed-point integer) the range depends on the number of digits after the decimal point: Windows 64 bits total, -9.2218 to +9.2218 / (10 decimal places) |
Date / Time / Point in Time / Duration |
Dates are displayed as “Julian days” starting from 1.1.0001 into eternity (the number of days since 1.1.0001 are counted forward). Leap years are included. Irregular calendar conversions (e.g. from Julian to Gregorian) are ignored. Times are displayed to the millisecond. Additions / differences are displayed in days for dates and in seconds for times. Date + Time is also possible. Time intervals are displayed as [Days] [HHH:MM[:SS[.ffff]]].Dates can also be displayed with a day of the week. The “intelligent” format will display “yesterday” / “today” / “tomorrow” and up to 6 days in the past as a day of the week.It is also possible to enter +<Days> or -<Days> instead of a date. |
Truth Values | E.g. results of comparisons will be displayed as integer 0 (FALSE) or 1 (TRUE). For conditions (e.g. IF), each value other than 0/Empty String will be interpreted as “TRUE.” |
Comments |
With “//” you can enter text of your choice behind the formula. With /* Comment …. Comment */ You can even enter a comment that stretches over more than one line. |
String Operations |
|
The parentheses can contain either a chain of text, a “string,” or a reference to a table or data field that contains a string. Strings are always Unicode strings of any length. Literals can be entered in single (ANSI SQL) or double quotation marks. String comparisons are never case sensitive. The relational operators > < etc. sort in alphabetical order. For the most part, the functions are conform to the database standard SQL. Positioning parameters that are negative or over 65536 will display an ERROR. |
|
ASCII(str) UNICODE(str) |
Produces the ISO Latin ASCII / Unicode value (for characters above 255) of the first character in the string. Results in 0 for empty strings |
CHAR(number) CHR() | Forms characters from ASCII / Unicode values |
STR(number etc.) | Converts number/date/time to a string |
VAL(str) | Converts a string to a number (double byte) |
FLOAT(number or str) | Converts a whole number or a string to a floating point number |
CAPITAL(str) | Capitalizes the first letter of the string |
UCASE() UPPER() | Writes all letters of the string in upper case |
LCASE() LOWER() | Writes all letters of the string in lower case |
LEN(str) LENGTH() | Produces the string length as a number of characters |
LOCATE(str , search[, start]) INSTR() | Identifies the position in “str,” from which “search” appears. In “start” you can enter, where you would like to begin searching. “0” appears when nothing has been found |
SUBSTRING(str, start[, n]) MID() | Produces n characters from the position start in str; if n has no value, then only one character. Values too large for start/n will result in empty string/ right side of a string |
CONCAT(str1, str2) | Results in str1+str2, will always produce a string |
LEFT(str, n) | Left n characters, or entire string if n > LENGTH(str) |
RIGHT(str, n) | Right n characters, or entire string if n > LENGTH(str) |
REPLACE(str, search, replacestr) | Replaces all search occurrences in str with replacestr |
TRIM(str) | Trims spaces to the left and the right |
LTRIM(str) | Trims a space to the left |
RTRIM(str) | Trims a space to the right |
REPEAT(str, n) | Repeat string str n times |
SPACE(n) | String with n spaces |
TAB TAB() | Tabulator character, corresponds to CHR(7) (for database report) |
CR CR() | Carriage return character, corresponds to CHR(10) (database report) |
STR(number,before decimal,after decimal) | Formats “number” so that it contains “before decimal” before the decimal (filled with zeros) and “after decimal” after the comma (also filled with zeros). Used for formatting numbers in database reports |
Searches Queries and Conditional Calculations (IF / THEN) |
|
IF Condition THEN Term1 ELSE Term2 Example: IF A1 > 5 THEN 1000 ELSE 2000 |
If a condition is logically “true,” then Term1 will determine the field content calculated; if the condition is logically false, Term2 will determine. If condition is false, the result will appear as “MISSING” and the field will be EMPTY |
IF … THEN … (IF … THEN) | Separated IF/THEN … should be set in parentheses |
ENDIF (optional) | To avoid confusion you can end an “IF” with this ENDIF command |
RETURN Term (optional) RESULT … |
In a “true” situation, gives Term as a value – meant to simplify terms that are long or complicated |
Relational Operators Priority: “NOT” binds the strongest; “AND” binds stronger than “OR”/”XOR”, but less than “NOT”. When in doubt, use parentheses; the parts in parentheses will be handled first. rom AND NOT logicware OR Papyrus AND NOT base will be (rom AND (NOT logicware)) OR (Papyrus AND (NOT base)) |
|
> < | Greater than / less than (strings sorted alphabetically) |
<= >= | Less than or equal to / greater than or equal to |
= | “Equal to”; for database queries, search for the beginning of the first word in the field |
== | For database queries, search for complete field accordances |
=: | For database queries, search for complete word accordances |
: | For database queries, search for the beginning of any word in the field |
!= !== !=: !: | For database queries, negates the relational operators listed above (like writing a NOT before) |
!= =! <> | Not equal to |
AND & && |
Logical AND (both conditions must be fulfilled for a logical “truth”) |
OR | Logical “and-or” (one or both conditions must be fulfilled) |
XOR EXCLUSIVEOR | Logical “either-or” (one condition–not both–must be fulfilled) |
! NOT NO |
Negates the truth value of a logical term |
Fractions and Number Properties |
|
ABS(A1) | Absolute value of field “AI,” leaves positive numbers as they are and changes negative numbers to positive |
SIGN(A1) SGN(A1) |
Sign of field “A1,” for positive numbers “1” and for negative numbers “-1” |
RND(A1) ROUND(A1) |
Rounded to the nearest whole number for field “A1” |
TRUNC(A1) / FIX(A1) | Truncates the number in field “A1” to 0, meaning it cuts off all numbers after the decimal point |
FRAC(A1) | Fractional part of the field “A1,” uses only the numbers after the decimal point and leaves out the numbers before (is thus always 0, …) |
FLOOR(A1) / INT(A1) | Floor function: the next smallest whole number of a number with a decimal point. Only identical with TRUNC(A1) for positive numbers |
CEIL(A1) CEILING(A1) | Ceiling function: the next largest whole number of a number with a decimal point |
Probability and Statistics Calculations |
|
SUM(A1..E6) | Calculates the sum of all number values in cells “A1” to “E6” (30 fields in total) |
NCELLS(A1..E6) | Number of cells (also called “fields”) in area A1 to E6 |
NVALID(A1..E6) | Number of cells in the area A1 – E6 that have a valid number |
NINVALID(A1..E6) | Number of cells in the area A1 – E6 that don’t have a valid number |
NEMPTY(A1..E6) | Number of cells in the area A1 – E6 that are empty (but not “0”) |
MEAN(A1..E6) |
Statistical mean of all valid numbers in the area A1 – E6 |
DEVIATION(A1..E6) STD(A1..E6) | Statistical standard deviation of all valid numbers in the area A1 – E6 |
VARIANCE(A1..E6) |
Statistical variance of all valid numbers in the area A1 – E6 |
MSQUARES(A1..E6) | Statistical root mean square of all valid numbers in the area A1 – E6 |
VALID(A1) OK(A1) |
Produces “1” when cell A1 is a valid numerical value, otherwise “0” |
INVALID(A1) |
Produces “1” when cell A1 is empty (not “0”), otherwise “0” |
MISSING | The cell is empty (logically different from a value of “0”, for empty fields, no content will be displayed) |
Time and Date Format Operations |
|
CURDATE() DATE CURRENT_DATE |
Produces today’s date in date format |
CURTIME() TIME() CURRENT_TIME() |
Produces the current time (to the second) in time format |
SYSDATE() SYSDATE | Produces a string (not a date) with the current date MM.DD.YYYY |
SYSTIME() SYSTIME | Produces a string (not a time) with the current time as HH:MM:SS |
NOW() GETDATE() | Produces the current point in time (to the second) as a date + time |
HOUR(time) | Hours (0-23) extracted from a time/point in time |
MINUTE(time) | Minutes (0-59) extracted from a time/point in time |
SECOND(time) |
Seconds (0-59) extracted from a time/point in time |
DAYOFMONTH(date) DAY() |
Day (1-31) extracted from a date/point in time |
MONTH(date) | Month (1-12) extracted from a date/point in time |
YEAR(date) | Year (1-9999) extracted from a date/point in time |
DAYOFWEEK(date) DOW() |
Day of the week (1-7, 1=Sunday to 7=Saturday) calculated by a date/point in time |
DAYOFYEAR(date) DOY() |
Day of the year calculated (1-366, 1.1. is day 1, 12.31. is day 366 in a leap year, otherwise day 365) |
QUARTER(date) |
Quarter calculated |
WEEK(date) |
Week (1-53) of the year calculated. 1.1 is always in week 1, the second week starts on the following Sunday. |
MOONPHASE(date) |
Moon phases 0-7: 0 new moon, 1-3 waxing, 4 full moon, 5-7 waning. Important for werewolves. |
DAYNAME(date) MONTHNAME(date) CDOW() CMONTH() |
Name of the day or month, generated from the date or number (days 1-7 and months 1-12). |
CTOD(string) | Changes a string to a date |
DTOC(date) | Changes a date to the string DD.MM.YY |
TOTALMS(time) TOTALSECONDS() TOTALMINUTES() TOTALHOURS() TOTALDAYS() |
Produces the amount of milliseconds/seconds/minutes/hours/days for a time interval or a time of day. For example for billing time. Numbers will always be rounded. For dates/points in time, TOTALDAYS() will use Julian Day as a reference, which means the days will be counted starting with Day 1 = 1.1.0001 (without consideration for historical calendar conversions) |
Analysis Functions for Tabular Database Reports |
|
To work with data in a report, define two separate areas. The data area (“inner” area) is where data from your database records is displayed. Fields in the data area are repeated for every record from the data set you work with. This will usually be a table row. The header and footer area are for content that will only be displayed once. To set the data area, mark the part of your report that is to contain repeat output and right-click to open the context-menu. In the context-menu, click “Set Data Area from Block”. The commands below can also be used outside of the data area you have selected. For example, you can use SUM(field name) to calculate the sum of all values found in “Fieldname.” |
|
SUM(Fieldname) SUMME() |
Sum of all content found in “Fieldname” of all records included in the report. The result will be formatted just like “Fieldname,” for text, however, the result will be displayed with a floating point number. |
MIN(Fieldname) | Minimum value of all “Fieldname” content included in the report. Empty fields will not be counted. |
MAX(Fieldname) | Maximum value of all “Fieldname” content included in the report. |
COUNT(*) | The number of records included in the report |
NVALID(Fieldname) | The number of fields included in the report that are valid and not empty |
NINVALID(Fieldname) |
The number of fields included in the report that are invalid (e.g. text instead of a number) |
NEMPTY(Fieldname) |
The number of empty fields included in the report |
AVG(Fieldname) AVERAGE() |
Arithmetic average of all “Fieldname” content included in the report. Empty fields are not included. Corresponds to SUM(Fieldname) / NVALID(Fieldname) |
DEV(Fieldname) |
Standard deviation of all “Fieldname” content included in the report. Empty fields are not included. |
VAR(Fieldname) |
Variance (squared deviation) of all “Fieldname” content included in the report. Empty fields are not included. |
MSQUARES (Fieldname) |
Root mean square of of all “Fieldname” content included in the report |
Computer and User Data and Text Statistics |
|
With these commands you can access specific name values and terms that are used by Papyrus Author or your operating system. This data can also be used as a Reference (menu “Insert”). (In the “Reference” dialog, set “reference to” on “choice of words.”) |
|
USERNAME | The user name used to sign in to your system |
HOST_NAME | The name of your computer in the system / network |
FILESIZE | The size of the document in bytes |
NUMCHARS | The total number of characters in the document |
NUMKEYS | The total number of typed characters, including spaces |
NUMWORDS | The total number of words in the document |
CREATEDATE | The time and date you created the new document |
EDITTIME | The amount of time you have spent working on this document |
PRINTTIME | The point in time when you last printed the document |
SAVEDATE | The point in time when you last saved the document |
LASTSAVEDBY | The last user to save the document |
Contact Details for your Document |
|
This details are important when you want Papyrus Author to create your Front Matter for you. Papyrus Author will retrieve them from “Document” → “Document Properties” → “Front Matter.” Templates for the data can be found under “Properties” → “Documents” → “Author Data.” |
|
AUTHOR | Author of the document |
DOC_PUBLISHER | Editor responsible for the document |
DOC_PUBLISHER_COMPANY | Publisher of the book / document |
DOC_COPYRIGHT | Person who owns the copyright to the document |
DOC_ADDRESS | Publisher in duty (for self publishing) |
TITLE | The title of your document (the one you assign in the dialog, not the title you save it under) |
DOC_SUBTITLE | The subtitle of your document |
DOC_ISBN | The ISBN number of the work (if it exists) |
DOC_YEAR | The year of publication |
DOC_EDITION | The number of the current edition |
DOC_EDITION_YEAR | The year in which the current edition was printed |
DOC_DISTRIBUTION | How the work is published (publisher, e-book, self publishing…) |
DOC_PRINTER | The printer that printed your work (possibly with city / address) |
DOC_COUNTRY | The country in which your work was published |
DOC_RIGHTS | Picture or translation rights |
DOC_FONTS | Special fonts used in the work |
DOC_INTERNET | Internet site with more information |
DOC_EMAIL | Email address of the author |
DOC_PHONE | Telephone number of the author |
DOC_AUTHOR_DESCRIPTION | A short biography of the author (e.g. for the blurb) |
DOC_BOOK_DESCRIPTION | A short description of the book (e.g. for the blurb) |
DOC_SUBJECT | Topic of the document |
DOC_COMMENTS | Your comments about this document |
DOC_COMPANY | Your company (if the book is related to your profession) |
DOC_KEYWORDS | Keywords you have assigned to your document |
DOC_CATEGORY | Category to which the document belongs |
DOC_TEMPLATE | Name of the template used for this document |
Formatting and Commands for Database Reports |
|
With these commands you can assign specific formatting to your report. Enter them in the report placeholder in brackets, e.g. “[CR]” | |
PICREF(Path) | Inserts an external picture into your report using the file path |
CR | Carriage Return (starts a new line, for example at the end of a paragraph, also known as a “hard break”) |
TAB | Jumps to the next tab in the line (can depend on the style template you use) |
LF NEWLINE LINEEND LINEBREAK |
New line (“soft” break) |
FF NEWPAGE PAGEEND PAGEBREAK |
New page |
NEWCOLUMN COLUMNBREAK COLUMNEND |
New column (for a page with multiple columns) |
CALL(Program, Parameter) | Calls up an external program (can be given with file path). Call parameters are to be separated with spaces or quotation marks. Only allowed during reports. |
ABORT(error text) | Aborts a report with an alarm box with error text. Line breaks in the error text shown with “|” |
MESSAGEBOX(Icon, Text, Button(s)) | Icons: 0 – none; 1 – exclamation mark; 2 – question mark; 3 – period; 4 – Info. In the text “|” will create a line break. The button texts are divided by “|” (but no text will appear with simply “OK”). Return value is the button number (begining with “0”), if you abort the function, it will return to the last/highest button value. |
REPORT(Report path) | Calls up another report (with a file path, if applicable) for this record. The report template must be among the reports associated with this database table. |
SUM(Field name) | Sum of all reported records. When ›Text‹ or ›Text or Number‹ the outcome will be a floating point number |
MIN(<Field name>) | Smallest value. Empty fields do not count |
MAX(< Field name>) | Highest value |
COUNT(< Field name>) | Total number of processed records |
NVALID(< Field name>) | Number of not empty and valid field contents |
NINVALID(< Field name>) | Number of invalid field contents (e.g. text instead of number) |
NEMPTY(< Field name>) | Number of empty field contents |
AVG(< Field name>) | Arithmetic mean. Empty fields do not count |
DEV(< Field name>) | Standard deviation. Empty fields do not count |
VAR(< Field name>) | Variance (the square of standard deviation) |
MSQUARES(< Field name>) | Arithmetic mean of squares |
SAVE(Document path) |
Saves a copy of the current report under the chosen path. The format depends on the file extension (*.pap, *.rtf, *.doc, *.html, *.pdf, *.pap.pdf). By choosing the option “directly save report” you can prevent this window from opening. |
Variable Names for Sending Emails from Database Reports |
|
EMAIL_RECIPIENT | Recipient of the email |
EMAIL_RECIPIENT_NAME | Additional info about the recipient’s name |
EMAIL_RECIPIENT_ROLE EMAIL_TO |
List of all the people you would like to receive the email |
EMAIL_CC | “Carbon Copy” List for all recipients that should only receive the email as a copy |
EMAIL_BCC | “Blind Carbon Copy” List for all recipients that should only receive the email as a copy and who should remain invisible to the other recipients |
EMAIL_SUBJECT | Subject of the email |
EMAIL_LOGIN_USER='<User Name>’ | If the email server requests authentication, a login can be entered here |
EMAIL_LOGIN_PASSWORD='<Password> | If the email server requests authentication, a password can be entered here |
LET EMAIL_ATTACHMENTS=’File1,File2‘ | Papyrus Author creates a multi-part MIME email with file attachments |
LET EMAIL_HTML= | 0: only Text, 1: Text and HTML, 2: only HTML |
LET EMAIL_PDF= | The Papyrus Author text will be attached as a PDF |
EMAIL_PDF_FILE | Name of the attached PDF |
EMAIL_PLAIN_TEXT | Plain text, as an alternative to HTML emails |
EMAIL_LOG_PATH | Path of the Log file |
EMAIL_LOGGING | Switch for logging of the report |