11 Replies Latest reply: Dec 4, 2012 9:41 PM by shiko RSS

    Import Data From Excel To ADF

    shiko
      hi everybody
      i need way to import data from excel file i saw some posts like
      http://technology.amis.nl/blog/8418/adf-11g-import-from-excel-into-an-adf-table
      but it didn't work with me .
      thanks
        • 1. Re: Import Data From Excel To ADF
          Gunanidhi Mohanty
          Hi Sikho,
          Can you describe the problem. Did you create the table and the database connection.

          @Gunanidhi
          • 2. Re: Import Data From Excel To ADF
            Suresh Karunarathne
            Hi,
            What is the issue you got and explain which step you failed.Did you set usesUpload="true" for test page
            • 3. Re: Import Data From Excel To ADF
              shiko
              Hi Gunanidhi
              really i made all steps but unfortunately when i set property binding of table to staffTable variable which declared at manged bean and run page my page appears empty and if i remove binding my page appears correctly
              so i don't know why this matter happen
              on other way i tried to make jsf page normal jsf page without jsff but when i did that i didn't found property binding as one of table property which prevented me to do binding and the solution still missed something
              i hope the issue is clear now
              • 4. Re: Import Data From Excel To ADF
                shiko
                hi Suresh
                i don't know where this property


                really i made all steps but unfortunately when i set property binding of table to staffTable variable which declared at manged bean and run page my page appears empty and if i remove binding my page appears correctly
                so i don't know why this matter happen
                on other way i tried to make jsf page normal jsf page without jsff but when i did that i didn't found property binding as one of table property which prevented me to do binding and the solution still missed something
                i hope the issue is clear now



                thanks

                Edited by: shiko on Nov 28, 2012 9:54 PM
                • 5. Re: Import Data From Excel To ADF
                  Gunanidhi Mohanty
                  Hi,
                  Can you post the page code for analyze the problem?

                  Thanks
                  @Gunanidhi
                  • 6. Re: Import Data From Excel To ADF
                    codigoadf
                    Hi,
                    Do you know ADFDi? http://www.oracle.com/technetwork/developer-tools/adf/overview/index-085534.html
                    Maybe he covers your requirements
                    • 7. Re: Import Data From Excel To ADF
                      shiko
                      hi

                      first thank you for trying help me
                      --------------------------------------------------------------------this is the Jsff code--------------------------------------------------------
                      <?xml version='1.0' encoding='UTF-8'?>
                      <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
                      xmlns:f="http://java.sun.com/jsf/core">
                      <af:panelCollection id="pc1">
                      <f:facet name="menus"/>
                      <f:facet name="toolbar"/>
                      <f:facet name="statusbar"/>
                      <af:table value="#{bindings.BillOfQuantityView1.collectionModel}" var="row"
                      rows="#{bindings.BillOfQuantityView1.rangeSize}"
                      emptyText="#{bindings.BillOfQuantityView1.viewable ? 'No data to display.' : 'Access Denied.'}"
                      fetchSize="#{bindings.BillOfQuantityView1.rangeSize}" rowBandingInterval="0" filterVisible="true" varStatus="vs"
                      selectedRowKeys="#{bindings.BillOfQuantityView1.collectionModel.selectedRow}"
                      selectionListener="#{bindings.BillOfQuantityView1.collectionModel.makeCurrent}" rowSelection="single"
                      id="t1" binding="#{pageFlowScope.uploadfile.staffTable}">
                      <af:column sortProperty="#{bindings.BillOfQuantityView1.hints.ItemId.name}" filterable="true" sortable="true"
                      headerText="#{bindings.BillOfQuantityView1.hints.ItemId.label}" id="c1">
                      <af:inputText value="#{row.bindings.ItemId.inputValue}"
                      label="#{bindings.BillOfQuantityView1.hints.ItemId.label}"
                      required="#{bindings.BillOfQuantityView1.hints.ItemId.mandatory}"
                      columns="#{bindings.BillOfQuantityView1.hints.ItemId.displayWidth}"
                      maximumLength="#{bindings.BillOfQuantityView1.hints.ItemId.precision}"
                      shortDesc="#{bindings.BillOfQuantityView1.hints.ItemId.tooltip}" id="it1">
                      <f:validator binding="#{row.bindings.ItemId.validator}"/>
                      <af:convertNumber groupingUsed="false" pattern="#{bindings.BillOfQuantityView1.hints.ItemId.format}"/>
                      </af:inputText>
                      </af:column>
                      <af:column sortProperty="#{bindings.BillOfQuantityView1.hints.ProjectId.name}" filterable="true" sortable="true"
                      headerText="#{bindings.BillOfQuantityView1.hints.ProjectId.label}" id="c2">
                      <af:inputText value="#{row.bindings.ProjectId.inputValue}"
                      label="#{bindings.BillOfQuantityView1.hints.ProjectId.label}"
                      required="#{bindings.BillOfQuantityView1.hints.ProjectId.mandatory}"
                      columns="#{bindings.BillOfQuantityView1.hints.ProjectId.displayWidth}"
                      maximumLength="#{bindings.BillOfQuantityView1.hints.ProjectId.precision}"
                      shortDesc="#{bindings.BillOfQuantityView1.hints.ProjectId.tooltip}" id="it2">
                      <f:validator binding="#{row.bindings.ProjectId.validator}"/>
                      </af:inputText>
                      </af:column>
                      <af:column sortProperty="#{bindings.BillOfQuantityView1.hints.UserCode.name}" filterable="true" sortable="true"
                      headerText="#{bindings.BillOfQuantityView1.hints.UserCode.label}" id="c3">
                      <af:inputText value="#{row.bindings.UserCode.inputValue}"
                      label="#{bindings.BillOfQuantityView1.hints.UserCode.label}"
                      required="#{bindings.BillOfQuantityView1.hints.UserCode.mandatory}"
                      columns="#{bindings.BillOfQuantityView1.hints.UserCode.displayWidth}"
                      maximumLength="#{bindings.BillOfQuantityView1.hints.UserCode.precision}"
                      shortDesc="#{bindings.BillOfQuantityView1.hints.UserCode.tooltip}" id="it3">
                      <f:validator binding="#{row.bindings.UserCode.validator}"/>
                      </af:inputText>
                      </af:column>
                      <af:column sortProperty="#{bindings.BillOfQuantityView1.hints.PrimaryName.name}" filterable="true" sortable="true"
                      headerText="#{bindings.BillOfQuantityView1.hints.PrimaryName.label}" id="c4">
                      <af:inputText value="#{row.bindings.PrimaryName.inputValue}"
                      label="#{bindings.BillOfQuantityView1.hints.PrimaryName.label}"
                      required="#{bindings.BillOfQuantityView1.hints.PrimaryName.mandatory}"
                      columns="#{bindings.BillOfQuantityView1.hints.PrimaryName.displayWidth}"
                      maximumLength="#{bindings.BillOfQuantityView1.hints.PrimaryName.precision}"
                      shortDesc="#{bindings.BillOfQuantityView1.hints.PrimaryName.tooltip}" id="it4">
                      <f:validator binding="#{row.bindings.PrimaryName.validator}"/>
                      </af:inputText>
                      </af:column>
                      <af:column sortProperty="#{bindings.BillOfQuantityView1.hints.SecondaryName.name}" filterable="true"
                      sortable="true" headerText="#{bindings.BillOfQuantityView1.hints.SecondaryName.label}" id="c5">
                      <af:inputText value="#{row.bindings.SecondaryName.inputValue}"
                      label="#{bindings.BillOfQuantityView1.hints.SecondaryName.label}"
                      required="#{bindings.BillOfQuantityView1.hints.SecondaryName.mandatory}"
                      columns="#{bindings.BillOfQuantityView1.hints.SecondaryName.displayWidth}"
                      maximumLength="#{bindings.BillOfQuantityView1.hints.SecondaryName.precision}"
                      shortDesc="#{bindings.BillOfQuantityView1.hints.SecondaryName.tooltip}" id="it5">
                      <f:validator binding="#{row.bindings.SecondaryName.validator}"/>
                      </af:inputText>
                      </af:column>
                      <af:column sortProperty="#{bindings.BillOfQuantityView1.hints.Quantity.name}" filterable="true" sortable="true"
                      headerText="#{bindings.BillOfQuantityView1.hints.Quantity.label}" id="c6">
                      <af:inputText value="#{row.bindings.Quantity.inputValue}"
                      label="#{bindings.BillOfQuantityView1.hints.Quantity.label}"
                      required="#{bindings.BillOfQuantityView1.hints.Quantity.mandatory}"
                      columns="#{bindings.BillOfQuantityView1.hints.Quantity.displayWidth}"
                      maximumLength="#{bindings.BillOfQuantityView1.hints.Quantity.precision}"
                      shortDesc="#{bindings.BillOfQuantityView1.hints.Quantity.tooltip}" id="it6">
                      <f:validator binding="#{row.bindings.Quantity.validator}"/>
                      <af:convertNumber groupingUsed="false" pattern="#{bindings.BillOfQuantityView1.hints.Quantity.format}"/>
                      </af:inputText>
                      </af:column>
                      <af:column sortProperty="#{bindings.BillOfQuantityView1.hints.UnitPrice.name}" filterable="true" sortable="true"
                      headerText="#{bindings.BillOfQuantityView1.hints.UnitPrice.label}" id="c7">
                      <af:inputText value="#{row.bindings.UnitPrice.inputValue}"
                      label="#{bindings.BillOfQuantityView1.hints.UnitPrice.label}"
                      required="#{bindings.BillOfQuantityView1.hints.UnitPrice.mandatory}"
                      columns="#{bindings.BillOfQuantityView1.hints.UnitPrice.displayWidth}"
                      maximumLength="#{bindings.BillOfQuantityView1.hints.UnitPrice.precision}"
                      shortDesc="#{bindings.BillOfQuantityView1.hints.UnitPrice.tooltip}" id="it7">
                      <f:validator binding="#{row.bindings.UnitPrice.validator}"/>
                      <af:convertNumber groupingUsed="false" pattern="#{bindings.BillOfQuantityView1.hints.UnitPrice.format}"/>
                      </af:inputText>
                      </af:column>
                      <af:column sortProperty="#{bindings.BillOfQuantityView1.hints.TotalPrice.name}" filterable="true" sortable="true"
                      headerText="#{bindings.BillOfQuantityView1.hints.TotalPrice.label}" id="c8">
                      <af:inputText value="#{row.bindings.TotalPrice.inputValue}"
                      label="#{bindings.BillOfQuantityView1.hints.TotalPrice.label}"
                      required="#{bindings.BillOfQuantityView1.hints.TotalPrice.mandatory}"
                      columns="#{bindings.BillOfQuantityView1.hints.TotalPrice.displayWidth}"
                      maximumLength="#{bindings.BillOfQuantityView1.hints.TotalPrice.precision}"
                      shortDesc="#{bindings.BillOfQuantityView1.hints.TotalPrice.tooltip}" id="it8">
                      <f:validator binding="#{row.bindings.TotalPrice.validator}"/>
                      <af:convertNumber groupingUsed="false" pattern="#{bindings.BillOfQuantityView1.hints.TotalPrice.format}"/>
                      </af:inputText>
                      </af:column>
                      <af:column sortProperty="#{bindings.BillOfQuantityView1.hints.tot.name}" filterable="true" sortable="true"
                      headerText="#{bindings.BillOfQuantityView1.hints.tot.label}" id="c9">
                      <af:inputText value="#{row.bindings.tot.inputValue}" label="#{bindings.BillOfQuantityView1.hints.tot.label}"
                      required="#{bindings.BillOfQuantityView1.hints.tot.mandatory}"
                      columns="#{bindings.BillOfQuantityView1.hints.tot.displayWidth}"
                      maximumLength="#{bindings.BillOfQuantityView1.hints.tot.precision}"
                      shortDesc="#{bindings.BillOfQuantityView1.hints.tot.tooltip}" id="it9">
                      <f:validator binding="#{row.bindings.tot.validator}"/>
                      <af:convertNumber groupingUsed="false" pattern="#{bindings.BillOfQuantityView1.hints.tot.format}"/>
                      </af:inputText>
                      </af:column>
                      </af:table>
                      </af:panelCollection>
                      <af:inputFile label="Label 1" id="if1" autoSubmit="true"
                      valueChangeListener="#{pageFlowScope.uploadfile.fileUploaded}"/>
                      </ui:composition>
                      ------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                      • 8. Re: Import Data From Excel To ADF
                        shiko
                        hi
                        i'm not using desktop application and as i know this tool works with desktop application only

                        thank you
                        • 9. Re: Import Data From Excel To ADF
                          codigoadf
                          No.
                          ADFDi binds ADF(web) with MS Office.
                          see this demo:http://download.oracle.com/otn_hosted_doc/jdeveloper/111demos/ADFdi_Overview/Overview-ADFdi11g.html
                          • 10. Re: Import Data From Excel To ADF
                            shiko
                            hi codigoadf
                            thank you for helping me
                            i try to use it but i got error when opening excel file after doing every step provided it tutorial
                            and i did the following
                            1st step:
                            I Right-clicked the ViewController project in the Navigator and select New... from the context menu. In the New Gallery expand the Client Tier node if it is not already expanded, and select ADF Desktop Integration. Microsoft Excel Workbook should be automatically highlighted in the Items pane, so click OK to select it.


                            2nd step

                            I Named the workbook DepartmentsList_src.xlsx and click OK.The new workbook appears in the Navigator.

                            3rd step:

                            Double-click DepartmentsList_src.xlsx in the Navigator to open it with Microsoft Excel.

                            4th step: I am getting errors in this step( the page definition dialog is not coming

                            when Excel opens, loading Oracle ADF Desktop Integration is not happening . i am not getting the Page Definition dialog..
                            • 11. Re: Import Data From Excel To ADF
                              shiko
                              Hi codigoadf
                              thank you for your suggestion it (ADFDI) works with me and it is very useful tool