The ebs form cannot export Master-slave relationship (Master Detail) data to EXCEL.
The following describes how to solve the problem that the EBS standard export function cannot export master-slave relationship data.
Solution:
1. Add an export button on form or register a menu item on the toolbar.
2. Create a report or imitate the standard export function of the system. Then, use the preceding buttons or menu items to directly call the interface.
This section describes the function of imitating system standard export.
Steps:
1. directly modify form-Level trigger EXPORT and comment out the default app_standard.event ('expiport. Copy the following code.
- /* Export the COST of the master-slave structureGROUPData. */
- DECLARE
- -- Copy the preceding five variables.
- URL VARCHAR2 (2000 );
- DB_FILE NUMBER;
- WEB_SERVER_PREFIX VARCHAR2 (255 );
- Res boolean;
- MIME_TYPE VARCHAR2 (255 );
- Rochelle ziation_id NUMBER;
- -- Define a CURSOR that contains master-slave relationship data
- CURSORCSR (V_ORGANIZATION_IDINNUMBER)IS
- SELECTCST. COST_GROUP_CODE,
- CST. COST_GROUP_DESCRIPTION,
- CST. COST_GROUP_DISABLE_DATE,
- CAP. CAPABILITY,
- EQP. EQP_CAP_DESC DESCRIPTION,
- CAP. ACTIVE
- FROMCUX2_CST_COST_GROUP_ALL CST,
- CUX2_CST_COST_GROUP_EQPS_ALL CAP,
- CUX2_BOM_EQP_CAP_TYPE EQP
- WHERECAP. COST_GROUP_ID (+) = CST. COST_GROUP_ID
- ANDEQP. EQP_CAP_CODE (+) = CAP. CAPABILITY
- ANDEQP. ORGANIZATION_ID (+) = CAP. ORGANIZATION_ID
- ANDCAP. ORGANIZATION_ID (+) = CST. ORGANIZATION_ID
- ANDCST. ORGANIZATION_ID = V_ORGANIZATION_ID
- ORDER BYCST. ORGANIZATION_ID, CST. COST_GROUP_CODE, CAP. CAPABILITY;
- BEGIN
- -- Get Organzition_id
- L_ORGANZIATION_ID: = FND_PROFILE.VALUE ('Mfg _ ORGANIZATION_ID');
- -- Change the mouse style: funnel mouse (busy)
- SET_APPLICATION_PROPERTY (CURSOR_STYLE,'Busy');
- -- Display the progress bar window and set the progress to 0
- App_progress progress SS (0 );
- -- Create a data packet and set the file header type.
- DB_FILE: = FND_GFM.FILE_CREATE (CONTENT_TYPE =>'Text/html',
- PROGRAM_NAME =>'Port');
- /* The system standard export function exports item data only in the currently focused BLOCK.
- When a custom FORM contains two blocks with a master-slave relationship, the system standard export cannot export master-slave data.
- The text format after the study system standard export is as follows:
- CostGroupCode CostGroupDescription CostGroupDisableDate
- Test-1 a test costGroupCode 2011-09-09
- Test-2 another codstGroupCode 2011-10-10
- .......
- ...
- ..
- The title header of the first action. The long-distance blank area in the middle is the tab character, that is, chr (9 ),
- In the next data row, the delimiter between data columns is tab.
- It is easy to find out the rules and imitate the exported data.
- */
- -- Output question header line Note: chr (9) is the tab key
- FND_GFM.FILE_WRITE_LINE (DB_FILE,
- 'Cost Group Code'| CHR (9) |
- 'Cost Group description'| CHR (9) |
- 'Cost Group Disable date'| CHR (9) |
- 'Capable'| CHR (9) |'Description'| CHR (9) |
- 'Active');
- -- Loop data rows
- FORRINCSR (L_ORGANZIATION_ID) LOOP
- FND_GFM.FILE_WRITE_LINE (DB_FILE,
- R. COST_GROUP_CODE | CHR (9) |
- R. COST_GROUP_DESCRIPTION | CHR (9) |
- TO_CHAR (R. COST_GROUP_DISABLE_DATE,
- 'Yyyy-MM-DD HH24: MI: ss') | CHR (9) |
- R. CAPABILITY | CHR (9) | R. DESCRIPTION |
- CHR (9) | R. ACTIVE );
- ENDLOOP;
- -- Disable data packets
- DB_FILE: = FND_GFM.FILE_CLOSE (DB_FILE );
- -- Submit the data packet to the client
- URL: = FND_GFM.CONSTRUCT_DOWNLOAD_URL (WEB_SERVER_PREFIX, DB_FILE,TRUE);
- -- DBMS_OUTPUT.PUT_LINE (URL );
- -- Enable URL download
- FND_UTILITIES.OPEN_URL (URL );
- -- Change the mouse style: Default pointer (regular state)
- SET_APPLICATION_PROPERTY (CURSOR_STYLE,'Default');
- App_progress progress SS (1 );-- Display the progress bar window and set the progress to 1 (100%)
- END;
Effect:
This method is compared with the method used to run requests. I personally feel that this method is faster. Just my opinion .....
OK.