PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • When should iDestination be used?
  • Android: Printing in PDF format
  • Printing in PDF format
  • Printing in PDF format
  • End of print
  • Printing via Bluetooth
  • Operating mode in GO mode and at run time
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
Configures the print destination.Configures and returns the print destination.
You have the ability to print:
  • on the printer directly (syntax 1 and 2).
    Windows Mobile In this version, the print can be performed on a PCL printer only.
  • in a file in text, HTM, RTF, PDF, PRN or XML format (syntax 3).
    Windows Mobile In this version, the print can be performed in a PCL file only.

    AndroidiPhone/iPad In this version, the print can be performed in a PDF file only. AndroidiPhone/iPadUniversal Windows 10 App In this version, the print can be performed in a PDF file only.
  • Versions 15 and later
    a duplicate copy directly (syntax 4).
    New in version 15
    a duplicate copy directly (syntax 4).
    a duplicate copy directly (syntax 4).
  • on a fax directly (syntax 5 and 6, sending a report to a fax number for example). See Sending faxes for more details.
    Windows Mobile This feature is not available in this version.
Versions 18 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 18
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 19 and later
Android Widget This function is now available in Android Widget mode.
Android This function is now available for Android applications.
New in version 19
Android Widget This function is now available in Android Widget mode.
Android This function is now available for Android applications.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for Android applications.
AndroidAndroid Widget iPhone/iPad Only the prints in PDF format are available.
AndroidAndroid Widget iPhone/iPadUniversal Windows 10 App Only the prints in PDF format are available.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
Windows Mobile
// PCL printer to use
iDestination(iPCL, "\\MyNetwork\MyPrinter")
// Print in PCL format: iDestination(iPCL, "\My documents\MyFile.PCL")
Syntax
WINDEV Mobile

Printing on a PCL printer directly Hide the details

iDestination(<iPCL> , <Printer to use>)
<iPCL>: Constant
iPCL: Constant used to print on a PCL printer directly.
Caution: you cannot print in landscape mode on a PCL printer.
<Printer to use>: Character string (with quotes)
Path and name of PCL printer used. This printer must be accessible.
If this printer is associated with the infrared port of Pocket PC, this parameter must correspond to:
  • the "IRDA:" string: if a single printer is enabled on the infrared port during the print.
  • the "IRDA:<Printer to use>" string: if several printers are enabled on the infrared port during the print.
If this printer is accessible via Bluetooth, this parameter must correspond to "<Name of virtual outgoing port of Bluetooth>:".
If several printers are using the Bluetooth technology, a window allowing the user to choose a printer will be displayed during the print. See remarks for more details.
If this printer is accessible via Wi-Fi or network, this parameter must correspond to the name and UNC path of printer.

Printing in a file (HTM, PCL, PDF, PRN, RTF, XLS, XML, ...) Hide the details

