func X3.EN_CRYSTAL_PRINT(Char REPORT_IN, Char LANGUAGE_IN, Integer FORMAT_IN, Clbfile PATH_IN, Char() PARAM_TAB_IN, Char() VALUE_TAB_IN) : Tinyint

Starts a Crystal Reports print to a file on the server

  • REPORT_IN Char X3 report code to print
  • LANGUAGE_IN Char Language for printing
  • FORMAT_IN Integer Format of the file to generate:
    • 3 Word for Windows (*.doc)
    • 5 Rich Text (*.rtf)
    • 9 ASCII text
    • 10 Paginated ASCII text
    • 27 Microsoft Excel 97-2000 (*.xls)
    • 28 Microsoft Excel 97-2000 (extended) (*.xls)
    • 29 Adobe Acrobat (*.pdf)
    • 31 Microsoft Excel Workbook (extended) (*xlsx)
  • PATH_IN Clbfile Full path or volume to the file to generate
  • PARAM_TAB_IN Char() Array of parameters as defined in the report
  • VALUE_TAB_IN Char() Array of parameter values
Return Tinyint 1 if yes and 0 if no
Example

Launches the standard invoice report on an invoice number, in the current language and saves it in PDF in the tmp directory of the folder
Local Char TBPAR(30)(25)
Local Char TBVAL(60)(25)
Local Shortint NB
[L]NB=1

[L]TBPAR([L]NB) = "facturedeb" : [L]TBVAL([L]NB) = "ZAINV1404ZA011000004" : [L]NB+=1
[L]TBPAR([L]NB) = "facturefin" : [L]TBVAL([L]NB) = "ZAINV1404ZA011000004" : [L]NB+=1
[L]TBPAR([L]NB) = "codimp" : [L]TBVAL([L]NB) = "2" : [L]NB+=1

If func X3.EN_CRYSTAL_PRINT("SBONFACP", [V]GLANGUE, 29, filpath("tmp","report","pdf"), [L]TBPAR, [L]TBVAL)
Infbox "File created"
Else
Infbox "Error="+[V]GX3ERR
Endif