PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Characteristics of print
  • Combining fonts
  • Combining positions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Sends the character string passed in parameter to the print buffer.
A line break is automatically inserted at the end of the string: the cursor is positioned on the next line. The move to the next line takes into account the height of the current line (in relation to the font used). The print is not started (only iEndPrinting can be used to start the print).
Notes:
  • To print a character string without going to the next line, use iPrintWord.
  • iPrint must not be used in the opening code of a report.
Example
iPrint(iFont(2) + "Text in font 2")
iSkipPage()
// Customer name on the first line at 50 mm from the border
iPrint(iXPos(50) + Cu.CustName)
iEndPrinting()
Syntax
<Result> = iPrint(<Text to Print> [, <String on Next Page>])
<Result>: Boolean
  • True if the print was performed,
  • False if the print was canceled.
<Text to Print>: Character string (with quotes)
Character string to print as well as its characteristics. This parameter has the following format:
[<Font Identifier> +] [<Vertical Position> +] [<Horizontal Position> +] <Text1>
...
[<Font Identifier> +] [<Vertical Position> +] [<Horizontal Position> +] <TextN>
where:
  • <Font Identifier>: optional integer.
    Identifier of the font used to print the text. This identifier is returned by iFont. If this parameter is not specified, the last font used will be selected.
  • <Vertical Position>: optional integer.
    Y coordinate of the point where the print must be performed. This position is specified in number of rows from the top left border of the sheet (with iYPos). If this parameter is not specified, the text will be printed at the current position.
  • <Horizontal Position>: optional integer.
    X coordinate of the point where the print must be performed. This position is specified in number of columns from the top left border of the sheet (with iXPos). If this parameter is not specified, the text will be printed at the current position.
  • <Text>: Character string with quotes.
    Character string to print.
Example:
Text_to_print = "First part" + iFont(1) + "Second part"
<String on Next Page>: Optional boolean
Specifies whether the text printed at the end of the page must be truncated or whether it must continue over the next page:
  • True (default value): the string will be printed on the next page if it does not fit on a single page.
  • False: the character string is truncated: the rest of the string is not printed on the next page.
Remarks

Characteristics of print

  • The origin (0,0) is located in the top left corner of the sheet. It takes the physical margins of printer into account.
  • The current vertical position when printing a character string points to the upper part of the string. The bottom position depends on the height of the fonts used in the line to print.
  • You can specify several fonts and several positions as parameters in a single call to iPrint. For example:
    iPrint(iXPos(50) + CU.LASTNAME + iXPos(150) + CU.FIRSTNAME)
  • The character corresponding to a line break (Char(10)) is interpreted as a line skip.

Combining fonts

Unexpected results may occur when combining fonts. For example, the following code:
iFont(2)
iPrint("First Part" + iFont(1) + "Second Part")
is not equivalent to:
iPrint(iFont(2) + "First Part" + iFont(1) + "Second Part")
In the first case, the entire character string is printed in font 1. Indeed, in this case, iFont(1) is run when building the string to print and therefore before the "First Part" string is printed.
To get an identical result, all you have to do is use iFont with the False parameter: iFont(1, False) will be actually run during the print.

Combining positions

When combining positions, unexpected results may occur. For example, the following code:
iXPos(50)
iPrint("First Part" + iPrint(30) + "Second Part")
is not equivalent to:
iPrint(iXPos(50) + "First part" + iXPos(30) + "Second part")
In the first case, the entire character string is printed at horizontal position 30. Indeed, in this case, iXPos(30) is run when building the string to print and therefore before the "First Part" string is printed.
To get an identical result, all you have to do is use iXPos with the False parameter: iXPos(30, False) will be actually run during the print.
The same operation can be performed by iYPos.
Component : wd250prn.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
RELATORIO manual
// AULA 1224 BLOG COM VIDEO E EXEMPLO COMPLETO

_LINHA=0
iPrint("Nome Empresa ... ")
iPrint(iXPos(1) + "Relatorio ..."+iXPos(240) +"Pagina"+iPageNum)
iHLine(0,iPageWidth())


http://windevdesenvolvimento.blogspot.com.br/2017/07/aula-1224-windev-051-relatorio-manual.html

https://www.youtube.com/watch?v=9Ax0rInK_bA

De matos
27 Jul. 2017