Re:Export Excel adf table programmatically

Hi All,
I am using jdev11.1.2.3.0 in OracleLinux Operating System ,
I need to export Table data to Excel sheet in programmatically, can any one tell me the solution..

http://technology.amis.nl/2007/03/26/exporting-to-excel-from-any-adf-table/
http://oafqueries.blogspot.ca/2011/06/how-to-export-multiple-vo-data-to-excel.html

Similar Messages

  • About  how to export excel pivot tables

    Hello all!
    I am currently working with the "help" of an oracle consultor from Oracle (Consulting) Spain, but she (and no one of her working mates) is not able to give me an answer about my doubt.
    The problem is: I know that Oracle Discoverer plus is able to export oracle Olap crosstabs automatically to excel pivot tables. It must do it in some way, but no one, here in Spain, is able to tell me how.
    I suppose Oracle engineers have developed a Java Api to do it, but , in Spain, it is useless trying to get this information from Oracle (an this is not because this is a "top secret information" , this is just because they do not know their products, just it!).
    The only help that I had from them regarding this issue was a reference to Jexcelapi. I do not want to reinvent the wheel, thus why I am trying to get any help from you. Please, you are my last chance!
    Does any body know how discoverer exports Oracle Olap crosstabs to excel pivot tables?
    Than you very much for your help in advance.
    Best regards,
    Miguel A. Vico.

    Hello again!
    Yes , you are right, but that is not my problem; my problem is that I need to do what Discoverer does, but using Oracle BI beans technology. An this technology gives me no chance to do it .
    BI beans exports to CSV and Excel format , but not to excel pivot tables, and I would need to do it .
    Could you tell me what is the API, Discoverer uses to get this job done?
    Best regards,
    Miguel

  • Create ADF Table programmatically.

    I'm trying to populate an af:table programmatically from the backing bean. I have successfully generated the table and the rows/columns. I'm however unable to specify the value of each cell.
    Here's my code snippet for populating a dummy table with just one column displaying employee's name.
    public class Employee {
          private String name;
          // A bean class with getters/setters
    public RichTable generateTable(){
          //create an array list of Employee as data
          List<Employee> data = createSampleData(); 
          RichTable _t = new RichTable();
          //set id, visible, etc. omitted.
          _t.setValue(data);
          _t.setVar("row");
          RichColumn rc = new RichColumn();
          RichOutputText rot = new RichOutputText();
    /**** Here's where the problem occurs ****/
         rot.setValue("#{row.name}");
    //set id, header etc for RichColumn. omitted
    //add output text and rich column as children to the table. omitted
    return _t;
    Using the codes shown I can get the table rendered with however many rows I created in the array list. Yet in each cell, instead having the name of the employee, the table shows the string #{row.name}
    The EL is not resolved but interpreted as a literal string.
    How can I set the value of the output text to refer to the value of the name attribute of each row?
    Thanks

    Hi,
    ELContext elContext = FacesContext.getCurrentInstance().getELContext();
    ExpressionFactory efact = FacesContext.getCurrentInstance(). getApplication().getExpressionFactory();
    ValueExpression valExpr = efact.createValueExpression( elContext,elExpression,Object.class);
    rot.setValueExpression( "value", valExpr);
    Frank

  • Data from Excel to ADF table

    Hi,
    I need to export data from excel to ADF table and edit the data and finally send it back to database.
    Would you kindly let me know how to proceed in this?
    Many thanks in advance
    Regards

    This depends on your excel file structure.
    You can use ADF Desktop Integration or
    something like this(for simple excel files):
    for excel -> adf table
    http://technology.amis.nl/2010/09/16/adf-11g-import-from-excel-into-an-adf-table/
    For adf table -> excel:
    http://www.baigzeeshan.com/2010/04/exporting-table-to-excel-in-oracle-adf.html
    http://adfreusablecode.blogspot.com/2012/07/export-to-excel-with-styles.html
    Dario

  • Processed rows in ADF Table are unsorted

    I have to process the selected rows of an ADF table programmatically. This is not so difficult, like in the [example |http://www.johnbrunswick.com/2011/08/adftable-get-selected-row-or-rows/] below.
    But the rows are processes in a random, unsorted manner. I need them to be processed sorted as they appear on screen. I think I set all properties correctly, at least the data appear sorted on the view.
    Beside the solution this problem seems to give interesting information about how the iterators work internally. Thanks in advance.
    public String cbSelectMany_action() {
        // For learning purposes - show Select Many Button clicked
        System.out.println("Select Many Button has been Clicked");
        // RowKeySet Object can hold the selected rows from a user as follows
        RowKeySet rksSelectedRows =
            this.getTsupportIssues().getSelectedRowKeys();
        // Iterator object provides the ability to use hasNext(), next() and remove() against the selected rows
        Iterator itrSelectedRows = rksSelectedRows.iterator();
        // Get the data control that is bound to the table - e.g. OpenSupportItemsIterator
        DCBindingContainer bindings =
            (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
        DCIteratorBinding dcIteratorBindings =
            bindings.findIteratorBinding("OpenSupportItemsIterator");
        // Information from binding that is specific to the rows
        RowSetIterator rsiSelectedRows =
            dcIteratorBindings.getRowSetIterator();
        // Loop through selected rows
        while (itrSelectedRows.hasNext()) {
            // Get key for selected row
            Key key = (Key)((List)itrSelectedRows.next()).get(0);
            // Use the key to get the data from the above binding that is related to the row
            Row myRow = rsiSelectedRows.getRow(key);
            // Display attribute of row in console output - would generally be bound to a UI component like a Label and or used to call another proces
            System.out.println(myRow.getAttribute("IssueID"));
        return null;
    }Edited by: KaiMoeller on 17.10.2012 11:12

    Kai,
    I don't think you can archive this without more coding, as the RowKeySet is a set which does not retain the order of the elements. So the solution would be to get the selected rows and then sort them as the table is currently sorted.
    Happy coding
    Timo

  • Creating rich table programmatically

    hi all!
    I'm using ADF 11g v2.
    I was able to create the adf table programmatically but the the columns does not displays. I inspect the it doesn't have javax.faces.webapp.COMPONENT_IDS key in the properties, is this the reason why the column will not displays? If so, how to add it in the table and columns?
    here's my code snippet:
    RichTable myTable = new RichTable();
    myTable.setId('t1');
    myTable.setRowBandingInterval(0);
    myTable.setValueExpression("value", resolveExpression('#{bean.data}'));
    RichOutputText myText = new RichOutputText();
    myText .setId('ot1');
    myText.setValue("#{row.col1}" );
    RichColumn myCol = new RichColumn();
    myCol.setId('r1');
    myCol.setSortable(false);
    myCol.setHeaderText('Col1')
    myCol.getChildren().add(myText);
    myTable.getChildren().add(myCol);
    public static Object resolveExpression(String expression) {
    FacesContext facesContext = getFacesContext();
    Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    ValueExpression valueExp =
    elFactory.createValueExpression(elContext, expression,
    Object.class);
    return valueExp.getValue(elContext);
    Where did I miss? Btw, the fething record keeps on spinning until it hangs. Thank in advance.

    hi Frank,
    Thanks for replying.
    Yes, the data is an ArrayList. And have typo error in the last post, the Fetching Data message displays endlessly but it doesn't hang and the table has var attribute which is "row".
    I bind the #{bean.data} to a declarative table and it is working fine. But the implementation is to be programmatic :-)

  • How can i set some values to adf table(non bound to database)?

    hi
    i want to display some datas to an empty adf table on click of a button?
    My jdev version is 11.1.2.2
    Thanxxx

    There are a couple of ways of displaying data in an adf table if its not bound to a database.
    1. You can create a programmatic view object and populate it at run time(i.e. click of a button) and display the view object as a table.
    2. You can create a list of POJO objects and populate your adf table programmatically.
    By the way from where are you getting the data. Can you explain your use case a little more?
    Hope it helps.
    Umesh

  • Export adf table to Excel

    Hi All,
    Does anybody know how to export adf table records to excel sheet without using DCIteratorBinding.

    Hi Frank,
    Thanks for your suggestion.in the below method
    public void exportToExcel(ActionEvent actionEvent) throws
    IOException {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    Application application = facesContext.getApplication();
    // BindingContainer bindings = this.getCustomers();
    ValueBinding customerListBind =
    application.createValueBinding("#{CustomerViewBean}");
    customerView customer =
    (customerView)customerListBind.getValue(facesContext);
    customer.exportHtmlTableToExcel();
    in this method i need to send CustomerViewBean to the exportHtmlTableToExcel method.

  • Problem with numeric columns when ADF table exported to Excel

    Hi,
    We have a ADF table on a page which can be exported to excel spreadsheet using the <Af:ExportCollectionActionListener>. The adf table is within panel collection.
    There are many numeric columns in this table and there is <af:convertnumber> used on these columns. No other properties are changed on the <af:convertnumber> tag, everything is default. And no formatting is applied on the view object attributes as well. When a user from US is exporting the table to excel everything works well no issues. But a Netherlands or French user exports the excel, the numeric values which have decimal point are shown as left aligned and the whole numbers in the same column are right aligned. As a result when the user is trying to sum the entire column only the right aligned numbers are getting added.
    I am not sure what is the issue here ?
    HAs someone seen this scenario before ?
    Am I missing anything here - any property setting ?
    The numbers are shown like this in the excel exported from table.
    4,077.78
    3,555,34.12
                        1,234
                        19,219
    3,4445,33.22
    Jdev - 11.1.2.3
    Thanks

    Add a decimal to the whole number columns to make all columns left-aligned. Do all left-aligned columns get added?
    4,077.78
    3,555,34.12
    1,234.00
    19,219.00
    3,4445,33.22

  • Exporting ADF Table Headers to an EXCEL sheet

    Hello,
    We have an adf table (Jdev10.1.3g). We need to export the Headers of the table to an excel sheet. I have hold on the headers and can put it in an array/arrayList. Basically, I need help with how to browse to the file where user wants to store the table headers._ I think once we can browse to the file location, we can use the POI HSSF API as we have for the task below. Any code examples are welcome.
    We are already SUCCESSFULLY uploading the contents of the excel sheet (using <af:inputFile> tag) and writing the contents to adf table. Lucas Jellema's article and code example was very helpful.
    Thanks,

    Hi,
    this thread is duplicate of this.... Exporting ADF table Headers to Excel
    Please be patience untill the reply comes.... dont duplicate the thread its meaningless
    Regards,
    Suganth.G

  • ADF view, export excel does not export more than 65536 rows

    as this is limitation of ms excel 2000, but not sure whether it is still limitation in using ADF view export excel feature.
    in our table , there are more than 80k rows, when we click on export excel, it only get's 65536 rows
    remaining rows are not exported.
    please let us know if this is still open issue or fixed, also let us know which version if it is fixed.

    Hi,
    Yo have to use custom library Ex: Apachi POI
    See
    Re: ADF table data export to Excel

  • Export adf table to PDF

    Hi All,
    Does anybody knows how to write ADF Table records into pdf?
    Thanks in advance

    Hi user535777,
    Some ideas:
    http://technology.amis.nl/blog/?p=514
    http://iadvise.blogspot.com/2007/04/export-adf-table-to-excel.html
    http://wiki.apache.org/myfaces/Exporting_DataTable_To_MS-Excel
    Hope it helps,
    Regards,
    Tif

  • Export to excel pivot table is incorrect

    Hi All,
    I have a problem when export Discoverer Plus report to Excel Pivot table...
    My problem is calculation field (ex. Average salary per employee) in pivot table shown incorrect
    data.
    May someone has any idea for this problem and how to solve it.
    Thanks,
    Mcka
    Remark: I have info. about Discoverer version that I use
    OracleBI Discoverer 10g (10.1.2.2)
    Oracle Business Intelligence Discoverer Plus 10g (10.1.2.54.25)
    Discoverer Model - 10.1.2.54.25
    Discoverer Server - 10.1.2.54.25
    End User Layer - 5.1.1.0.0.0
    End User Layer Library - 10.1.2.54.25

    Have anybody share idea about this problem ?

  • How to programmatically change the cell color of an ADF table ?

    Hi all,
    I have an ADF table with some fields on it. Depending on the value of a field named, say, "F1", I would like to change its background color.
    So far I can change the field color with this EL expression inside the InlineStyle table column property:
    font-size:medium; background-color:#{viewScope.myBean.setColor};
    where setColor is a bean function, in where I access the field "F1" via binding, parse its value, and return the right value - so far, so good.
    The bad thing is, the InlineStyle affects that field in all the rows of the table, while I would like to change only the field in the rows, which have that specific value in it.
    So for example having the rows:
    F1
    abc#1 ----> currently selected row
    cde#2
    efg#3
    I want to change the background color to all the F1 fields which have a "1" after the '#' and let the other "F1" row cells background color stay unchanged.
    But as you can imagine, the InlineStyle affect the "F1" background color in all the rows (assuming that the first row of the table is selected).
    So the question: how to access a single cell of a row in an ADF table, and programmatically change its background color ?
    So far I can iterate through the ADF table with:
    BindingContext bindingctx = BindingContext.getCurrent();
    BindingContainer bindings = bindingctx.getCurrentBindingsEntry();
    DCBindingContainer bindingsImpl = (DCBindingContainer) bindings;
    DCIteratorBinding dciter = bindingsImpl.findIteratorBinding("aTableIterator");//access the iterator by its ID value in the PageDef file
    RowSetIterator rsi = dciter.getRowSetIterator();
    System.out.println("rsi getrowcount = " rsi.getRowCount());+
    Row row = null;
    +if (rsi.getRowCount() > 0) {+
    row = rsi.getCurrentRow();
    System.out.println("row attr = " Arrays.toString(row.getAttributeNames()));+
    System.out.println("class : " row.getAttribute("F1").getClass().toString());+
    +}+
    +while (rsi.hasNext()) {+
    row = rsi.next();
    System.out.println("row attr = " Arrays.toString(row.getAttributeNames()));+
    +}+
    Regards,
    Sergio.

    Hi,
    I mean a specific cell within a row.
    Here are two pictures that show an ADF table with two rows and some fields on it:
    https://skydrive.live.com/?cid=7D3084D8BF755808&id=7D3084D8BF755808!107&sc=documents#cid=7D3084D8BF755808&id=7D3084D8BF755808!107&sc=documents
    bild_A is what I have, bild_B is what I would like. Note that:
    in bild_A the first row contain a yellow background color for the field F4 and an orange background color for the field F5. This is correct, because F4 has an "1" at the end of its string value, and F5 has a "3" at the end. So far so good.
    But the second row (again, bild_A) has also the fields F4 with yellow background color, and the field F5 with orange background color, even if the value in both fields is 0.
    What is should be, is shown in bild_B.
    The problem is that the solution provided affects all the cells of the column, while I need to change the background color of a single cell, and leave the other unchanged (see bild_B).
    I hope that clarify a bit :)
    Sergio.

  • Leading zeros are not carried from the pivot table to exported Excel (9927815)

    Hello All -
    I am just wondering if there is a fix available for -- Leading zeros are not carried from the pivot table to exported Excel (9927815)
    can anybody suggest when it will be fixed and if there is any-workaround for this issue if there is no fix available.
    Thanks
    Ram

    Thanks Timo -
    Studio Edition Version 11.1.1.2.0
    About
    Oracle JDeveloper 11g Release 1 11.1.1.2.0
    Studio Edition Version 11.1.1.2.0
    Build JDEVADF_11.1.1.2.0_GENERIC_091029.2229.5536
    Copyright © 1997, 2009 Oracle and/or its affiliates. All rights reserved.
    IDE Version: 11.1.1.2.36.55.36
    Product ID: oracle.jdeveloper
    Product Version: 11.1.1.2.36.55.36
    I will check on support.oracle.com

Maybe you are looking for

  • Database connection problem

    Hi, Below is a servlet and just a plain java class. Both attempt to connect to a database. Code snippet 2 works and code snippet 1 does not. Snippet 1 is a servlet. Both classes compile ok but at runtime, the one that does not connect to the database

  • Weird characters in Hex viewer when i check a xml

    Hi, We are in the test phase sending messages to a customer of us. But when we send test messages the customer tells me that there are weird characters in the xml. It happens when we check the xml in a hexadecimal viewer. In the normal viewer of in a

  • Mac: Adobe Application Manager pops up every time I use any Application

    I have a problem using Applications of Adobe Creative Cloud: Every time I click on any icon (Photoshop, Indesign) or on any file (pdf) the Adobe Application Manager pops up and asks me to extend my membership with Adobe Creative Cloud. The selected a

  • I cannot receive mails on my iMac using OS X Mavericks.

    When I open Outlook for Mac 2011 I get the following message: The server for the account Me returned the failure Login failure The username is unknown, or the login code no is not correct. The security settings for the username or login code are poss

  • Error when activating Task List

    When activating the Task List in PROJECT_SOLAR_ADMIN, I receive the error      - "Phase change from 'Created' to 'Development without Release' is not possible".  When I do a check on the Project, the only red light i get is for the following two jobs