Command for generating in files via the form generator of EPLAN 21.
The generated files are to be understood as a sequence of records. The line end (byte sequence "0x0D 0x0A") is always used as the record separator. If the record separator occurs in fields, it is replaced by " " (blank). A record is a sequence of fields. The field separator and the substitute for field separators, which occur in the fields, can be set. Fields can optionally be set in quotes. The first record can optionally contain the field names. Collecting, filtering and sorting function exactly as in the generation of pages.
This command has a lot of settings in common with the command EPLAN.EPLAN21.FORMGEN.GENERATE_PAGE. The parameters that are used in common have the prefix EPL_PARAM_FORMGEN_GENERATE_BASE_. These parameters are documented in the command EPLAN.EPLAN21.FORMGEN.GENERATE_PAGE.
The following parameters have the prefix EPL_PARAM_FORMGEN_GENERATE_FILE_.
ParameterID | Type | Description |
---|---|---|
FILENAME |
[IN] String |
Name of the file to be generated. Caution: The file is overwritten without a prompt. If the file name is specified without a path, the file is saved in the EPLAN 21 export directory. The form under the property EPL_PROPERTY_FORM_FILEOPT_FILENAME (property 6023) contains a suggestion for this parameter. |
FIELDSEP |
[IN] String |
String which is used as a field separator. The form under the property EPL_PROPERTY_FORM_FILEOPT_FIELDSEP (Property 6018) contains a suggestion for this parameter. |
SUBST_FOR_FIELDSEP |
[IN] String |
String which can be substituted for the field separators occurring in the fields. The form under the property EPL_PROPERTY_FORM_FILEOPT_SUBST_FOR_FIELDSEP (property 6019) contains a suggestion for this parameter. |
DISPLAY_FIELDNAMES |
[IN] Boolean |
Specifies whether the field names of the first record are to be written out. The form under the property EPL_PROPERTY_FORM_FILEOPT_DISPLAY_FIELDNAMES (Property 6020) contains a suggestion for this parameter. |
QUOTE_FIELDNAMES |
[IN] Boolean |
Specifies whether the field names are to be set in quotes. The form under the property EPL_PROPERTY_FORM_FILEOPT_QUOTE_FIELDNAMES (property 6021) contains a suggestion for this parameter. |
QUOTE_FIELDS |
[IN] Boolean |
Specifies whether the field data are to be set in quotes. The form under the property EPL_PROPERTY_FORM_FILEOPT_QUOTE_FIELDS (property 6024) contains a suggestion for this parameter. |
SUBST_FOR_QUOTES |
[IN] String |
String which can be substituted for the quotes occurring in the fields. The form under the property EPL_PROPERTY_FORM_FILEOPT_SUBST_FOR_QUOTES (property 6022) contains a suggestion for this parameter. |
The eplExecuteCommand function returns EPL_OK if the objects could be successfully exported.
If the command fails, eplExecuteCommand returns the value EPL_ERROR. In this case, the error log can contain the following errors:
ErrorID | Description |
---|---|
EPL_ERR_GENERAL | An unexpected exception error has occurred. |
EPL_ERR_CANCELED | The process was aborted by the user. |
EPL_ERR_FG_FORM_INVALID | No form could be found for the form name specified. |
EPL_ERR_FG_FORMTYPE_INVALID | The specified form has a form type not supported by the form generator (form property 6001). The creator of the form can enter any page type as the type: However, only a subset of all the page types can be processed by the form generator. Example: Forms of the "Free graphics" form type cannot be used for generation. |
EPL_ERR_FG_PROJECT_INVALID | The project handle is invalid. |
EPL_ERR_NO_RIGHT | The current user group is not allowed to generate files. |
void generateFile(EplSession s) { EplHandle cmd = eplCreateCommand(s, L"EPLAN.EPLAN21.FORMGEN.GENERATE_FILE"); //Name of output file: eplSetParam(s, cmd, EPL_PARAM_FORMGEN_GENERATE_FILE_FILENAME, L"report.txt", 0); if (eplExecuteCommand(s, cmd) == EPL_OK) { // Read out return parameters ... } eplCloseObject(s, cmd); } |