Salesforce

DataViewToHTML (Magic xpa 2.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

DataViewToHTML (Magic xpa 2.x)

Creates an HTML file from the data view variables sent to it.

Syntax:

DataViewToHTML (generation, task var names, print var names, HTML file name, template file name, charset)

Parameters:

generation: Numeric. A number that represents the task's hierarchic position in the runtime task tree. 0 represents the current task, 1 its immediate ancestor, and so on.

task var names: Alpha. A comma-delimited list of all the names of the variables that will be exported.

print var names: Alpha. A comma-delimited list of all the field names of the variables that will be exported. If this string is empty, there will be no field headers. If the list is evaluated to ‘@’, then the engine will export the headers as defined in the task. If the name has a comma, it will be prefixed by the backslash (\) character.

HTML file name: Alpha. The name of the file that will be created.

template file name: Alpha. The name of the template file that will be used when creating the HTML file. This is optional.

charset: Numeric. Defines the character set for the outputted data. The following values are valid:

  • 0 – ANSI

  • 1 – Unicode

  • 2 – UTF-8

Returns:

Success – a logical value

Usage:

You can use this function in any of the following ways:

  1. In an Online or a Rich Client interactive task that browses the data – if you want to export the current data view.

  2. In a Batch or a Rich Client non-interactive task – if you want to export data without browsing it.

    In this case, since the function itself generates and scans the data view, the task that holds the data view definition can end without scanning the records. This task can be defined as follows:

  1. Define the Main Data Source with the data source and ranges on columns according to the data you want to export.

  2. Call the function in the Task Suffix logic unit.

  3. Set the End task condition to Yes and the Evaluate condition to Before entering record. This way the task will not scan all of the records.

Note:

  • If the HTML file cannot be created, the function will return False.

  • If the template file cannot be opened, it will be ignored.

  • If the Variable list is empty, the function will return False.

  • If the Variable Names list is empty, there will be no field headers.

  • If the Variable Names list is evaluated to ‘@’, then the engine will export the headers as defined in the task according to the Variable list.

  • If the Variable Names list is shorter than the variables, the subsequent variables will not have headers (i.e the headers will be empty).

  • If the Variable Names list is longer than the variables, the extra variable names will be ignored. If a name in the Task Vars List is an invalid field, the function will return False.

  • If a name in the Task Vars List is OLE, BLOB, .NET or Vector, the function will return False.

  • If the charset evaluates to an invalid value, 0 for ANSI will be assumed.

See also:

How Do I Export Data into an HTML File?

The Online and Rich Client Samples projects (program RP02, RP02b and RRP02, RRP02b)

Reference
Attachment 
Attachment