PC SOFT

WINDEV的在线文档

  • When should I use 打印预览?
  • Print preview
  • End of print
  • Printer fonts
  • Re-running the report
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

Configures the preview window. You have the ability to print:
  • on the printer directly (syntax 1)
  • to a preview window (syntax 2). The user can preview the print result on the screen, page by page. By default, this window contains the following elements when printing a report created in the report editor:

This window allows you to:

  • scroll the pages (next page and previous page if they exist),
  • start the print,
  • modify the scale of the preview,
  • display the first page or the last page,
  • find out the number of the current page.

Note about compatibility
In the earlier versions, 打印预览 also allowed you to choose the print destination. These syntaxes have been kept for backward compatibility but 打印目标 must now be preferred for this use.

Note: A warning message is displayed by default if the current computer may not have sufficient resources to display all the pages in the preview (from 1000 pages). To avoid displaying this message or to configure the number of pages before displaying this message, use 打印预览参数.

例子
WinDev用户代码(MCU)
如果打印配置()=,那么打印预览打印.页码"List of functions"

语法

Printing on the printer directly 隐藏详细信息

打印预览([<Destination> [, <Job Name>]])
<Destination>: Optional integer constant
Destination of the print.
打印.打印机Direct print on the printer
<Job Name>: Optional character string (with quotes)
Name that must be given to the print. This name will be used to identify the print in the list of jobs processed by the printer.
WinDev用户代码(MCU)

Printing in a preview window 隐藏详细信息

打印预览([<Zoom> [, <Title of Preview Window> [, <Print Buttons> [, <Horizontal Position> [, <Vertical Position> [, <Width> [, <Height>]]]]]]])
<Zoom>: Optional integer constant
Zoom when the preview window is opened.
打印.页码
15版本和更高版本
打印预览缩放.整页
15新版本
打印预览缩放.整页
打印预览缩放.整页
(default value)
Preview with backward zoom: the page will be entirely displayed in the zoom window.
打印.默认缩放
15版本和更高版本
打印预览缩放.默认
15新版本
打印预览缩放.默认
打印预览缩放.默认
Corresponds to:
  • 打印预览缩放.整页 for a first use.
  • the zoom defined by the user in the preview window for the other uses.
打印.百分百
15版本和更高版本
打印预览缩放.百分比百
15新版本
打印预览缩放.百分比百
打印预览缩放.百分比百
Preview with a zoom set to 100%.
打印.2页
15版本和更高版本
打印预览缩放.2页
15新版本
打印预览缩放.2页
打印预览缩放.2页
Preview displaying 2 pages at a time.
15版本和更高版本
打印预览缩放.宽页
15新版本
打印预览缩放.宽页
打印预览缩放.宽页
Preview displaying the entire width of the page.
Value from 10 to 999Preview with the specified zoom.

If this parameter is not specified, the default value corresponds to:
  • 打印预览缩放.整页 during the first use of the function.
  • the zoom defined by the user in the preview window for the other uses.
<Title of Preview Window>: Optional character string
Title displayed in the title bar of the window. If this parameter is not specified, the default title will be "Report preview" followed by the name of the report.
If the user has the ability to generate some files (Word, PDF, ...) from the print preview, the title of the preview will be automatically proposed as file name. If this parameter is not specified, the name of the file will correspond to the name of the report.
<Print Buttons>: Optional boolean
  • (by default) to display the buttons allowing the user to start the print,
  • to avoid displaying the buttons.
<Horizontal Position>: Optional integer
Horizontal position of the preview window (in pixels). By default, the horizontal position corresponds to 100 pixels.
<Vertical Position>: Optional integer
Vertical position of the preview window (in pixels). By default, the vertical position corresponds to 100 pixels.
<Width>: Optional integer
Dimensions of the preview window (in pixels). By default, the dimensions of this window are set to 640 (width) by 480 (height).
<Height>: Optional integer
Dimensions of the preview window (in pixels). By default, the dimensions of this window are set to 640 (width) by 480 (height).

注意

When should I use 打印预览?

打印预览 must be the first print function called. It must be called before 打印, 打印创建字体, etc. However, 打印预览 must be called after 打印配置 or 打印参数.

Note: 打印目标 must be called before running a report (with 打印报表) to choose the destination of the report.

WinDev用户代码(MCU)

Print preview

1. Customizing the preview window
WinDev allows you to customize the interface of the preview window. You can:2. Zoom values
  • We do not recommend that you give a value less than 33% to the zoom, otherwise the buttons found in the preview window will be flatten and unreadable.
  • In zoom-out mode, depending on the requested font (for example, with some fonts that are smaller than 14), the font used by Windows to display the text is not proportional to the print font. This results in an incorrect display; however, the printout will be correct.3. Canceling the preview
    When previewing a report, 打印 and 打印文字 return if the "Abandon" button was clicked by the end-user. To test the abandon of the preview, you must write:
如果打印Text)=,那么返回

WinDev用户代码(MCU)

End of print

打印结束 must necessarily be called to end the print except after a call to 打印报表.

WinDev 打印结束 cancels the print preview.

The next prints will be performed on the printer except if 打印预览 is run again.

WinDev The configuration window (打印配置) must not be called between two successive print previews without having called 打印结束.

WinDev

Printer fonts

The printer manufacturers install fonts on their printers. These fonts are called "printer" fonts. Unlike the software fonts (such as "TrueType"), these fonts are directly accessible by the printer, they do not have to be loaded.

In the lists of fonts, the printer fonts are identified by a "printer" icon in front of the name of the font.

If you are using printer fonts, these fonts will be interpreted by the printer only.

WinDev Caution: unexpected display effects may occur when using the printer fonts. During the print preview, the display of the fonts is managed by Windows. As it does not support these specific fonts, Windows uses the nearest display font for the print preview.

Example: The following code prints bar codes on the printer but text on the screen.

打印预览打印.页码
打印创建字体120打印.正常"Interleaved 2of5"黑色0
打印创建字体220打印.正常"UPC/EAN"黑色0
打印打印字体1)+"Test of printer font"
打印打印字体2)+"Test of printer font"
打印结束()

Re-running the report

The report displayed in the print preview is automatically re-run in the following cases:
  • when changing printer from the print preview.
  • when printing the report via one of the buttons found in the button bar (print in HTML, in PDF, ...).
The report displayed in the print preview is automatically rerun when the report is printed or exported from the print preview. The processes associated with the report are rerun.

In this case, the data displayed in the report may be modified (to take into account the data modified by the other users for example).

The variables used by the report should be initialized in the initialization code of the report (and not in the code of the button that starts the print preview).

Note: The WLanguage functions used in your report may return a different result when the report is re-run. For example, if WLanguage functions are used in a report based on the current window, the current window will correspond to the preview window when the report is re-run.

组件
WinDev wd200prn.dll