iDestination([<Type of destination file> [, <Name of file to create>]])
<Type of destination file>: Optional integer constant
Used to configure the type of file to create:
Versions 23 and later
iEmailPDF
New in version 23
iEmailPDF
iEmailPDF
Direct print in a PDF file and open the messaging software on the current computer.
This PDF file is directly attached to a new email created by using the MAPI client installed by a messaging software of the current computer. The MAPI client and the application must be installed in the same compilation mode (32/64 bits).
The file will be named <Report name>.PDF (where <Report name> corresponds to the report name defined in the report editor). This file is created in the application directory. If <Name of file to create> is specified, the file name will be <Name of file to create>.PDF.
Note: You have the ability to configure the elements of the created email with iParameterExport.
AndroidAndroid Widget iPhone/iPadWindows MobileUniversal Windows 10 App This constant is not available.
iFileDirect print in a text file. The file will be named <Report name>.TXT (where <Report name> corresponds to the name of report defined in the report editor). This file is created in the application directory. If <Name of file to create> is specified, the file name will be <Name of file to create>.TXT.
Caution: the printer setting is very important. See remarks.
AndroidAndroid Widget iPhone/iPadWindows MobileUniversal Windows 10 App This constant is not available.
iGenericFileDirect print in a text file. The file will be named <Report name>.TXT (where <Report name> corresponds to the name of report defined in the report editor). This file is created in the application directory. If <Name of file to create> is specified, the file name will be <Name of file to create>.TXT.
This print mode does not use the current print driver so that an identical result is guaranteed from one computer to another.
AndroidAndroid Widget iPhone/iPadWindows MobileUniversal Windows 10 App This constant is not available.
iPrinterFileDirect print in a PRN file (<Name of file to create> file). <Name of file to create> must contain the full name of PRN file.
Caution: the printer setting is very important. See remarks.
AndroidAndroid Widget iPhone/iPadWindows MobileUniversal Windows 10 App This constant is not available.
iHTMLDirect print in an HTML file while using a style sheet. The file will be named <Report name>.HTM (where <Report name> corresponds to the report name defined in the report editor). This file is created in the application directory.
This print mode must be used to support the layers in the HTML pages.
If <Name of file to create> is specified, the file name will be <Name of file to create>.HTM. No preview will be displayed.
Caution: the printer setting is very important. See remarks.
AndroidAndroid Widget iPhone/iPadWindows MobileUniversal Windows 10 App This constant is not available.
iGenericHTMLDirect print in an HTML file while using a style sheet. The file will be named <Report name>.HTM (where <Report name> corresponds to the report name defined in the report editor). This file is created in the application directory.
This print mode must be used to manage the layers in the HTML pages.
If <Name of file to create> is specified, the file name will be <Name of file to create>.HTM. No preview will be displayed.
This print mode does not use the current print driver so that an identical result is guaranteed from one computer to another.
AndroidAndroid Widget iPhone/iPadWindows MobileUniversal Windows 10 App This constant is not available.
iHTMLWithoutCSSDirect print in an HTML file without using a style sheet. The file will be named <Report name>.HTM (where <Report name> corresponds to the report name defined in the report editor). This file is created in the application directory.
This print mode does not support layers in the HTML pages.
If <Name of file to create> is specified, the file name will be <Name of file to create>.HTM. No preview will be displayed.
Caution: the printer setting is very important. See remarks.
AndroidAndroid Widget iPhone/iPadWindows MobileUniversal Windows 10 App This constant is not available.
iGenericHTMLWithoutCSSDirect print in an HTML file without using a style sheet. The file will be named <Report name>.HTM (where <Report name> corresponds to the report name defined in the report editor). This file is created in the application directory.
This print mode does not support layers in the HTML pages.
If <Name of file to create> is specified, the file name will be <Name of file to create>.HTM. No preview will be displayed.
This print mode does not use the current print driver so that an identical result is guaranteed from one computer to another.
AndroidAndroid Widget iPhone/iPadWindows MobileUniversal Windows 10 App This constant is not available.
iPCLDirect print in a PCL file (<Report name>.PCL file created in the application directory).
If <Name of file to create> is specified, the file name will be <Name of file to create>.PCL.
AndroidAndroid Widget iPhone/iPadWindows MobileUniversal Windows 10 App This constant is not available.
iPDFDirect print in a PDF file. The file will be named <Report name>.PDF (where <Report name> corresponds to the report name defined in the report editor). This file is created in the application directory.
If <Name of file to create> is specified, the file name will be <Name of file to create>.PDF.
AndroidAndroid Widget Windows Mobile This constant is not available.
iGenericPDFDirect print in a PDF file. The file will be named <Report name>.PDF (where <Report name> corresponds to the report name defined in the report editor). This file is created in the application directory.
If <Name of file to create> is specified, the file name will be <Name of file to create>.PDF.
Caution: The maximum format is the A4 format.
This print mode does not use the current print driver so that an identical result is guaranteed from one computer to another.
Android The PDF prints support the standard Adobe fonts only (no Unicode format): Courrier, Helvetica, Times, Symbol and ZapFDingbats.
Windows Mobile This constant is not available.
iRTFDirect print in a RTF file. The file will be named <Report name>.RTF (where <Report name> corresponds to the report name defined in the report editor). This file is created in the application directory.
If <Name of file to create> is specified, the file name will be <Name of file to create>.RTF. No preview will be displayed.
Caution: the printer setting is very important. See remarks.
AndroidAndroid Widget iPhone/iPadWindows MobileUniversal Windows 10 App This constant is not available.
iGenericRTFDirect print in a RTF file. The file will be named <Report name>.RTF (where <Report name> corresponds to the report name defined in the report editor). This file is created in the application directory.
If <Name of file to create> is specified, the file name will be <Name of file to create>.RTF. No preview will be displayed.
This print mode does not use the current print driver so that an identical result is guaranteed from one computer to another.
AndroidAndroid Widget iPhone/iPadWindows MobileUniversal Windows 10 App This constant is not available.
iXLSDirect print in an XLS file. The file will be named <Report name>.XLS (where <Report name> corresponds to the report name defined in the report editor). This file is created in the application directory.
If <Name of file to create> is specified, the file name will be <Name of file to create>.XLS. No preview will be displayed.
AndroidAndroid Widget iPhone/iPadWindows MobileUniversal Windows 10 App This constant is not available.
iGenericXLSDirect print in an XLS file. The file will be named <Report name>.XLS (where <Report name> corresponds to the report name defined in the report editor). This file is created in the application directory.
If <Name of file to create> is specified, the file name will be <Name of file to create>.XLS. No preview will be displayed.
This print mode does not use the current printer driver so that an identical result is guaranteed from a computer to another one.
AndroidAndroid Widget iPhone/iPadWindows MobileUniversal Windows 10 App This constant is not available.
iXMLDirect print in an XML file. The file will be named <Report name>.XML (where <Report name> corresponds to the report name defined in the report editor). This file is created in the application directory.
If <Name of file to create> is specified, the file name will be <Name of file to create>.XML. No preview will be displayed.
AndroidAndroid Widget iPhone/iPadWindows MobileUniversal Windows 10 App This constant is not available.
iGenericXMLDirect print in an XML file. The file will be named <Report name>.XML (where <Report name> corresponds to the report name defined in the report editor). This file is created in the application directory.
If <Name of file to create> is specified, the file name will be <Name of file to create>.XML. No preview will be displayed.
This print mode does not use the current print driver so that an identical result is guaranteed from one computer to another.
AndroidAndroid Widget iPhone/iPadWindows MobileUniversal Windows 10 App This constant is not available.
<Name of file to create>: Optional character string
Name of generated file. If this parameter is not specified, the name of generated file corresponds to "Report Name". When printing in PRN format (with the iPrinterFile constant), the full name of file to create must be specified.
Remarks

