ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Print functions
  • Printing a duplicate copy from the report viewer
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Configures the automatic creation of the duplicate copy generated during the next print (print on a physical printer):
  • name of duplicate file.
  • directory for duplicate creation.
  • password of duplicate.
  • signature of duplicate.
This function must be used before starting the print job for which a duplicate copy must be stored. This setting is taken into account for this print only.
The duplicate copies are available for the programmed reports (created by the iXXX functions) and for the reports generated by the report editor.
Example
// Paramétrage du duplicata de la facture
iParameterDuplicate(iDplPrintout, "C:\Temp", "MonDuplicata_%d_%h", ...
	"JJJJ JJ MMMM AAAA", "HH.MM.SS")

// Impression avec duplicata depuis le visualisateur de rapports
iDestination(iViewer)
iPrintReport(ETAT_Facture)
// Paramétrage du duplicata signé de la facture 
MonCertificat is Certificate
SélectionCertificat is boolean
SélectionCertificat = CertificateSelect(MonCertificat)

// Annulation ou erreur
IF SélectionCertificat = False THEN RETURN

// Teste si le certificat sélectionné est valide pour signer
IF MonCertificat.ValidForSignature = False THEN
	Info("Le certificat sélectionné ne permet pas de générer une signature.")
	RETURN
END

iParameterDuplicate(iDplPrintout, "C:\Temp", "MonDuplicata_%d_%h", ...
		"JJJJ JJ MMMM AAAA", "HH.MM.SS")
iParameterDuplicate(iDplCertificate, MonCertificat)

// Impression avec duplicata depuis le visualisateur de rapports
iDestination(iViewer)
iPrintReport(ETAT_Facture)
Syntax

Set up the duplicate file to be created: directory, name, password, etc. Hide the details

iParameterDuplicate(<Options> [, <Creation directory> [, <Name of file to print> [, <Date format> [, <Time format> [, <Password>]]]]])
<Options>: Integer constant
Options for creating the duplicate copies:
iDplNoneNo duplicate copy is created.
iDplPrintoutA duplicate is automatically created for each print performed on a printer.
Note The duplicate is not generated if the user uses one of the export options (pdf, email, ...) from the report viewer
<Creation directory>: Optional character string
Path of directory for duplicate creation. This parameter corresponds to the current directory by default.
<Name of file to print>: Optional character string
Name of file to print (with its extension). This name can contain the creation date and time of duplicate copy via the following tags:
  • %d to specify the creation date of duplicate copy.
  • %h to specify the creation time of duplicate copy.
Example For example, "MonDuplicata_%d_%h.dpl" will produce the file "MonDuplicata_04092009_1426.dpl".
By default, the name of the created duplicate file corresponds to "Dupli_YYYYMMDD_HHMMSS.dpl".
<Date format>: Optional character string
Format of the date used in the file name. This parameter can contain a word, a phrase, ... The specific characters representing the various elements of the date (YYYY, YYYY, MM or DD) will be automatically replaced by their value. In this string:
  • YYYY represents the year,
  • M represents the month without a leading zero,
  • MM represents a 2-digit month,
  • MMM represents a 3-letter month (e.g., Jan),
  • MMMM represents the month as a full name (e.g., January),
  • D represents the day without a leading zero,
  • DD represents a 2-digit day,
  • DDD represents a 3-letter day (e.g., Mon),
  • DDDD represents the day as a full name (e.g., Monday).
If this parameter corresponds to the maskDateSystem constant, the format used corresponds to the format defined in the project description for the current language. To define this format:
1. On the "Project" tab, in the "Project" group, click "Description".
2. Display the "Languages" tab.
If this parameter is not specified, the DD/MM/YYYY format is used by default.
<Time format>: Optional character string
Time format used in the file name. This parameter corresponds to a character string (a sentence for example). The specific characters representing the different elements of the time (HH, MM, SS, CC or AP) will be automatically replaced with their value. In this string:
  • HH represents the number of hours,
  • MM represents the number of minutes,
  • SS represents the number of seconds,
  • CC represents the number of hundredths of a second,
  • AP represents "AM" or "PM" (if "AM" is used, the time is displayed in 12-hour format).
If this parameter is not specified, the result is in HH:MM:SS:CC format.
<Password>: Optional string or Secret string
Password of generated duplicate files.
New in version 2025
Secret strings: If you use the secret string vault, the type of secret string used for this parameter must be "ANSI or Unicode string".
To learn more about secret strings and how to use the vault, see Secret string vault.

Configuring the signature of duplicate copy Hide the details

iParameterDuplicate(<Options> , <Certificate>)
<Options>: Integer constant
Options of duplicate copy:
iDplCertificateUses the specified certificate to sign the duplicate copy.
Remark: From the report viewer, this signature will be used:
  • if the report is printed via the "Duplicate" export option:
  • if the report is printed via the print option on a printer.
<Certificate>: Certificate variable
Name of the Certificate variable corresponding to the certificate that will be used to sign the duplicate.
Remarks

Printing a duplicate copy from the report viewer

If a duplicate has been requested before displaying the report in the report viewer, the duplicate will be generated when the print job is started from the report viewer.
If an annotation or an edit control is modified in the report viewer, a new duplicate copy will be generated during the next physical print.
If the print job is performed on several printers, a duplicate copy will be generated for each printer.
The configuration defined with the iParameterDuplicate is used for:
  • duplicates generated during the print job
  • duplicates generated by the "Duplicates" option () in the report viewer.
Notes:
  • The list of duplicate files created for the last print performed is returned by iLastFile.
  • To stop creating automatic duplicates from the report viewer, use iParameterDuplicate with the iDplNone constant.
  • To disable the option to create duplicates in the report viewer (), use iParameterViewer.
  • The duplicate copies are generated when printing on a printer only. Duplicates are not generated if the user uses one of the export options (pdf, email, etc.) available in the report viewer.
Component: wd300prn.dll
Minimum version required
  • Version 15
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/16/2025

Send a report | Local help