Thursday, October 13, 2011

Layout Model: Multi Layout Reports

Description
There is always a necessity to provide users to run report in 
multiple languages. Say English, German, French.  

We have to develop such report with multiple layouts.


Example
Create 5 layouts each in a separate main frame.
Create these 5 main frames one below the other. No layout should cross x-axis and Y-axis. 
After that create one user parameter and write a format trigger on all the main frames. 
--In format trigger of first Main frame mention
-- for first layout to display
if :p_parameter = 1 then
 return true;
end if; 
--In format trigger of second Main frame mention
-- for Second layout to display
if :p_parameter = 2 then
 return true;
end if; 
Similarly write format triggers for all the remaining 3 main frames.
When you run the report, Based on the value you provide for p_parameter the format trigger 
will display only one frame
If You enter p_parameter value as 1 then first layout will
be displayed as output.
If You enter p_parameter value as 2 then second layout will
be displayed as output.
 
Create anchors between the frames, so that there won’t be any space left when other 
frames are not displayed.
 
Read more on anchors:
http://oracleapps4u.blogspot.com/2011/03/example-of-anchor.html
 
 
These multi layout report concept is mainly useful when developing reports 
to run in multiple languages

Example of Anchor


Anchors are used to determine the vertical and horizontal positioning of a child object relative to its parent.  The end of the anchor with a symbol on it is attached to the parent object.

Since the size of some layout objects may change when the report runs (and data is actually fetched), you need anchors to define where you want objects to appear relative to one another.  An anchor defines the relative position of an object to the object to which it is anchored.  Positioning is based on the size of the objects after the data has been fetched rather than on their size in the editor.   

It should also be noted that the position of the object in the Layout editor effects the final position in the report output.  Any physical offset in the layout is incorporated into the percentage position specified in the Anchor property sheet. 

To,
&<cfirstname>


Congratulations, On becoming the member of the British library.
state of art technology enables members to issue books from any
of the branches across the globe.


You can issue books belonging to any of the following categories:
Classics
Fiction
Romance
Humor
Psychology


You will reveive your identity card within 10 days of issue of
membership

Thanking you

Your's sincerly
MrKK
----------------------------------------------------------------------------------------------------------





To,
&<cfirstname>


Congratulations, On becoming the member of the British library.
state of art technology enables members to issue books from any
of the branches across the globe.








You will reveive your identity card within 10 days of issue of
membership

Thanking you

Your's sincerly
MrKK
--------------------------------------------------------------------------------------------------------




            In the layout shown above, there are 3 paragraphs in the letter addressed to the members of the library. the three paragraphs are separate boilerplate
objects, which are of fixed size. their positions are directly related to the enclosing repeating frames.

in the letter, the display of the 2nd paragraph is based on the age of the members. That is, by applying conditional formatting
the boilerplate is hidden if members' age happens to be below 12 yrs.


due to the condition specified, the second paragraph is notprinted when members age is below 12

how ever the position of the third paragraph remains the same


This extra space can be supressed by creating an anchor from the top edge of the third paragraph to the top edge of the
second paragraph.

to do so select the anchortool and click and drag the anchor from the third paragraph to the second and double click the
second paragraph to created the anchor.

This supress the spaces between 1 and the 3rd paragraphs but the gap continues. to over come this, change the collapse verticlally
property of the anchor to 'Yes'

No comments:

Post a Comment