Skip to main content
Version: 2026.0

report

Methods

exportToBytes

exportToBytes(pReportName, pCondition, pExportFormat, pWhereOrder, pPrompts, pColumnNames, pData, pLocale): string

Exports a report on the server; the result is a byte array.

Parameters

pReportName
string | number | boolean

The report to be exported.

pCondition
any

The condition (sql) that specifies the records to be filtered. Can also be entered in the following format: [sql, [value1, value2, valuen]].

pExportFormat
number

The export format. See report.EXPORT_*.

pWhereOrder
string | number | boolean

Can only be used in the client context, i.e. not in server processes. Defines which conditions of the linked frame should be evaluated. Possible values are "o", "w", "wo"/"ow", "". "o": Only the ORDER clause of the frame will be evaluated. "w": Only the WHERE clause of the frame will be evaluated. "wo" / "ow": Both the WHERE clause and the ORDER clause will be evaluated. "": Neither the ORDER clause nor the WHERE clause will be evaluated.

pPrompts
any

Parameters are passed to the report; 'null' if no parameters are passed.

pColumnNames
string[]

If the report is static, specify the column names here. Otherwise 'null'.

pData
string[][]

The data, as a two-dimensional array (in case of a static report). Otherwise 'null'.

pLocale
string | number | boolean

The locale as a string.

Returns

string

The exported report, as a Base64-encoded byte[].

Throws

May throw an exception.

Example

var columnNames = ["QUANTITY", "YEAR", "MONTH"];
var data = db.table("select sum(ORDERITEM.QUANTITY), " + yearfromdate("SALESORDER.ORDERDATE") + " , "+ monthfromdate("SALESORDER.ORDERDATE")
+ " from ORDERITEM join SALESORDER on ORDERITEM.SALESORDER_ID = SALESORDERID group by " + yearfromdate("SALESORDER.ORDERDATE") + ", "+ monthfromdate("SALESORDER.ORDERDATE"));

var params = {};
var imgData = getMyASYS_ICONSdata();
params["myAddr"] = imgData[0];
params["adito.image.myLogo"] = imgData[1];
if ( pExport )
{
var doc = [];
doc[0] = "Auswertung.pdf"
doc[1] = report.exportToBytes("RPTJ_QUANTITY_3Y", null, report.REPORT_EXPORT_PDF, null, params, columnNames, data, null);
return doc;
}

exportToFile

exportToFile(pReportName, pCondition, pExportFormat, pExportFile, pWhereOrder, pPrompts, pColumnNames, pData, pWaitFor, pIdentifier, pLocale): void

Exports a report that exists on the server as a file.

Parameters

pReportName
string | number | boolean

The report to be exported.

pCondition
any

The condition (sql) that specifies the records to be filtered. Can also be entered in the following format: [sql, [value1, value2, valuen]].

pExportFormat
number

The export format. See report.EXPORT_*.

pExportFile
string | number | boolean

The file name of the export file.

pWhereOrder
string | number | boolean

Can only be used in the client context, i.e. not in server processes. Defines which conditions of the linked frame should be evaluated. Possible values are "o", "w", "wo"/"ow", "". "o": Only the ORDER clause of the frame will be evaluated. "w": Only the WHERE clause of the frame will be evaluated. "wo" / "ow": Both the WHERE clause and the ORDER clause will be evaluated. "": Neither the ORDER clause nor the WHERE clause will be evaluated.

pPrompts
any

Parameters are passed to the report; 'null' if no parameters are passed.

pColumnNames
string[]

If the report is static, specify the column names here. Otherwise 'null'.

pData
string[][]

The data, as a two-dimensional array (in case of a static report). Otherwise 'null'.

pWaitFor
boolean

'true' waits until the report has been exported; 'false' performs an export in the background.

pIdentifier
string | number | boolean

An identifier of the background export.

pLocale
string | number | boolean

The locale as a string.

Returns

void

Throws

May throw an exception.

Example

var params = {};
var imgData = getMyASYS_ICONSdata();
params["myAddr"] = imgData[0];
params["adito.image.myLogo"] = imgData[1];

report.exportToFile("RPTJ_ORGLIST", null, report.REPORT_EXPORT_TXT, "H:\\orglist.txt", null, params, null, null, false, "orglist", null);

Properties

REPORT_EXPORT_BMP

number

Export file format: BMP


REPORT_EXPORT_CSV

number

Export file format: CVS


REPORT_EXPORT_DOCX

number

Export file format: DOCX


REPORT_EXPORT_GIF

number

Export file format: GIF


REPORT_EXPORT_HTML

number

Export file format: HTML


REPORT_EXPORT_JPG

number

Export file format: JPG


REPORT_EXPORT_ODS

number

Export file format: ODS


REPORT_EXPORT_ODT

number

Export file format: ODT


REPORT_EXPORT_PDF

number

Export file format: PDF


REPORT_EXPORT_PNG

number

Export file format: PNG


REPORT_EXPORT_PPTX

number

Export file format: PPTX


REPORT_EXPORT_PS

number

Export file format: PS


REPORT_EXPORT_PS2

number

Export file format: PS2


REPORT_EXPORT_PS3

number

Export file format: PS3


REPORT_EXPORT_RTF

number

Export file format: RTF


REPORT_EXPORT_SVG

number

Export file format: SVG


REPORT_EXPORT_TXT

number

Export file format: TXT


REPORT_EXPORT_XLS

number

Export file format: XLS


REPORT_EXPORT_XLSX

number

Export file format: XLSX


REPORT_EXPORT_XML

number

Export file format: XML


REPORT_PARAM_CONDITION

string

Constant for report parameter names: condition


REPORT_PARAM_DATASOURCE_PREFIX

string

Constant for report parameter names: prefix for the data source


REPORT_PARAM_IMAGE_PREFIX

string

Constant for report parameter names: prefix for the image


REPORT_PARAM_ORDER

string

Constant for report parameter names: ORDER BY