When should iDestination be used?

iDestination must be the first print function called. It must be called before iPrint, iCreateFont, etc. However, iDestination must be called after iConfigure or iParameter.
Note: iDestination can be called before printing a report (with iPrintReport) to choose the print destination.
AndroidAndroid Widget

Android: Printing in PDF format

By default, if iDestination is not called before starting a print in PDF format, a "document.pdf" file will be generated in the directory of application files.
If you must open the PDF document generated by the print functions with an external application (by using ShellExecute for example), this document must be found on the external memory of the device (sdcard for example) in order to be accessible by the other applications.
Example:
iDestination(iGenericPDF, CompleteDir(SysDirStorageCard()) + "document.pdf")
Caution: The PDF prints support the standard Adobe fonts only (no Unicode format): Courrier, Helvetica, Times, Symbol and ZapFDingbats.
AndroidAndroid Widget iPhone/iPad

Printing in PDF format

The generated PDF file can be directly printed by iPrintPDF.
AndroidAndroid Widget iPhone/iPad

Printing in PDF format

The generated PDF file can be directly printed by iPrintPDF.
iPhone/iPadWindows Mobile

End of print

iEndPrinting must necessarily be called to end the print except after a call to iPrintReport.
The next prints will be performed on the printer except if iDestination is run again.
Windows Mobile

Printing via Bluetooth

To print via Bluetooth, you must:
  • use a PCL printer.
  • use a printer that supports the Bluetooth serial layer.
  • know the name of the Bluetooth virtual outgoing port. This name can be retrieved from the Bluetooth settings of the PC/Pocket PC or from the documentation of the PC/Pocket PC.
    In most cases, this name corresponds to "COM8:".
See Printing via Bluetooth for more details.
Windows Mobile

Operating mode in GO mode and at run time

In GO mode (simulation on the development computer), a WLanguage error is generated during the call to iDestination.
The differences between GO mode (simulator) and real use are presented in Differences between GO mode and real use.
Component : wd240prn.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Exemplo IDestination
Exemplo IDestination
iDestination(iHTML,"E:\aleva\_relatorios\RelatoriosBanco.htm")
iPrintReport(RPT_bancos)
iDestination(iPDF,"E:\aleva\_relatorios\RelatoriosBanco.pdf")
iPrintReport(RPT_bancos)
iDestination(iHTMLWithoutCSS,"E:\aleva\_relatorios\RelatoriosBanco_1.htm")
iPrintReport(RPT_bancos)
iDestination(iRTF,"E:\aleva\_relatorios\RelatoriosBanco.rtf")
iPrintReport(RPT_bancos)
iDestination(iXLS,"E:\aleva\_relatorios\RelatoriosBanco.xls")
iPrintReport(RPT_bancos)
iDestination(iXML,"E:\aleva\_relatorios\RelatoriosBanco.xml")
iPrintReport(RPT_bancos)

//Blog com Video e Exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/08/windev-curso-relatorio-27-relatorio.html
https://www.youtube.com/watch?v=8LH2uCBAkFs
De matos AMARILDO
01 Aug. 2016
Exemplo Relatorio Pdf
IF CBOX_GeraPdf=True THEN
iDestination(iPDF,"Relatorio_Nome.pdf")
SINON
iPreview(ipvZoomPageWidth)
FIN
//pergunta se quer relatorio
filtro_data_inicial = EDT_data_inicial
filtro_data_final = EDT_data_Final
IF CBOX_Relatorio_Grafico = 1 THEN // Imprime com gráfico
iPrintReport(RPT_Material_Relatorio_Curva_ABC,filtro_data_inicial,filtro_data_final,1)
SINON // Imprime sem gráfico
iPrintReport(RPT_Material_Relatorio_Curva_ABC,filtro_data_inicial,filtro_data_final)
FIN
//Abrir pdf
IF CBOX_GeraPdf=True THEN
IF YesNo("Deseja Abrir Relatorio") THEN
ShellExecute("Relatorio_Nome.pdf")
FIN
END
//Blog com Video e Exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/02/windev-curso-relatorio-20-relatorio.html
De matos AMARILDO
26 Feb. 2016