Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Dynamic Pivot Table programatically

santiago_ncNov 6 2012 — edited Nov 8 2012
Hi:

I need add to a JSF Page a Pivot Table from a Temporary Table wich I will fill in a Procedure PL/SQL (in the last version, now I put a sample data) and I could select the Alias Name for each column. (It's possible that I dont need show all columns in the pivot table, then I need hide or remove them)

I have tried this:

Model
- First, I have added the Entity Object for the Temporary Table into the Model.

- Create a view Object for the previous Entity Object.

ViewController

- Create a JSF Page with two regions (Top and Down)

- In the down region I drag and drop the view objet how a Pivot Table and I create the "Dummy" Pivot table, because I'll need modify it.

- In the top region I drag a Button. In the action I create a new backing bean with a method refresh. In this method I search for the Pivot Table. After that I could modify

Now I have the next problem. I don't Know How I can modify the structure of the Pivot Table.

In the file PivotTablePageDef.xml is located the parameters of my Pivot Table after use the wizard, but in the properties of "*pt*" object, I don't find nothing to set this.

Backing Bean Code:
package view.backing;

import java.util.Iterator;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;

import oracle.adf.view.faces.bi.component.pivotTable.HeaderCellSelectionSet;
import oracle.adf.view.faces.bi.component.pivotTable.UIPivotTable;
import oracle.adf.view.faces.bi.model.PivotTableModel;
import oracle.adf.view.faces.bi.model.DataModel;

import view.utils.*;

public class ChangePivotTable {
    public ChangePivotTable() {
    }
        
    

    public String refresh() {
        // Add event code here...
        
        UIComponent uiPT = Utils.getComponent("MyPivotTable");            
        UIPivotTable pt = (UIPivotTable)uiPT;
        PivotTableModel ptm = new PivotTableModel();
        //....
        return null;

    }
}
The table:
CREATE GLOBAL TEMPORARY TABLE WEB_TEMP
(
  ROWNUM     NUMBER,
  C1               VARCHAR2(4000 BYTE),
  C2               VARCHAR2(4000 BYTE),
  C3               VARCHAR2(4000 BYTE),
  C4               VARCHAR2(4000 BYTE),
  C5               VARCHAR2(4000 BYTE),
  C6               VARCHAR2(4000 BYTE),
  C7               VARCHAR2(4000 BYTE),
  C8               VARCHAR2(4000 BYTE),
  C9               NUMBER,
  N1               NUMBER,
  N2               NUMBER,
  N3               NUMBER,
  N4               NUMBER,
  N5               NUMBER,
  N6               NUMBER,
  N7               NUMBER,
  N8               NUMBER,
  N9               NUMBER,
  INITIAL_ROW     NUMBER
)
ON COMMIT PRESERVE ROWS
NOCACHE;
P.S.: In http://www.packtpub.com/sites/default/files/downloads/4828EN_Appendix_More_on_ADF_Business_Components_and_Fusion_Page_Runtime.pdf I rode about the dynamic Views Object and use it in the UI with the <af:each> of <af:table>.

Is possible use this for the <dvt:pivotable>?

PS. Sorry for my English.

Edited by: user12855703 on 07-nov-2012 7:07

Edited by: user12855703 on 08-nov-2012 7:43

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Dec 6 2012
Added on Nov 6 2012
1 comment
1,151 views