sc_set_export_name ("export_type", "file_name")
|
|
The files resulting from the exports made in the query are stored in thedirectory tmp (temporary)specified in the tool's settings.
Both in development and in production, files are stored with theprefix sc_ and a unique key. After a while, files with the prefix sc_ will be deleted.
To prevent the exported files from being deleted, it is possible to use this macro to rename them.
Parameter List
|
Parameter
|
Value
|
Description
|
|
"export_type"
|
String containing the export type, which must be protected by quotation marks.
Example of use in the macro.
"csv"
List of supported values:
- csv
- json
- pdf
- rtf
- xml
- xls
- word
|
Mandatory parameter, where we must inform the type of file we want to rename.
This parameter does not accept variables.
|
|
"filename"
|
String containing the name the file will receive.
Example of use in the macro:
"New file name"
Supported values
- String with the name
- Global variable
|
Mandatory parameter, where we must inform the name that the file will receive.
|
See below some examples of using the macro:
Example 1 - Defining a name for a PDF file
sc_set_export_name ("pdf", "meu_arquivo_pdf.pdf");
Example 2 - Defining a file name by passing the value through a global variable.
sc_set_export_name ("json", [glo_nome_json]);
|
Macro Scope
|
chart application
|
Grid application
|
| onInit
|
onApplicationInit onInit
|
|