Please Visit Our New Website for Further Communication

Amazon

Showing posts with label Oracle Reports. Show all posts
Showing posts with label Oracle Reports. Show all posts

27 Mar 2013

Page Break vs Page Protect

Page Break Before:

The Page Break Before property indicates that you want the object to be formatted on the page after the page on which it is initially triggered to print.  Note that this does not necessarily mean that all the objects below the object with Page Break Before will move to the next page.
Suppose that you want each instance of a repeating frame to be on a logical page by itself.  First, set Maximum Records Per Page to 1 for the repeating frame so that only one instance appears on each logical page.  Then, specify Page Break Before and Page Break After, to make sure that the first instance of the repeating frame starts on a new logical page.

Page Break After

The Page Break After property indicates that you want all children of the object to be moved to the next page.  In other words, any object that is a child object of an anchor (implicit or explicit) to this object will be treated as if it has Page Break Before set to Yes.  Note that this does not necessarily mean that all the objects below the object with Page Break After will move to the next page.
Suppose that you want each instance of a repeating frame to be on a logical page by itself.  First, set Maximum Records Per Page to 1 for the repeating frame so that only one instance appears on each logical page.  Then, specify Page Break Before and Page Break After, to make sure that the first instance of the repeating frame starts on a new logical page.

Page Protect:

The Page Protect property indicates whether to try to keep the entire object and its contents on the same logical page.  Setting Page Protect to Yes means that if the contents of the object cannot fit on the current logical page, the object and all of its contents will be moved to the next logical page.
Suppose that you have a group report.  If at all possible, you would like to have all of the details and the master appearing on the same page.  To do this, you specify Page Protect for the master repeating frame (the outermost repeating frame).  If the details and the master cannot fit on the first page on which they are triggered to print, they will be triggered to print on the next page instead.

Lexical Parameter

Lexical Parameters:
Lexical Parameters performs dynamic SQL query.
Use to change the data definition at runtime.
Use Lexical references to replace the clauses appearing after SELECT, FROM, WHERE, GROUP BY, ORDER BY, HAVING, CONNECT BY, and START WITH.
Denoted by ‘&’.
You cannot make lexical references in a PL/SQL statement. However, use a bind Reference in PL/SQL to set the value of a parameter that is then referenced lexically in SQL.
Code is written in AFTER PARAMETER FORM Trigger.


Example:
     DATA MODEL QUERY:
     Select * from emp where dept_id=10 &status-----lexical parameter

    CODING AT AFTER PARAMETER FORM
    Function AfterPForm return Boolean is
    BEGIN
    IF :status=’ALL’ Then
    :status:=’AND (STATUS IN (“P”,”N”) OR STATUS IS NULL)’;
    ELSIF :status=’P’ Then
    :status:=’AND STATUS=”P” ‘;
    ELSE
    Null;
    END IF;
    END;

25 Feb 2013

Report Builder Columns


Different Columns contained in Report Builder are:
1)      Data Columns
2)      Formula Columns
3)      Summary Columns
4)      Placeholder Columns

Data Columns:
Data Columns contain the data values for a report.
Data Columns are corresponding to the table columns included in the select list of a query.
Each column is placed in the group associated with the query.

Formula Columns:
Formula Columns performs user-defined computations.
Formula Columns executes a PL/SQL function and must return a value.
Formula Columns can be placed at the Report or Query level.
Formula Columns should not be used to set a parameter’s value.
Formula Columns is denoted by CF_

Summary Columns:
Summary Columns are used for calculating summary information like
1)      Sum
2)      Average
3)      Minimum
4)      Maximum
5)      Count
6)      First
7)      Last
8)      % of Total
9)      Std Deviation
10)  Variance
Summary Columns can be placed at the Report or Query level.
Summary Columns is denoted by CS_

Placeholder Columns:
Placeholder Columns are storage areas in the Data Model.
Used for Temporary storage of data for future reference.
Placeholder Columns value can be set in the following places:
1)      Before Report Trigger
2)      Report-Level Formula Columns
Placeholder Columns can be populated by a Before Report Trigger but are generally populated by a Formula.
Although Placeholders allow PL/SQL to be written within them, they cannot be self-populated, their value must be set by an external program Unit, any attempts at self-population will result in a runtime compilation error. However the Formula assigned to the Placeholder must return a value.
Placeholder Columns is denoted by CP_
Example: At Formula column:
     Function CF_1formula return Number is
     Begin
             If :no_in_stock<10 then
                 :CP_1:=’Only’||:no_in_stock||’Items left in stock!!’;
             End if;
               Return 1;
     End;
Example at Placeholder column:
     Function CP_1formula return Char is
     Begin
               Return null;
     End;