Press "Enter" to skip to content

Create Stacked Canvas to Scroll Horizontal Tabular Data Blocks In Oracle Forms

In this tutorial you will learn to create horizontal scrollable tabular or detail data block by using stacked canvas in Oracle Forms.
As shown in below picture the first column Empno is fixed and middle columns Ename, Job, Mgr and Hiredate are scrollable and last columns Sal, Comm, Deptno are fixed which are right side.
Oracle Forms Stacked canvas example

First thing is clear that the those columns which are fixed will be placed on Content Canvas and those column which are scrollable will be placed on Stacked Canvas.

Now the main part is to set the positioning of stacked canvas items and content canvas items and the position of stacked canvas and for this I will tell you to set some important properties of the items and stacked canvas.
To set the stacked canvas position and scrollable area stacked canvas, you have to note down the properies of the following items:
1. The X and Y position and the Width of First fixed column Empno Which is in this case are:

X = 15
Y = 172
Width = 45
2. Note down the X property of first right side column Sal, which is:
X = 218

Now we have the property values and what we need to do is some calculation to get the exact placement of Stacked Canvas and the following is the formula:
The first column Empno X is 15 and width is 45, hence the stacked canvas Viewport X Position will be 15 + 45 + 1

Set Viewport X Position = 61

The first column Empno Y is 172, hence the stacked canvas Viewport Y Position will be 172 – 10 (Prompt height)
Set Viewport Y Position = 162
Set the Viewport Width using following formula:
Sal column X Position(218) – First Column Empno X+Width (60) – 4 = 154
Set Viewport Width = 154
Set the Viewport Height as per the number of items displayed on content canvas.
Now your scrollable Stacked canvas is ready and I am attaching the form including Emp table script so that you download and take the reference from it.
Download this form using this link from Google Drive : Stacked.Zip

3 Comments

  1. Abdullah Bahattab Abdullah Bahattab February 1, 2016

    will you please give us more clear discuss and clear information like how could you do it? how 2 canvases has connecting with only 1 datablock? how can you set some columns in 1 canvas and the other columns sets in the other canvas?!!
    I'm sorry man the position so easy to beginners but my questions above are needs some kind of professional users.
    can you answer the questions please!!

  2. Abdullah Bahattab Abdullah Bahattab February 1, 2016

    OK No need for answering the question I found it.
    it's so easy dude.
    thank you!!

  3. Prajna Karkal Prajna Karkal December 29, 2016

    Hi Vinish ,
    I am trying to learn Oracle forms. while creating stacked canvas, I noticed the options in property palette of canvas which says view-port and physical. I want to know what is the difference between view port X position in view-port section and view port X position on canvas in physical section?
    Kindly answer this question.
    Thanks,
    Prajna

Comments are closed.