DT_Customized_Export_phase _02
Requirement Features:
Product Line: | Microsiga Protheus®: |
Industry: | Legal |
Module: | SIGAJURI |
Routine: | Routine | Technical Name | JURA108 | Customized Export |
Routine(s) involved | Technical Name | JURA023 | Customized export fields | JURXFUN | Generic function SIGAJURI /SIGAPFS |
|
Initial Registration: | Register of formulas (JURA108) |
Request (ISSUE): | PCREQ-5814 |
Country(ies) | All |
Database: | All |
Tables: | NZJ |
Operational system(s): | WINDOWS |
Versions/Release: | 12.1:7 |
Description
It enables uses to add formulas as field options to Customized Export.
The option to develop functions () receiving parameters previously registered in formulas register (Configuration/Customized export JURA023).
Display the functions in fields list of Customized Export. And, when selected, the return of functions is displayed in the file generated in Customized Export.
How formula must be registered?
As a Function or User Function in the RPO of Protheus. Remember its name cannot exceed 09 characters.
Added to formulas register (Configuration / Customized Export JURA023)
Formulas Register |
Description | Function | Parameters |
Concatenated Involved | FEXP_ENVC | NUQ_CAJURI, ‘1’ |
Description: Name of field displayed in the spreadsheet and in the list of Customized Export fields.
Formula: Name of Function or User Function;
Parameters: List of parameters separated by comma. For fields, enter name without inverted commas. For text, add information by using inverted commas.
How Function must be written
Function receives parameters according to formulas register.
Example:
USER FUNCTION FEXP_ENVC (cCajuri, cTipo)
Local cRet := ‘’
Local aArea := GetArea()
Local cLista := GetNextAlias()
Local cSQL
cSQL := “SELECT NT9.NT9_NOME FROM “ + RetSQLName(“NT9”) + “ NT9 ”
cSQL += “ WHERE NT9.NT9_CAJURI = ‘” + cCajuri + “’”
cSQL += “ AND NT9.NT9_FILIAL = ‘” + xFilial(‘NT9’) + “’”
cSQL += “ AND NT9.D_E_L_E_T_ = ‘ ‘”
cSQL := ChangeQuery(cSQL)
dbUseArea(.T., 'TOPCONN', TcGenQry( ,, cSQL ) , cLista, .T., .F.)
dbSelectArea(cLista)
(cLista)->(dbGoTop())
While (cLista)->(!Eof())
cRet += (cLista)->NT9_NOME
if ((cLista)->(!Eof())
cRet += “/”
Endif
(cLista)->(dbSkip())
End
(cLista)->( dbcloseArea() )
RestArea( aArea )
Return cRet
Procedures for Use
- In the module Legal Management (SIGAJURI), access Updates / Configuration / Customized Export (JURA108);
- Select table, click Edit;
- Click table and lower grid (Formulas);
- Register formula filling out the description, name of function created and Parameters needed for function.
Example:
Description: Concatenated Involved
Function: FEXP_ENVC
Parameters: NUQ_CAJURI,1 - After registering formulas, click Confirm;
- Access Updates / Legal Subjects / Search and select the search, fill out the filters, click Search.
- Click the mouse right button in the process, view message, then click Add process in printing queue;
- Right click the message, then Customized export;
- View the window with the question: The values correction routine has already been run?, if positive, click Yes;
- Select table(s) the formulas were registered.
- Add fields and/or formulas.
- Click Export.
- Select folder the file is generated, then define the file name.
- Click Save;
- A window is displayed indicating where the file was generated and the following question: Open file?
- If positive, click Yes.
- File in Excel format is opened.