NTPSetOption ( <ReportHandle>, <OptionID>, <OptionValue> ) -> <ErrorCode>
Description
Various options for the creation and/or execution of the report can be set with this command. An option setting selected with this command always refers to the report given in <ReportHandle>.
Declaration for Lotus Script
Declare Function NTPSetOption Lib "NTP.DLL"( ByVal ReportHandle As Long, ByVal OptionID As Long,
ByVal OptionValue As Long ) As Long
Parameters
<ReportHandle> (LONG)
Report handle that was returned when NTPInit or NTPInitFromDatabase was called.
<OptionID> (LONG)
The possible settings that can be changed.
NTPOPTION_KEEPREPORT
NTPOPTION_SHOWPREVIEWWINDOW
NTPOPTION_MANUALPRINTERCOPIES
NTPOPTION_DEFAULTMAILCLIENT
NTPOPTION_MAXRTFVERSION
NTPOPTION_SHOWMESSAGES
NTPOPTION_REALTIMEFUNCTIONS
NTPOPTION_USEDEFAULTDESTINATION
NTPOPTION_CHECKVARNAMES
NTPOPTION_PRINTOFFSETX
NTPOPTION_PRINTOFFSETY
NTPOPTION_DELAYTABLEHEADER
NTPOPTION_RTF_REPLACEFIELDS
NTPOPTION_RTF_REPLACEVARIABLES
NTPOPTION_PRINTERDIALOG_DESTINATION
NTPOPTION_PRINTERDIALOG_COPIES
NTPOPTION_PRINTERDIALOG_PAGE
NTPOPTION_PRINTERDIALOG_FIRSTPAGE
NTPOPTION_PRINTERDIALOG_LASTPAGE
NTPOPTION_PRINTERDIALOG_LABELOFFSET
NTPOPTION_PRINTERDIALOG_LABELPRINTERCOPY
NTPOPTION_PRINTJOB_PAGESPERJOB
NTPOPTION_PREVWIN_....
NTPOPTION_RESET_PROJECT_STATE
NTPOPTION_AUTO_PRINT_PREVIEW
NTPOPTION_INCLUDE_FONT_DESCENDERS
NTPOPTION_USENULLVALUE
<OptionValue> (LONG)
The new setting of the NotesToPaper option.
NTPOPTION_KEEPREPORT
0 = The created preview file is automatically deleted after display. Default!
1 = The created preview file is not automatically deleted after display. This setting should be chosen if e.g. the created report is to be included in a Notes document, or exported via NTPExportReport. The script must independently delete the file. The name of the created preview file can be found using the function NTPGetReportFileName.
NTPOPTION_SHOWPREVIEWWINDOW
0 = No preview window is displayed. This function is needed if a preview file is to be created (e.g. for inclusion in a Notes document), and there is to be no direct output to the printer, and furthermore a preview window is not wanted (e.g. script runs on server).
1 = The preview window is displayed. Default!
NTPOPTION_MANUALPRINTERCOPIES
0 = The number of copies to be printed is supported by the printer, and should not be selected with NotesToPaper "manually". Default!
1 = The selected printer does not support automatic multiple copies. The number of copies is therefore implemented with NotesToPaper "manually".
Note: If "manual" support of multiple copies is activated with a printer that supports multiple copies, the number of copies printed does not tally with the input!
NTPOPTION_DEFAULTMAILCLIENT
0 = The default mail client set up under Windows is used for sending reports. (Default)
1 = The mail dialog integrated in NotesToPaper for Lotus Notes is used for sending reports.
NTPOPTION_MAXRTFVERSION
With this option, you specify the version of the Microsoft RichText control to be used. This control determines the output of RichText content in reports.
The following constants can be used as the value for this option:
CONST NTPRTFVERSION1
CONST NTPRTFVERSION2
CONST NTPRTFVERSION3
NTPOPTION_SHOWMESSAGES
This option allows all messages that may appear, e.g. because of an error, to be deactivated. This is especially important if NotesToPaper is running on a server, as this usually does not have a screen display facility.
0 = No messages are output.
1 = All necessary messages are output.
NTPOPTION_REALTIMEFUNCTIONS
If the current time or current date is output in a report, this information is determined at the start of the report and then used throughout it. However, it is sometimes necessary to determine these values when they are needed. This option allows you to activate "real time" calculation of date and time
0 = no "real time" calculation (default)
1 = "real time" calculation of time and date
NTPOPTION_USEDEFAULTDESTINATION
NotesToPaper Setup can be used to set a default output format (preview, printer, file, RTF, XML, ...) in the Report Layout. You can use this option to say whether this output format should also be set as the default in the printer selection dialog.
0 = The output format of the layout is not preconfigured (default)
1 = The output format of the layout is activated as default in the printer dialog.
NTPOPTION_CHECKVARNAMES
The generation of the report can be speeded up with this option. NotesToPaper normally checks all given variables for NTPProcessReportExt. You can disable this checking, and thereby increase the processing speed.
0 = Variables/fields are not checked
1 = Variables/fields are checked (default)
NTPOPTION_PRINTOFFSETX and NTPOPTION_PRINTOFFSETY
The printout of a report can be displaced in the X and Y direction with these options. If the values are specified, the report is displaced in a printout relative to its position in the layout (to the upper left corner of the paper). The default setting is no displacement.
NTPOPTION_DELAYTABLEHEADER
With this option, the use of fields in a table header can be activated. Normally a header is printed in a table before the first data record. At this point, however, no fields are filled with data yet. If a field is output now in a header, it contains no valid data. When this option is activated, the table header is not printed until the first data record of the table is "loaded", so that valid field values are also displayed in the header line.
0 = Print header line before first data record.
1 = Do not print header line until first data record is loaded.
Note: This option has no effect for reports with Multi-Table Layout.
NTPOPTION_RTF_REPLACEFIELDS and NTPOPTION_RTF_REPLACEVARIABLES
These two options can activate the replacement of wild cards in RichText contents by NotesToPaper fields or variables. You will find a description of the functionality in the document "Wild cards" in the Appendix, section "Rich Text Fields".
0 = No replacement of wild cards in RichText fields
1 = Replacement of wild cards in RichText fields activated
NTPOPTION_PRINTERDIALOG_DESTINATION
Selection of the destination for the print output.
Possible values are:
NTPOPTION_PRINTDESTINATION_PRN
Output to the printer
NTPOPTION_PRINTDESTINATION_PRV
Output to screen (Preview)
NTPOPTION_PRINTDESTINATION_FILE
Output to a print file
NTPOPTION_PRINTDESTINATION_HTML
Output (export) in HTML format
NTPOPTION_PRINTDESTINATION_RTF
Output (export) in RTF format
NTPOPTION_PRINTDESTINATION_PICTURE_JPEG
Output (export) in JPEG graphic format
NTPOPTION_PRINTDESTINATION_PICTURE_EMF
Output (export) in EMF graphic format
NTPOPTION_PRINTDESTINATION_PICTURE_BMP
Output (export) in BMP graphic format
NTPOPTION_PRINTDESTINATION_PICTURE_PNG
Output (export) in PNG graphic format
NTPOPTION_PRINTDESTINATION_MHTML
Output (export) in MHTML format
NTPOPTION_PRINTDESTINATION_XML
Output (export) in XML format
NTPOPTION_PRINTDESTINATION_PDF
Output (export) in PDF format
NTPOPTION_PRINTDESTINATION_XLS
Output (export) in XLS format
NTPOPTION_PRINTDESTINATION_TXT
Output (export) in TXT format
NTPOPTION_PRINTDESTINATION_PICTURE_TIFF
Output (export) in TIFF graphic format
NTPOPTION_PRINTDESTINATION_PICTURE_MTIFF
Output (export) in multipage TIFF graphic format
NTPOPTION_PRINTDESTINATION_XPS
Output (export) in XPS format
NTPOPTION_PRINTDESTINATION_XHTML
Output (export) in XHTML format
NTPOPTION_PRINTERDIALOG_COPIES
Number of copies of the report
NTPOPTION_PRINTERDIALOG_PAGE
Number of the first page in the report
NTPOPTION_PRINTERDIALOG_FIRSTPAGE
First page that should be printed
NTPOPTION_PRINTERDIALOG_LASTPAGE
Last page that should be printed
NTPOPTION_PRINTERDIALOG_LABELOFFSET
Offset positions for label printing; i.e. the number of labels to be skipped. Where the print starts is dependent on the selection of the printing sequence, which is specified in the report.
NTPOPTION_PRINTERDIALOG_LABELPRINTERCOPY
The creation of copies is normally handled by NotesToPaper in label printing; i.e. NotesToPaper duplicates the number of labels as required. The number of labels is thus already visible in the preview. However, in some specific label printers this leads to a slow print run. In these printers it is better for the copies to be handled by the printer itself. With this option, NotesToPaper can be made to leave copy creation to the printer, so that label printing becomes faster. However, there is the disadvantage that the total number of labels cannot be seen in the preview, as it is only determined by the printer.
0 = Copies for labels are created by NotesToPaper.
1 = The copies for labels are left to the printer.
NTPOPTION_PRINTJOB_PAGESPERJOB
This option can be used to determine how many pages per job are created in the print spooler. Normally, all pages of the report are put in a single print job. However, since the print job will only begin when all pages are present, it sometimes makes sense to define smaller print jobs so that the printing can begin sooner.
NTPOPTION_PREVWIN_....
Various settings for the preview window can be chosen with the NTPOPTION_PREVWIN_... options. You will find a more detailed overview in "NTPSetOption (Report Preview)"
NTPOPTION_HTMLEXP_..., NTPOPTION_RTFEXP_..., NTPOPTION_GRAPHICEXP_..., NTPOPTION_XMLEXP_..., NTPOPTION_MHTMLEXP_..., NTPOPTION_PDFEXP_..., NTPOPTION_XLSEXP_..., NTPOPTION_TXTEXP_...
Using these options, various parameters for Export of a Report can be given in a different format. You will find the settings for each of these export filters in the following documents:
•HTML Export (NTPOPTION_HTMLEXP_...)
•RTF Export (NTPOPTION_RTFEXP_...)
•Graphic Export (NTPOPTION_GRAPHICEXP_...)
•XML Export (NTPOPTION_XMLEXP_...)
•MHTML Export (NTPOPTION_MHTMLEXP_...)
•PDF Export (NTPOPTION_PDFEXP_...)
•XLS Export (NTPOPTION_XLSEXP_...)
•TXT Export (NTPOPTION_GRAPHICEXP_...)
NTPOPTION_RESET_PROJECT_STATE
This option can be used to cause a reset of the entire project after each data record. If this option is activated, then the overall layout is reset to the initial status after each data record (NTPEndDocument), as if the first page were just being printed. This option is used especially when generating serial letters. You will find an example of its application in the sample database "NTPSL.NSF"
0 = No reset of the project after each data record
1 = After each data record, the project is reset to the initial status
NTPOPTION_AUTO_PRINT_PREVIEW
This option controls whether or not a report created for preview should be sent directly to the printer. This option is only necessary if reports are being chained with "NTPProcessAndAppend". If the reports are chained, all reports must be created for the preview. At the end of the chaining, i.e. when the "master" report is executed, if you want to print the reports directly without displaying them on screen, you can use this option. If the option is active, then when the "master" report is executed the run is sent directly to the printer, and not displayed on screen, even if the parameter is set for NTPProcessReportExt.
0 = no direct print for chained reports
1 = Chained reports are printed directly upon execution of the "master" report
NTPOPTION_INCLUDE_FONT_DESCENDERS
The line height for text output is calculated with a fixed formula dependent on the selected font type and size. However, there are some character sets which work with extreme descenders in the letters. With these fonts it can therefore happen that the ends of descenders are cut off. In order to achieve correct output even with these fonts, the formula for calculating the line height can be adapted so that the descenders of the respective font are included in the calculation. To activate this calculation, you have to set this option.
Note: Use this option only if you have problems with the descenders in the fonts. If activated, this option generally leads to a rather greater line height, and might cause a shift of text content or line spacing in existing reports.
0 = The formula for calculating the line height does not take into account the descenders of the fonts
1 = The formula uses the exact descender lengths of the fonts for calculating the line height
NTPOPTION_USENULLVALUE
If a field was declared but was not filled with any contents from the script, it is treated as a null value. With this setting, you can specify how NotesToPaper should handle such values.
NTPOPTION_USENULLVALUE_DISABLED |
This setting corresponds to the action of NotesToPaper Version 4.0: the numeric values are interpreted as 0, the text fields are interpreted as a null string (""). |
NTPOPTION_USENULLVALUE_FORNUMERIC |
(Default setting) Numerical values are converted to null values, the text fields are treated as a null string (""). In the Report Layout, a null value can be queried using the function "IsNull (<value>)". |
NTPOPTION_USENULLVALUE_FORALL |
All empty fields are treated as null fields. |
NTPOPTION_USENULLVALUE: |
Field type: number |
Field type: text |
||
Displayed: |
Check for NULL: |
Displayed: |
Check for NULL: |
|
NTPOPTION_USENULLVALUE_DISABLED |
0 |
Number = 0 |
Text = "" |
|
NTPOPTION_USENULLVALUE_FORNUMERIC |
IsNull(number) |
Text = "" |
||
NTPOPTION_USENULLVALUE_FORALL |
IsNull(number) |
IsNull(text) |
Return
<ErrorCode> (LONG)
Number of the error that occurred (0 = no error)