Export Adavnced Table Data

I have an advanced table with Export button in seeded Oracle Page. But when i click on export, it exports data into a .txt file.
How can i make it export data in excel or say pdf or even xml.
Any suggestions are greatly appreciated.
Thanks,
Abhishek

you could use the concatenate | to turn your data into ascii delimited format and spool it.
something like
select col1||','||col2 from yourable

Similar Messages

  • What is the easiest way to export all tables data from Oracle to MS SQL Server?

    Hello MS,
    I would like to export all tables from Oracle 11.2 to MS SQL Server 2012 R1.
    Using the tool "Microsoft SQL Server Migration Assistant v6.0 for Oracle" did not work for me because there are too many warnings and errors regarding the schema creation (MS cannot know it because they are not the schema designer). My idea is
    to leave/skip the schema creation to the application designer/supplier and instead concentrate on the Oracle data export and MS SQL data import.
    What is the easiest way to export all tables data from Oracle to MS SQL Server quickly?
    Is it:
    - the „MS SQL Import and Export Data“ Tool
    - the “MS SQL Integration Services” Tool
    - not Oracle dump *.dmp format because it is a propritery binary format
    - flat file *.csv (delimited format)
    Thanks!

    Hi lingodingo,
    If you want to directly export all tables from Oracle database to SQL Server, I suggest you use SQL Server Import and Export Wizard. Because you just need to follow the wizard with GUI, this is the easiest way.
    If you want to make some modification for the tables‘ data before loading to SQL Server, I suggest you use SQL Server Integration Services package. For more details, please refer to the following similar thread:
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/38b2bed2-9d4e-48d4-a33f-1d9eed1c062d/flat-file-to-sql-server?forum=sqldatamining
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • RE: How to Export the Table data Into PDF File  in ADF

    Hi Experts,
    I am using Jdeveloper 11.1.2.3.0
    I am created employee VO and Drag and Drop as a Table in a page. So need to Export the Table data into A PDF file.
    So please give me some suggestions regarding this Scnerio.
    With Regards,
    satish

    Hi Guys ,
    Any more answers for this question.
    Please find my jsff below
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
              xmlns:f="http://java.sun.com/jsf/core" xmlns:report="http://www.adfwithejb.blogspot.com">
      <af:panelGroupLayout layout="vertical" id="pgl2">
          <af:query id="qryId1" headerText="Service Tariff Mapping Details" disclosed="true"
                    value="#{bindings.findByTarifValidFromQuery.queryDescriptor}"
                    model="#{bindings.findByTarifValidFromQuery.queryModel}"
                    queryListener="#{reportWiseInvoiceBean.genericQueryListener}"
                    queryOperationListener="#{bindings.findByTarifValidFromQuery.processQueryOperation}"
                    resultComponentId="pc1::t2">
         <f:attribute name="queryExpression" value="bindings.findByTarifValidFromQuery.processQuery"/>
                          </af:query>
        <af:panelCollection id="pc1" styleClass="AFStretchWidth">
          <f:facet name="menus"/>
          <f:facet name="toolbar">
              <af:toolbar id="t1">
                 <af:menuBar id="pt_m1">
                <report:reportDeclarative ButtonName="ExportToExcel" ReportName="ServiceTariffMappingDetails"
                                          ReportType="PDF" TableId=":::pc1:t2" id="rd1" Pagination="true"/>
                <af:commandButton text="excel" id="cb1" binding="#{exportToExcelBean.exportID}">
                <af:setActionListener from="pt1:pgl1:pgl2:pc1:t2" to="#{viewScope['exporter.exportedId']}"/>
                <af:setActionListener from="border:1px solid #cccccc" to="#{viewScope['exporter.thStyle']}"/>
                <af:setActionListener from="border:1px solid #cccccc" to="#{viewScope['exporter.tdStyle']}"/>
                <af:fileDownloadActionListener method="#{exportToExcelBean.exportToExcel}" filename="Service TariffMapping.xls"
                                                 contentType="text/excel;chatset=UTF-8;"/>
                </af:commandButton>
                <af:commandMenuItem id="pt_cmi133" icon="/images/common/Excel-icon.png"
                                                shortDesc="ExportToExcel"
                                >
                                <af:exportCollectionActionListener exportedId="t2" type="excelHTML"
                                                                   title="Service Tariff Mapping"
                                                                   filename="Service Tariff Mapping.xls"/>
                            </af:commandMenuItem></af:menuBar>
              </af:toolbar>
          </f:facet>
          <f:facet name="statusbar"/>
          <af:table value="#{bindings.ServiceTariffMappingDtlsRVO1.collectionModel}" var="row"
                    rows="#{bindings.ServiceTariffMappingDtlsRVO1.rangeSize}"
                    emptyText="#{bindings.ServiceTariffMappingDtlsRVO1.viewable ? 'No data to display.' : 'Access Denied.'}"
                    fetchSize="#{bindings.ServiceTariffMappingDtlsRVO1.rangeSize}" rowBandingInterval="0"
                    filterModel="#{bindings.findByTarifValidFromQuery.queryDescriptor}"
                    queryListener="#{bindings.findByTarifValidFromQuery.processQuery}" filterVisible="true" varStatus="vs"
                    id="t2" columnStretching="last" binding="#{ServiceTariffMappBean.testTable}">
            <af:column sortProperty="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NormalTariffCode.name}" filterable="true"
                       sortable="true" headerText="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NormalTariffCode.label}"
                       id="c1">
              <af:inputText value="#{row.bindings.NormalTariffCode.inputValue}"
                            label="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NormalTariffCode.label}"
                            required="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NormalTariffCode.mandatory}"
                            columns="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NormalTariffCode.displayWidth}"
                            maximumLength="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NormalTariffCode.precision}"
                            shortDesc="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NormalTariffCode.tooltip}" id="it1">
                <f:validator binding="#{row.bindings.NormalTariffCode.validator}"/>
              </af:inputText>
            </af:column>
            <af:column sortProperty="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceCode.name}" filterable="true"
                       sortable="true" headerText="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceCode.label}"
                       id="c2">
              <af:inputText value="#{row.bindings.ServiceCode.inputValue}"
                            label="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceCode.label}"
                            required="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceCode.mandatory}"
                            columns="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceCode.displayWidth}"
                            maximumLength="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceCode.precision}"
                            shortDesc="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceCode.tooltip}" id="it2">
                <f:validator binding="#{row.bindings.ServiceCode.validator}"/>
              </af:inputText>
            </af:column>
            <af:column sortProperty="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfVldFrm.name}" filterable="true"
                       sortable="true" headerText="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfVldFrm.label}" id="c3">
              <f:facet name="filter">
                <af:inputDate value="#{vs.filterCriteria.TrfVldFrm}" id="id1">
                  <af:convertDateTime pattern="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfVldFrm.format}"/>
                </af:inputDate>
              </f:facet>
              <af:inputDate value="#{row.bindings.TrfVldFrm.inputValue}"
                            label="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfVldFrm.label}"
                            required="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfVldFrm.mandatory}"
                            columns="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfVldFrm.displayWidth}"
                            shortDesc="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfVldFrm.tooltip}" id="id2">
                <f:validator binding="#{row.bindings.TrfVldFrm.validator}"/>
                <af:convertDateTime pattern="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfVldFrm.format}"/>
              </af:inputDate>
            </af:column>
            <af:column sortProperty="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceDesc.name}" filterable="true"
                       sortable="true" headerText="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceDesc.label}"
                       id="c4">
              <af:inputText value="#{row.bindings.ServiceDesc.inputValue}"
                            label="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceDesc.label}"
                            required="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceDesc.mandatory}"
                            columns="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceDesc.displayWidth}"
                            maximumLength="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceDesc.precision}"
                            shortDesc="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ServiceDesc.tooltip}" id="it3">
                <f:validator binding="#{row.bindings.ServiceDesc.validator}"/>
              </af:inputText>
            </af:column>
            <af:column sortProperty="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtTrfCode.name}" filterable="true"
                       sortable="true" headerText="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtTrfCode.label}" id="c5">
              <af:inputText value="#{row.bindings.OtTrfCode.inputValue}"
                            label="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtTrfCode.label}"
                            required="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtTrfCode.mandatory}"
                            columns="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtTrfCode.displayWidth}"
                            maximumLength="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtTrfCode.precision}"
                            shortDesc="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtTrfCode.tooltip}" id="it4">
                <f:validator binding="#{row.bindings.OtTrfCode.validator}"/>
              </af:inputText>
            </af:column>
            <af:column sortProperty="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtUnitRate.name}" filterable="true"
                       sortable="true" headerText="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtUnitRate.label}" id="c6">
              <af:inputText value="#{row.bindings.OtUnitRate.inputValue}"
                            label="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtUnitRate.label}"
                            required="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtUnitRate.mandatory}"
                            columns="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtUnitRate.displayWidth}"
                            maximumLength="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtUnitRate.precision}"
                            shortDesc="#{bindings.ServiceTariffMappingDtlsRVO1.hints.OtUnitRate.tooltip}" id="it5">
                <f:validator binding="#{row.bindings.OtUnitRate.validator}"/>
              </af:inputText>
            </af:column>
            <af:column sortProperty="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NtUnitRate.name}" filterable="true"
                       sortable="true" headerText="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NtUnitRate.label}" id="c7">
              <af:inputText value="#{row.bindings.NtUnitRate.inputValue}"
                            label="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NtUnitRate.label}"
                            required="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NtUnitRate.mandatory}"
                            columns="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NtUnitRate.displayWidth}"
                            maximumLength="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NtUnitRate.precision}"
                            shortDesc="#{bindings.ServiceTariffMappingDtlsRVO1.hints.NtUnitRate.tooltip}" id="it6">
                <f:validator binding="#{row.bindings.NtUnitRate.validator}"/>
              </af:inputText>
            </af:column>
            <af:column sortProperty="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfGrt.name}" filterable="true"
                       sortable="true" headerText="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfGrt.label}" id="c8">
              <af:inputText value="#{row.bindings.TrfGrt.inputValue}"
                            label="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfGrt.label}"
                            required="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfGrt.mandatory}"
                            columns="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfGrt.displayWidth}"
                            maximumLength="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfGrt.precision}"
                            shortDesc="#{bindings.ServiceTariffMappingDtlsRVO1.hints.TrfGrt.tooltip}" id="it7">
                <f:validator binding="#{row.bindings.TrfGrt.validator}"/>
              </af:inputText>
            </af:column>
            <af:column sortProperty="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ChargePartyCode.name}" filterable="true"
                       sortable="true" headerText="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ChargePartyCode.label}"
                       id="c9">
              <af:inputText value="#{row.bindings.ChargePartyCode.inputValue}"
                            label="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ChargePartyCode.label}"
                            required="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ChargePartyCode.mandatory}"
                            columns="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ChargePartyCode.displayWidth}"
                            maximumLength="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ChargePartyCode.precision}"
                            shortDesc="#{bindings.ServiceTariffMappingDtlsRVO1.hints.ChargePartyCode.tooltip}" id="it8">
                <f:validator binding="#{row.bindings.ChargePartyCode.validator}"/>
              </af:inputText>
            </af:column>
          </af:table>
        </af:panelCollection>
      </af:panelGroupLayout>
    </jsp:root>

  • Not able to export all table data to excel

    Hi All,
    I am using jdev 11.1.1.4.0
    I want to export all my table data to a excel file.
    I used ADF inbuilt <af:exportCollectionActionListener/> to do the same.
    Also, I have pagination on my JSPX.
    When I click on export button to export the data, it exports current records in the page not all the records.
    For instance, I have 100 records in my table and I am displaying 20 records per page.
    When I click on export to excel image, it exports current 20 records instead of exporting all 100 records.
    Please tell me how to export all the records to the excel.
    Sample code,
    <af:exportCollectionActionListener exportedId="t1" type="excelHTML"/>t1 is id of my table from which I want to export the data.
    also, I have tried exportedRows="all" - but it doesn't work!!!!
    Appreciate your help.
    Thanks and Regards,
    Madhav K.

    Hi Arunkumar,
    thanks for your reply.
    Yes, it works....
    But I don't want to do the same in such way.
    Because almost every page I have export to excel functionality.
    So if follow this way then I have extra table on every page. I don't want this in my application.
    Is there any other way???
    Thanks and Regards,
    Madhav K.

  • How to export sql table data to Excel/PDf using Storedprocedure?

    Hi ,
            I have one table in sqlserver2008R2 that named "Customer" so that table hold the 1 Lac rows. Now I want send this table data to Excel/pdf with Columns using Storedprocedure.
       I have tried this using xp_cmdshell so This is not working for me.
    finally i want to get data in Excel and pdf also.
    Please guide me

    You can actually run an Excel Macro to grab the data from the SQL Server DB.  Below are some samples.
    Sub ADOExcelSQLServer()
    ' Carl SQL Server Connection
    ' FOR THIS CODE TO WORK
    ' In VBE you need to go Tools References and check Microsoft Active X Data Objects 2.x library
    Dim Cn As ADODB.Connection
    Dim Server_Name As String
    Dim Database_Name As String
    Dim User_ID As String
    Dim Password As String
    Dim SQLStr As String
    Dim rs As ADODB.Recordset
    Set rs = New ADODB.Recordset
    Server_Name = "Excel-PC\SQLEXPRESS" ' Enter your server name here
    Database_Name = "Northwind" ' Enter your database name here
    User_ID = "" ' enter your user ID here
    Password = "" ' Enter your password here
    SQLStr = "SELECT * FROM dbo.Orders" ' Enter your SQL here
    Set Cn = New ADODB.Connection
    Cn.Open "Driver={SQL Server};Server=" & Server_Name & ";Database=" & Database_Name & _
    ";Uid=" & User_ID & ";Pwd=" & Password & ";"
    rs.Open SQLStr, Cn, adOpenStatic
    ' Dump to spreadsheet
    With Worksheets("sheet1").Range("a1:z500") ' Enter your sheet name and range here
    .ClearContents
    .CopyFromRecordset rs
    End With
    ' Tidy up
    rs.Close
    Set rs = Nothing
    Cn.Close
    Set Cn = Nothing
    End Sub
    Sub ADOExcelSQLServer()
    Dim Cn As ADODB.Connection
    Dim Server_Name As String
    Dim Database_Name As String
    Dim User_ID As String
    Dim Password As String
    Dim SQLStr As String
    Dim rs As ADODB.Recordset
    Set rs = New ADODB.Recordset
    Server_Name = "LAPTOP\SQL_EXPRESS" ' Enter your server name here
    Database_Name = "Northwind" ' Enter your database name here
    User_ID = "" ' enter your user ID here
    Password = "" ' Enter your password here
    SQLStr = "SELECT * FROM Orders" ' Enter your SQL here
    Set Cn = New ADODB.Connection
    Cn.Open "Driver={SQL Server};Server=" & Server_Name & ";Database=" & Database_Name & _
    ";Uid=" & User_ID & ";Pwd=" & Password & ";"
    rs.Open SQLStr, Cn, adOpenStatic
    With Worksheets("Sheet1").Range("A2:Z500")
    .ClearContents
    .CopyFromRecordset rs
    End With
    rs.Close
    Set rs = Nothing
    Cn.Close
    Set Cn = Nothing
    End Sub
    Sub TestMacro()
    ' Create a connection object.
    Dim cnPubs As ADODB.Connection
    Set cnPubs = New ADODB.Connection
    ' Provide the connection string.
    Dim strConn As String
    'Use the SQL Server OLE DB Provider.
    strConn = "PROVIDER=SQLOLEDB;"
    'Connect to the Pubs database on the local server.
    strConn = strConn & "DATA SOURCE=(local);INITIAL CATALOG=NORTHWIND.MDF;"
    'Use an integrated login.
    strConn = strConn & " INTEGRATED SECURITY=sspi;"
    'Now open the connection.
    cnPubs.Open strConn
    ' Create a recordset object.
    Dim rsPubs As ADODB.Recordset
    Set rsPubs = New ADODB.Recordset
    With rsPubs
    ' Assign the Connection object.
    .ActiveConnection = cnPubs
    ' Extract the required records.
    .Open "SELECT * FROM Categories"
    ' Copy the records into cell A1 on Sheet1.
    Sheet1.Range("A1").CopyFromRecordset rsPubs
    ' Tidy up
    .Close
    End With
    cnPubs.Close
    Set rsPubs = Nothing
    Set cnPubs = Nothing
    End Sub
    Finally, you can run a SProc in SQL Server, from Excel, if you want the SProc to do the export.
    Option Explicit
    Sub Working2()
    'USE [Northwind]
    'GO
    'DECLARE @return_value int
    'EXEC @return_value = [dbo].[TestNewProc]
    ' @ShipCountry = NULL
    'SELECT 'Return Value' = @return_value
    'GO
    Dim con As Connection
    Dim rst As Recordset
    Dim strConn As String
    Set con = New Connection
    strConn = "Provider=SQLOLEDB;"
    strConn = strConn & "Data Source=LAPTOP\SQL_EXPRESS;"
    strConn = strConn & "Initial Catalog=Northwind;"
    strConn = strConn & "Integrated Security=SSPI;"
    con.Open strConn
    'Put a country name in Cell E1
    Set rst = con.Execute("Exec dbo.TestNewProc '" & ActiveSheet.Range("E1").Text & "'")
    'The total count of records is returned to Cell A5
    ActiveSheet.Range("A5").CopyFromRecordset rst
    rst.Close
    con.Close
    End Sub
    Sub Working()
    'USE [Northwind]
    'GO
    'DECLARE @return_value int
    'EXEC @return_value = [dbo].[Ten Most Expensive Products]
    'SELECT 'Return Value' = @return_value
    'GO
    Dim con As Connection
    Dim rst As Recordset
    Set con = New Connection
    con.Open "Provider=SQLOLEDB;Data Source=LAPTOP\SQL_EXPRESS;Initial Catalog=Northwind;Integrated Security=SSPI;"
    Set rst = con.Execute("Exec dbo.[Ten Most Expensive Products]")
    'Results of SProc are returned to Cell A1
    ActiveSheet.Range("A1").CopyFromRecordset rst
    rst.Close
    con.Close
    End Sub
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • Exporting fieldsymbol table data to Excel

    hi,
    I'm using dynamic select query and fetching into fieldsymbols table.
    now i want to export above fieldsymbol table data to csv file.
    thanks,
    gupta.

    Hi ,
    You can do the same using GUI_DOWNLOAD. First you need to create one more internal table with one field (length as per ur requirement) and populate this internal table by comma seperator. Then use the FM GUI_DOWNLOAD with file extension CSV.
    Thanks.
    Subhankar

  • EXPORT/IMPORT TABLE DATA FROM ONE SCHEMA TO ANOTHER ONE (S.O.S)

    Hi,
    I urgently need your help:(, I have two different instances, in each of them there are two schemas, A and B; which tables are the same, but I need to transfer JUST the table data from A's tables to B's tables, how can I do so??
    Thanks in advance,
    Isabel

    The total number of tables is 989:(And how many do you want ? If 988, and if you're on a 10g db, you can use exclude parameter from expdp/impdp?
    Nicolas.

  • Exporting xmltype table data into xml/txt file

    I want to export data stored in oracle as xmltype table into xml format file.
    I want to use alternatives to the method shown below as my xml file is large.
    set long 10000000
    spool c:\\StudentXMLJan08.xml
    SELECT
    XMLElement("Student",
    XMLForest(s.studentid "studentid",
    s.firstname "firstname",
    s.lastname "surname"),
    XMLElement("enrollments",
    (SELECT XMLAGG(
    XMLForest(sc.coursecode "courseid"))
    FROM studentcourse sc
    WHERE sc.studentid = s.studentid
    and sc.is_approved='Y'
    and sc.takenyear='2008'
    and sc.takenterm='1')))
    FROM student s
    where s.statuscode in (select studentstatuscode from studentstatus where studentstatusactive=1)
    order by s.studentid;
    spool off
    please help, thank you

    How's this one for size
    SQL> create or replace view DEPARTMENT_XML of xmltype
      2  with object id
      3  (
      4    'DEPARTMENT'
      5  )
      6  as
      7  select xmlElement
      8         (
      9           "Departments",
    10           (
    11             select xmlAgg
    12                    (
    13                      xmlElement
    14                      (
    15                      "Department",
    16                      xmlAttributes( d.DEPARTMENT_ID as "DepartmentId"),
    17                      xmlElement("Name", d.DEPARTMENT_NAME),
    18                      xmlElement
    19                      (
    20                        "Location",
    21                        xmlForest
    22                        (
    23                           STREET_ADDRESS as "Address", CITY as "City", STATE_PROVINCE as "State",
    24                           POSTAL_CODE as "Zip",COUNTRY_NAME as "Country"
    25                        )
    26                      ),
    27                      xmlElement
    28                      (
    29                        "EmployeeList",
    30                        (
    31                          select xmlAgg
    32                                 (
    33                                   xmlElement
    34                                   (
    35                                     "Employee",
    36                                     xmlAttributes ( e.EMPLOYEE_ID as "employeeNumber" ),
    37                                     xmlForest
    38                                     (
    39                                       e.FIRST_NAME as "FirstName", e.LAST_NAME as "LastName", e.EMAIL as "EmailAddre
    ss",
    40                                       e.PHONE_NUMBER as "Telephone", e.HIRE_DATE as "StartDate", j.JOB_TITLE as "Job
    Title",
    41                                       e.SALARY as "Salary", m.FIRST_NAME || ' ' || m.LAST_NAME as "Manager"
    42                                     ),
    43                                     xmlElement ( "Commission", e.COMMISSION_PCT )
    44                                   )
    45                                 )
    46                            from HR.EMPLOYEES e, HR.EMPLOYEES m, HR.JOBS j
    47                           where e.DEPARTMENT_ID = d.DEPARTMENT_ID
    48                             and j.JOB_ID = e.JOB_ID
    49                             and m.EMPLOYEE_ID = e.MANAGER_ID
    50                        )
    51                      )
    52                    )
    53                  )
    54             from HR.DEPARTMENTS d, HR.COUNTRIES c, HR.LOCATIONS l
    55            where d.LOCATION_ID = l.LOCATION_ID
    56              and l.COUNTRY_ID  = c.COUNTRY_ID
    57           )
    58         )
    59    from dual
    60  /
    View created.
    SQL> create or replace trigger DEPARTMENT_DML
      2  instead of INSERT or UPDATE or DELETE
      3  on DEPARTMENT_XML
      4  begin
      5    null;
      6  end;
      7  /
    Trigger created.
    SQL> declare
      2    cursor getDepartments is
      3      select ref(d) XMLREF
      4        from DEPARTMENT_XML d;
      5    res boolean;
      6    targetFolder varchar2(1024) :=  '/public/Departments';
      7  begin
      8    if dbms_xdb.existsResource(targetFolder) then
      9       dbms_xdb.deleteResource(targetFolder,dbms_xdb.DELETE_RECURSIVE_FORCE);
    10    end if;
    11    res := dbms_xdb.createFolder(targetFolder);
    12    for dept in getDepartments loop
    13      res := DBMS_XDB.createResource(targetFolder || '/Departments.xml', dept.XMLREF);
    14    end loop;
    15  end;
    16  /
    PL/SQL procedure successfully completed.
    SQL> select path
      2    from path_view
      3   where equals_path(RES,'/public/Departments/Departments.xml') = 1
      4  /
    PATH
    /public/Departments/Departments.xml
    SQL> select xdburitype('/public/Departments/Departments.xml').getXML()
      2    from dual
      3  /
    XDBURITYPE('/PUBLIC/DEPARTMENTS/DEPARTMENTS.XML').GETXML()
    <Departments>
      <Department DepartmentId="60">
        <Name>IT</Name>
        <Location
    SQL> quit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    C:\Temp>ftp localhost
    Connected to mdrake-lap.
    220- mdrake-lap
    Unauthorised use of this FTP server is prohibited and may be subject to civil and criminal prosecution.
    220 mdrake-lap FTP Server (Oracle XML DB/Oracle Database) ready.
    User (mdrake-lap:(none)): SCOTT
    331 pass required for SCOTT
    Password:
    230 SCOTT logged in
    ftp> cd /public/Departments
    250 CWD Command successful
    ftp> ls -l
    200 EPRT Command successful
    150 ASCII Data Connection
    -rw-r--r--   1 SCOTT    oracle         0 NOV 10 20:18 Departments.xml
    226 ASCII Transfer Complete
    ftp: 71 bytes received in 0.01Seconds 7.10Kbytes/sec.
    ftp> get Departments.xml -
    200 EPRT Command successful
    150 ASCII Data Connection
    <Departments><Department DepartmentId="60"><Name>IT</Name><Location><Address>2014 Jabberwocky Rd</Address><City>Southlak
    e</City><State>Texas</State><Zip>26192</Zip><Country>United States of America</Country></Location><EmployeeList><Employe
    e employeeNumber="103"><FirstName>Alexander</FirstName><LastName>Hunold</LastName><EmailAddress>AHUNOLD</EmailAddress><T
    elephone>590.423.4567</Telephone><StartDate>2006-01-03</StartDate><JobTitle>Programmer</JobTitle><Salary>9000</Salary><M
    anager>Lex De Haan</Manager><Commission></Commission></Employee><Employee employeeNumber="105"><FirstName>David</FirstNa
    me><LastName>Austin</LastName><EmailAddress>DAUSTIN</EmailAddress><Telephone>590.423.4569</Telephone><StartDate>2005-06-
    25</StartDate><JobTitle>Programmer</JobTitle><Salary>4800</Salary><Manager>Alexander Hunold</Manager><Commission></Commi
    ssion></Employee><Employee employeeNumber="106"><FirstName>Valli</FirstName><LastName>Pataballa</LastName><EmailAddress>
    VPATABAL</EmailAddress><Telephone>590.423.4560</Telephone><StartDate>2006-02-05</StartDate><JobTitle>Programmer</JobTitl
    e><Salary>4800</Salary><Manager>Alexander Hunold</Manager><Commission></Commission></Employee><Employee employeeNumber="
    107"><FirstName>Diana</FirstName><LastName>Lorentz</LastName><EmailAddress>DLORENTZ</EmailAddress><Telephone>590.423.556
    7</Telephone><StartDate>2007-02-07</StartDate><JobTitle>Programmer</JobTitle><Salary>4200</Salary><Manager>Alexander Hun
    old</Manager><Commission></Commission></Employee><Employee employeeNumber="104"><FirstName>Bruce</FirstName><LastName>Er
    nst</LastName><EmailAddress>BERNST</EmailAddress><Telephone>590.423.4568</Telephone><StartDate>2007-05-21</StartDate><Jo
    bTitle>Programmer</JobTitle><Salary>6000</Salary><Manager>Alexander Hunold</Manager><Commission></Commission></Employee>
    </EmployeeList></Department><Department DepartmentId="50"><Name>Shipping</Name><Location><Address>2011 Interiors Blvd</A
    ddress><City>South San Francisco</City><State>California</State><Zip>99236</Zip><Country>United States of America</Count
    ry></Location><EmployeeList><Employee employeeNumber="120"><FirstName>Matthew</FirstName><LastName>Weiss</LastName><Emai
    lAddress>MWEISS</EmailAddress><Telephone>650.123.1234</Telephone><StartDate>2004-07-18</StartDate><JobTitle>Stock Manage
    r</JobTitle><Salary>8000</Salary><Manager>Steven King</Manager><Commission></Commission></Employee><Employee employeeNum
    ber="122"><FirstName>Payam</FirstName><LastName>Kaufling</LastName><EmailAddress>PKAUFLIN</EmailAddress><Telephone>650.1
    23.3234</Telephone><StartDate>2003-05-01</StartDate><JobTitle>Stock Manager</JobTitle><Salary>7900</Salary><Manager>Stev
    en King</Manager><Commission></Commission></Employee><Employee employeeNumber="121"><FirstName>Adam</FirstName><LastName
    Fripp</LastName><EmailAddress>AFRIPP</EmailAddress><Telephone>650.123.2234</Telephone><StartDate>2005-04-10</StartDate><JobTitle>Stock Manager</JobTitle><Salary>8200</Salary><Manager>Steven King</Manager><Commission></Commission></Employee
    <Employee employeeNumber="124"><FirstName>Kevin</FirstName><LastName>Mourgos</LastName><EmailAddress>KMOURGOS</EmailAddress><Telephone>650.123.5234</Telephone><StartDate>2007-11-16</StartDate><JobTitle>Stock Manager</JobTitle><Salary>5800<
    /Salary><Manager>Steven King</Manager><Commission></Commission></Employee><Employee employeeNumber="123"><FirstName>Shan
    ta</FirstName><LastName>Vollman</LastName><EmailAddress>SVOLLMAN</EmailAddress><Telephone>650.123.4234</Telephone><Start
    Date>2005-10-10</StartDate><JobTitle>Stock Manager</JobTitle><Salary>6500</Salary><Manager>Steven King</Manager><Commiss
    ion></Commission></Employee><Employee employeeNumber="128"><FirstName>Steven</FirstName><LastName>Markle</LastName><Emai
    lAddress>SMARKLE</EmailAddress><Telephone>650.124.1434</Telephone><StartDate>2008-03-08</StartDate><JobTitle>Stock Clerk
    </JobTitle><Salary>2200</Salary><Manager>Matthew Weiss</Manager><Commission></Commission></Employee><Employee employeeNu
    mber="127"><FirstName>James</FirstName><LastName>Landry</LastName><EmailAddress>JLANDRY</EmailAddress><Telephone>650.124
    .1334</Telephone><StartDate>2007-01-14</StartDate><JobTitle>Stock Clerk</JobTitle><Salary>2400</Salary><Manager>Matthew
    Weiss</Manager><Commission></Commission></Employee><Employee employeeNumber="126"><FirstName>Irene</FirstName><LastName>
    Mikkilineni</LastName><EmailAddress>IMIKKILI</EmailAddress><Telephone>650.124.1224</Telephone>
    <StartDate>2002-06-07</St
    artDate><JobTitle>Public Relations Representative</JobTitle><Salary>10000</Salary><Manager>Neena Kochhar</Manager><Commi
    ssion></Commission></Employee></EmployeeList></Department></Departments>226 ASCII Transfer Complete
    ftp: 40392 bytes received in 0.08Seconds 480.86Kbytes/sec.
    ftp>

  • How to export the table data to the excel?

    Hi,
    I'm new to WebDynpro. im having a table 5rows and 6 columns, i need the data in the table to be exported to excel sheet by clicking on a button.
    As i went through some of the blogs and tutorials i couldn't understand the procedure, so could any one help out with detailed procedure.
    Thanks & Regards,
      Suresh

    HI! Suresh,
      This is a littile bit complicated process.Here i am trying to expalin the procedure,
    if you are having any problem then let me know.
    Following are the steps:--
    1.create two controls one of type linkToAction and other of type FileDownload and a location on your portal server say it's "/server0/temp/webdynpro/web/local/testexcel.xls"
    2.create a method in your view or controller and call this method as downLoadToXls()
    3.create a Value attribute of type binary in your context,say it's dataContent.
    4.Bind your linkToAction Control to the method downLoadToXls() and control   FileDownLoad data property to dataContent.
    5.In the init() Hook methos write the following code:--
    IWDAttributeInfo attInfo = wdContext.getNodeInfo().getAttribute("dataContent");
    IWDModifiableBinaryType binaryType = (IWDModifiableBinaryType)  attInfo.getModifiableSimpleType();
    // In addition the FileDownload UI element needs for defined resource types
    binaryType.setFileName("testexcel.xls");
    binaryType.setMimeType(WDWebResourceType.XLS);
    6.in DownLoadToXls() method add the following code:--
    try {
            out = new FileOutputStream(path);
           workBook = new HSSFWorkbook();
          hsSheet = workBook.createSheet("UserID");
         cs = workBook.createCellStyle();
         cs1 = workBook.createCellStyle();
         cs2 = workBook.createCellStyle();
         dataFormat = workBook.createDataFormat();
         f = workBook.createFont();
         f1 = workBook.createFont();
         f.setFontHeightInPoints((short) 12);
        //make it blue
         f.setColor( (short)HSSFFont.COLOR_NORMAL );
         //make it bold
        //arial is the default font
        f.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
        //set font 2 to 10 point type
        f1.setFontHeightInPoints((short) 10);
        //make it red
        f1.setColor( (short)HSSFFont.COLOR_RED);
        //make it bold
        f1.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
        f1.setStrikeout(false);
       cs.setFont(f);
       cs.setDataFormat(dataFormat.getFormat("#,##0.0"));
       //set a thick border
       cs2.setBorderBottom(cs2.BORDER_THICK);
       //fill w fg fill color
       cs2.setFillPattern((short) HSSFCellStyle.SOLID_FOREGROUND);
       cs2.setFillBackgroundColor((short)HSSFCellStyle.SOLID_FOREGROUND);
       //set the cell format to text see HSSFDataFormat for a full list
       cs2.setDataFormat(HSSFDataFormat.getBuiltinFormat("text"));
       cs2.setFont(f1);
       cs2.setLocked(true);
        cs2.setWrapText(true);
        hsSheet.createFreezePane(0,1,1,1);
        row = hsSheet.createRow(0);
         cell = row.createCell((short)0 ,0);
          cell.setCellValue("User ID");
          cell.setCellStyle(cs2);
          cell = row.createCell((short)1 ,1);
          cell.setCellValue("Last Changed Password Date");
          cell.setCellStyle(cs2);
        int nodeSize = wdContext.nodeUserIDAndPass().size();
        for(int jCount=0; jCount < nodeSize; jCount++) {
         row = hsSheet.createRow(jCount+1);
           for(int count = 0; count < 2; count++) {
          if(count == 0) {
         cell = row.createCell((short)0,count);               
    cell.setCellValue(wdContext.nodeUserIDAndPass().getUserIDAndPassElementAt(jCount).getCtx_UserID());
          if(count == 1) {
            cell = row.createCell((short)1,count);
      cell.setCellValue(wdContext.nodeUserIDAndPass().getUserIDAndPassElementAt(jCount).getCtx_ChangedPasswd());
          cell.setCellStyle(cs2);                            
                                                               workBook.write(out);
    out.close();
    //Read the file that was created.
            FileInputStream fin = new FileInputStream(path);
            byte b[] = new byte[fin.available()];
           fin.read(b,0,b.length);
           fin.close();
            wdContext.currentContextElement().setDataContent(b);
      }catch(Exception e)     {
      wdComponentAPI.getComponent().getMessageManager().reportException("Exception while reading file "+e,true);                   }
    7. Add the follwoing constant at the end:--
    private FileOutputStream out = null;
         private HSSFWorkbook workBook = null;
         private HSSFSheet hsSheet = null;
         private HSSFRow row = null;
         private HSSFCell cell = null;
         private HSSFCellStyle cs = null;
         private HSSFCellStyle cs1 = null;
         private HSSFCellStyle cs2 = null;
         private HSSFDataFormat dataFormat = null;
         private HSSFFont f = null;
         private HSSFFont f1 = null;
         private String path = "/server0/temp/webdynpro/web/local/testexcel.xls";
    8.Add the follwowing jars in your classPath.
    1)poi-3.0.1-FINAL-20070705.jar
    2)jxls.jar
    regards,
    Mithileshwar

  • Cl_gui_alv_grid:exporting protected table data MT_OUTTAB to local int.table

    Hi guys,
    this is my problem.
    I've an instance of cl_gui_alv_grid in the reference variable gos_alv. This instance
    is populated by "sap GOS service". 
    Now, i'd like to save locally the internal data table of the gos_alv (populated
    automatically by the service call).
    The data tables is called "mt_outtab" and is a standard protected component of the cl_gui_alv_grid class
    (you can see it in the se24 transaction).
    I think to create a subclass of the cl_gui_lav_grid and make a public method to
    save data like this :
    field-symbols: <outtab> type standard table.
    *       CLASS lcl_gui_alv_grid DEFINITION
    class lcl_gui_alv_grid definition inheriting from cl_gui_alv_grid.
      public section.
        methods : get_tab_line.
    endclass.                    "lcl_gui_alv_grid DEFINITION
    *       CLASS lcl_gui_alv_grid IMPLEMENTATION
    class lcl_gui_alv_grid implementation.
      method get_tab_line.
    * mt_outtab is the data table held as a protected attribute
    * in class cl_gui_alv_grid.
        assign me->mt_outtab->* to <outtab>. "Original data
      endmethod.                    "get_tab_line
    endclass.                    "lcl_gui_alv_grid IMPLEMENTATION
    data : l_alv type ref to lcl_gui_alv_grid.
    But when i do a downcast like this :
    l_alv ?= gos_alv.
    I have an exception of casting error. SO, how i can extract protected data into
    local internal table?
    I've already try to debug the service that build the alv list to understand how the data table
    is populated but it's too complex.
    Thank you
    Andrea

    Hi,
    not yet any suggestion?
    Generally speaking, i cannot understand why i cannot use down-cast with an instance declared as a subclass of a super-class.
    Many examples, shows that i can create a sub-class inheriting from a super-class, add methods and attributes, make something like this : subclass ?= superclass and the call method of the subclass.
    But when i try to do the same with a class derived from cl_gui_alv_grid, i have always a casting type exception in the down-cast instruction.
    Could you explain me why?
    Thank you very much
    Andrea

  • Export Pivot table data to a Excel file

    Hi All,
    I am using OBIEE 10.1.3.
    In my asnwers I am displaying the Pivot view and want to export the results to a excel sheet.The dowlnoad option is not coming for Pivit view.
    In case of compound view I am able to see the download option to export to excel sheet.
    Please suggest.
    thanks

    The Compound Layout has a purpose and that is to display your report with the download optons you can "turn on," including "download to Excel." To answer your question of somehow enabling a "download link" from the Pivot Table view, sorry, you can't do that. However, here's what you can do:
    In Answers, use the Compound Layout view to download the pivot table. If the Compound Layout view is used for other purposes and you need only the pivot table view to download (as a report designer) and you really need this functionality, then create a duplicate of the Compound Layout and put only your pivot table in it. Now you can download.
    If you are talking about dashboards, then use the Properties>Report Links from the Properties button of the report and check off "download." Again, if your Compound Layout is used for other purposes (and requires other views in it), then drag the report into another section of the dashboard and in Edit Dashobard, click on the Properties of the report>Show View>Compound Layout:2 that you created in the previous paragraph. Enable downloading on this and you can download only the Pivot table.

  • Export Advance Table Data Error

    Hi All,
    Please help for the following error
    I have a advance table region in my custom page with a export button. The advance table region reference to a view with binding method 'OracleNamed' and there are 2 parameters.
    When I query the advance table region, records shows correctly. However, when I click on the export button, it show exception error
    Exception Details.
    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT DISTINCT PV.VENDOR_NAME "SUPPLIER_NAME" ,PHA.SEGMENT1 "PO_NUMBER" ,PHA.TYPE_LOOKUP_CODE "TYPE" ,HL1.LOCATION_CODE "SHIP_TO_LOC" ,HL2.LOCATION_CODE "BILL_TO_LOC" ,PLA.LINE_NUM ,MSI.SEGMENT1 "ITEM_NAME" ,PLA.QUANTITY "QTY" ,PLA.UNIT_PRICE "PRICE" ,(PLA.QUANTITY*PLA.UNIT_PRICE) "TOTAL" FROM PO_HEADERS_ALL PHA , PO_VENDORS PV ,HR_LOCATIONS HL1 ,HR_LOCATIONS HL2 ,PO_LINES_ALL PLA ,MTL_SYSTEM_ITEMS_B MSI WHERE PHA.VENDOR_ID=PV.VENDOR_ID AND PHA.PO_HEADER_ID=PLA.PO_HEADER_ID AND PHA.SHIP_TO_LOCATION_ID=HL1.LOCATION_ID AND PHA.BILL_TO_LOCATION_ID=HL2.LOCATION_ID AND PLA.ITEM_ID=MSI.INVENTORY_ITEM_ID and pha.SEGMENT1 like :p_segment1 AND PHA.SEGMENT1 LIKE NVL(:p_segment1,PHA.SEGMENT1) AND PV.VENDOR_NAME LIKE NVL(:p_vendor_name,PV.VENDOR_NAME)
    # Detail 0 ## java.sql.SQLException: Attempt to set a parameter name that does not occur in the SQL: 1 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:175) at oracle.jdbc.driver.OraclePreparedStatement.setObjectAtName(OraclePreparedStatement.java:8210) at oracle.jbo.server.OracleSQLBuilderImpl.bindParamValue(OracleSQLBuilderImpl.java:3916) at oracle.jbo.server.BaseSQLBuilderImpl.bindParametersForStmt(BaseSQLBuilderImpl.java:3335) at oracle.jbo.server.ViewObjectImpl.bindParametersForCollection(ViewObjectImpl.java:13759) at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:801) at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:666) at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3655)
    If I change the bind method to 'OraclePosition', the export button works correctly.
    Can anyone help? Thanks in advance
    Regards
    Lawrence

    OA Framework does not support the "OracleNamed" style of binding. Please review Chapter 8 of the OAF Developers Guide (available in the JDeveloper online help) - rules M23 and M66 apply in this case.

  • How do i export the table data based on some condition for backup

    Is is syntax correct
    exp scott@orcl92 file=emp_29aug.dmp tables=emp
    query=\"where emp_no in (1,2,3,4) \".
    How do i take the backup of more than one table?
    what is the syntax for that
    Thans

    Thanks for your response
    If i want to add more than one condition in the query, then how do i do that
    exp scott/tiger@orcl file=scott.dmp tables=(emp, dept) query=\"where deptno = 30\" and emp_no in (1,2,3,4);
    how do i do that

  • Exporting MySQL table data to a file in location of choice

    Hi everyone,
    As I'm still not all too familiar with JDBC and MySQL, I'm running into a problem and I was hoping somebody could give me a push in the right direction. What I want to do is create a Java tool which performs a query on a database, to then return the results in a file on the user's computer, not on the mySQL server itself. I know that you can easily create a file using the
    SELECT * INTO OUTFILE
    command, but this creates a file on the MySQL server, not on the computer of the person running the Java tool. Basically I would like the program to have a 'browse' button, with which I can specify where the file should be saved. Can anybody tell me how I could possibly accomplish this? I was guessing something with the JFileChooser would be an option, but can't seem to find exactly how to code it.
    Thanks a lot for any input in advance, your help is greatly appreciated!
    best regards

    Thanks for your swift replies!
    I'm sorry I had the context mistaken, I thought as it was handling MySQL data, it would be related to the JDBC theme. But your answer has definitely helped me along, thanks for that! I will look at that tutorial you linked through... Am I right in assuming that I can run the query, save the results in the ResultSet rs variable and then pass this to the file opened/created by JFileChooser?
    Thanks again for your time!

  • How can we export table data to a CSV file??

    Hi,
    I have the following requirement. Initially business agreed upon, exporting the table data to Excel file. But now, they would like to export the table data to a CSV file, which is not being supported by af:exportCollectionActionListener component.
    Because, when i opened the exported CSV file, i can see the exported data sorrounded with HTML tags. Hence the issue.
    Does someone has any solution for this ... Like, how can we export the table data to csv format. And it should work similar to exporting the data to excel sheet.
    For youre reference here is the code which i have used to export the table data..
    ><f:facet name="menus">
    ><af:menu text="Menu" id="m1">
    ><af:commandMenuItem text="Print" id="cmi1">
    ><af:exportCollectionActionListener exportedId="t1"
    >title="CommunicationDistributionList"
    >filename="CommunicationDistributionList"
    >type="excelHTML"/> ---- I tried with removing value for this attribute. With no value, it did not worked at all.
    ></af:commandMenuItem>
    ></af:menu>
    ></f:facet>
    Thanks & Regards,
    Kiran Konjeti

    Hi Alex,
    I have already visited that POST and it works only in 10g. Not in 11g.
    I got the solution for this. The solution is :
    Use the following code in jsff
    ==================
    <af:commandButton text="Export Data" id="ctb1">><af:fileDownloadActionListener contentType="text/csv; charset=utf-8"
    >filename="test.csv"
    >method="#{pageFlowScope.pageFlowScopeDemoAppMB.test}"/>
    ></af:commandButton>
    OR
    <af:commandButton text="Export Data" id="ctb1">><af:fileDownloadActionListener contentType="application/vnd.ms-excel; charset=utf-8"
    >filename="test.csv"
    >method="#{pageFlowScope.pageFlowScopeDemoAppMB.test}"/>
    ></af:commandButton>
    And place this code in ManagedBean
    ======================
    > public void test(FacesContext facesContext, OutputStream outputStream) throws IOException {
    > DCBindingContainer dcBindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    >DCIteratorBinding itrBinding = (DCIteratorBinding)dcBindings.get("fetchDataIterator");
    >tableRows = itrBinding.getAllRowsInRange();
    preparaing column headers
    >PrintWriter out = new PrintWriter(outputStream);
    >out.print(" ID");
    >out.print(",");
    >out.print("Name");
    >out.print(",");
    >out.print("Designation");
    >out.print(",");
    >out.print("Salary");
    >out.println();
    preparing column data
    > for(Row row : tableRows){
    >DCDataRow dataRow = (DCDataRow)row;
    > DataLoaderDTO dto = (DataLoaderDTO)dataRow.getDataProvider();
    >out.print(dto.getId());
    >out.print(",");
    >out.print(dto.getName());
    >out.print(",");
    >out.print(dto.getDesgntn());
    >out.print(",");
    >out.print(dto.getSalary());
    >out.println();
    >}
    >out.flush();
    >out.close();
    > }
    And do the following settings(*OPTIONAL*) for your browser - Only in case, if the file is being blocked by IE
    ==================================================================
    http://ais-ss.usc.edu/helpdoc/main/browser/bris004b.html
    This resolves implementation of exporting table data to CSV file in 11g.
    Thanks & Regards,
    Kiran Konjeti

Maybe you are looking for