🔹 Join the OracleApps88 Telegram Group - Stay up to date with the latest on Oracle EBS R12 and Oracle Cloud/Fusion Applications. 📌 Telegram Group : https://t.me/OracleApps88

💡 Facing issues copying code/scripts or viewing posts? We're here to help!
📬 Contact on Telegram : https://t.me/apps88
📱 Telegram/WhatsApp: +91 905 957 4321
📧 Email Support: OracleApp88@Yahoo.com

Tuesday, March 29, 2016

How To Insert Images and Logo in the XML Publisher Reports and Documents

XML/BI Publisher supports several methods for including images in published documents.
Please perform any of the following methods: 

1) URL Reference
* Insert a dummy image in the template.
* In the Format Picture dialog box select the Web tab.
* Enter the following syntax in the Alternative text region to reference the image URL:
* url:{'http://image location'}
e.g.: url:{'http://www.oracle.com/images/ora_log.gif'}

2) OA Media Directory Reference
* Insert a dummy image in the template.
* In the Format Picture dialog box select the Web tab.
* Enter the following syntax in the Alternative text region to reference the OA_MEDIA directory:
url:{'{OA_MEDIA}/IMAGE_FILE'}
e.g: url:{{OA_MEDIA}/ORACLE_LOGO.gif'}

3) Element Reference from XML File
* Insert a dummy image in the template.
* In the Format Picture dialog box select the Web tab.
* Enter the following syntax in the Alternative text region to reference the image URL:
url:{IMAGE_LOCATION}
where IMAGE_LOCATION is an element from the XML file that holds the full URL to the image.
* Another option is to build a URL based on multiple elements at runtime. Just use the concat function to build the URL string.
e.g.: Syntax: url:{concat('$[OA_MEDIA]/',.//IMAGE_FILE)}
* This method can also be used with the OA_MEDIA reference as follows:
url:{concat('$[OA_MEDIA]/',.//IMAGE_FILE)}

4) Rendering an Image Retrieved from BLOB Data
If the data source is an XML/BI Publisher Data Template and the resulting XML contains image data that had been stored as a BLOB in the database, use the following
syntax in a form field inserted in your template where you want the image to render at runtime:
<fo:instream-foreign-object content type="image/jpg">
<xsl:value-of select="IMAGE_ELEMENT"/>
</fo:instram-foreign-object>

where
           image/jpg
is the MIME type of the image (other options might be: image/gif and image/png)
and

          IMAGE_ELEMENT
is the element name of the BLOB in your XML data.

Note:  Height and width attributes can be specified for the image to set its size in the published report. XML/BI Publisher will scale the image to fit the box size defined.
For Example:  To set the size of the example above to three inches by four inches, enter the following:
 <fo:instream-foreign-object content type="image/jpg" height="3 in" width="4 in">
<xsl:value-of select="IMAGE_ELEMENT"/>
</fo:instram-foreign-object>
Specify in pixels as follows:
<fo:instream-foreign-object content type="image/jpg" height="300 px" width="4 px">

or in centimeters:
<fo:instream-foreign-object content type="image/jpg" height="3 cm " width="4 cm">

or as a percentage of the original dimensions:
<fo:instream-foreign-object content type="image/jpg" height="300%" width="300%">


Sunday, March 27, 2016

Oracle PL/SQL Bulk Collect Example

--> This script illustrates several different BULK_COLLECT statements, used for bulk binds

set serveroutput on format wrapped

DECLARE
  TYPE t_Numbers IS TABLE OF temp_table.num_col%TYPE;
  TYPE t_Strings IS TABLE OF temp_table.char_col%TYPE;
  v_Numbers t_Numbers := t_Numbers(1);
  v_Strings t_Strings := t_Strings(1);
  v_Numbers2 t_Numbers;
  v_Strings2 t_Strings;

  CURSOR c_char IS
    SELECT char_col
    FROM temp_table
    WHERE num_col > 800
    ORDER BY num_col;

BEGIN
  -- First load temp_table with 1500 rows, 500 of which are duplicates.
  v_Numbers.EXTEND(1500);
  v_Strings.EXTEND(1500);
  FOR v_Count IN 1..1000 LOOP
    v_Numbers(v_Count) := v_Count;
    v_Strings(v_Count) := 'Element #' || v_Count;
    IF v_Count > 500 THEN
      v_Numbers(v_Count + 500) := v_Count;
      v_Strings(v_Count + 500) := 'Element #' || v_Count;
    END IF;
  END LOOP;

  DELETE FROM temp_table;
  FORALL v_Count IN 1..1500
    INSERT INTO temp_table (num_col, char_col)
      VALUES (v_Numbers(v_Count), v_Strings(v_Count));

  -- Grab all of the rows back into the nested tables in one operation.
  SELECT num_col, char_col
    BULK COLLECT INTO v_Numbers, v_Strings
    FROM temp_table
    ORDER BY num_col;

  DBMS_OUTPUT.PUT_LINE(
    'First query fetched ' || v_Numbers.COUNT || ' rows');

  -- The table does not have to be initialized, the BULK COLLECT will add elements as needed:
  SELECT num_col
    BULK COLLECT INTO v_Numbers2
    FROM temp_table;

  DBMS_OUTPUT.PUT_LINE(
    'Second query fetched ' || v_Numbers2.COUNT || ' rows');

  -- We can bulk fetch from a cursor as well.
  OPEN c_char;
  FETCH c_char BULK COLLECT INTO v_Strings2;
  CLOSE c_char;

  DBMS_OUTPUT.PUT_LINE(
    'Cursor fetch retrieved ' || v_Strings2.COUNT || ' rows');
END;
/

DECLARE
  TYPE t_Numbers IS TABLE OF temp_table.num_col%TYPE
    INDEX BY BINARY_INTEGER;
  TYPE t_Strings IS TABLE OF temp_table.char_col%TYPE
    INDEX BY BINARY_INTEGER;
  v_Numbers t_Numbers;
  v_Strings t_Strings;
BEGIN
  -- Delete from the table, and then insert 55 rows.  Also set up t_Numbers here.
  DELETE FROM temp_table;
  FOR v_Outer IN 1..10 LOOP
    FOR v_Inner IN 1..v_Outer LOOP
      INSERT INTO temp_table (num_col, char_col)
        VALUES (v_Outer, 'Element #' || v_Inner);
    END LOOP;
    v_Numbers(v_Outer) := v_Outer;
  END LOOP;

  -- Delete some of the rows, but save the character data.
  FORALL v_Count IN 1..5
    DELETE FROM temp_table
      WHERE num_col = v_Numbers(v_Count)
      RETURNING char_col BULK COLLECT INTO v_Strings;

  -- v_Strings now contains 15 rows, which is 1+2+3+4+5.
  DBMS_OUTPUT.PUT_LINE('After delete:');
  FOR v_Count IN 1..v_Strings.COUNT LOOP
    DBMS_OUTPUT.PUT_LINE(
      '  v_Strings(' || v_Count || ') = ' || v_Strings(v_Count));
  END LOOP;
END;
/


Thursday, March 24, 2016

Oracle Reports Interview Questions and Answers (FAQS)

How do you register a report in oracle application? What are the triggers we need change in the template.fmb?
1. We will develop the report through report 6i.
2. We will move that report from local machine to oracle apps server for example if it is the Po module the path is PO/11.5/reports/us/xx.rdf
3.we will create executable from sysadmin responsibility.
4. We will create concurrent program from sysadmin responsibility and attach executable, incompatibilities, parameters.
5. We will create request group and attach concurrent program.
6. We will create responsibility and attach request group.
7. We will attach responsibility to user.
8. User will submit concurrent program from srs window.
We will modify
pre_form trigger, when_new_form_instance, app_custom package we need to change in template.fmb

Mandatory Parameters in Oracle Apps Reports?
P_CONC_REQUEST_ID is one of the mandatory parameter Oracle Reports Interview Questions

1. Name the report triggers.
Before Parameter
After Parameter
Before Report
Between Pages
After Report

2. What are bind parameter and lexical parameter used for?
A bind reference replaces a single value or expression. To create a bind reference in a query, prefix the parameter name with a colon (:).

A lexical reference is a text string and can replace any part of a SELECT statement, such as column names, the FROM clause, the WHERE clause, or the ORDER BY clause. To create a lexical reference in a query, prefix the parameter name with an ampersand (&).

3. Give an example of the implementation of between pages trigger in reports.
The total printed at the bottom of first page has to be carried to the top of the next page.

4. The total printed at the bottom of first page has to be carried to the top of the next page. How do u do this technically?
Use Between pages trigger to copy the value from previous page to current page.

5. How do you resolve the following layout issues in reports?
1. There are 14 columns altogether in a report, in reports developer all 14 columns are printed, but in apps only 10 columns are displayed, how can u solve this?
2. While printing, 10 columns are printing in first page and the next 4 cols in next page, how do u resolve this to accommodate all the 14 columns in a single page?

6. Where in reports do you set the context information (like org_id)?
SRW.INIT

7. What do you know about Placeholder column, formula columns, and summary columns?
A summary column performs a computation on another column's data.

A formula column is a user-created column that gets its data from a PL/SQL function or expression, a SQL statement, or a combination of these. A formula column performs a user-defined computation on the data of one or more column(s), including placeholder columns. A placeholder is a column for which you set the datatype and value in PL/SQL that you define. Placeholder columns are useful when you want to selectively set the value of a column

8. What are user exits in reports and name a few?
User exits provided a way to pass control from Reports Builder to a program you have written, which performs some function, and then returns control to Reports Builder.
SRW.DO_SQL,
SRW.USER_EXIT

9. How do you display only one record on each page in a report?
Give Page Break in the Format trigger of the repeating frame.

10. How do you print barcode in the reports?
By installing the Barcode Font and using the Chart field in the Layout.

11. What is SRW package and some procedures in SRW?
It is the standard reports package and it has many procedures like USER_EXITS, DO_SQL, RUN_REPORT, MESSAGE,TRACE, BREAK, SET_ATTR.

12. How do you write the report output to Excel file or text file?
   1. Use TEXT_IO package
   2. Use SPOOL in After Report trigger
   3. Use UTL Package

13. How do you call a concurrent program or another report from a report?
1. Use FND_SUBMIT.REQUEST() to call a concurrent program or a report.
2. Use SRW.RUN_REPORT() to run a report directly without registering it as a concurrent program.

14. How do you mail the output of a report?
1. Use UTL_SMTP (refer to Scripts tab for more details)
2. Use MAILX called in a shell script registered as a concurrent program with parameters File name and path.

15. What are the different sections in the Layout?
Header, Main, Trailer

16. How can you grey out/ highlight/hide some records based on conditions in a report?
Use Conditional formatting

17. What is Anchor in reports?
Anchors fasten an edge of one object to an edge of another object, ensuring that they maintain their positions relative to its parent.

18. What is the difference between Conditional Formatting and format trigger?
Both provide the same functionality, used to format the output based on particular conditions. Format triggers provide a wide variety of options when compared to conditional formatting.

Definitions:
Using the Conditional Formatting and Format Exception dialog boxes, you can specify output formatting attributes (font and color) for a selected layout object based on conditions that exist. The conditions that you define are called format exceptions.

Format triggers are PL/SQL functions executed before the object is displayed. The trigger can be used to dynamically change the formatting attributes of the object. The function must return a Boolean value (TRUE or FALSE).
If you are facing any issues while copying the Code/Script or any issues with Posts, Please send a mail to OracleApp88@Yahoo.com or message me at @apps88 or +91 905 957 4321 in telegram.
Best Blogger TipsGet Flower Effect