Export data to XML from JSP possible?

I have a small JSP to retrieve data in a Browse form. Is there information on how to save information retrieved in a Browse (or Edit) form to XML output in order for a spreadsheet application (e.g. Excel) to pull up the data? I have not noticed this in the help files. Are there sample codes examples that illustrate this?
Is exporting data to XML even possible using JDeveloper 9.0.3?

You can call write XML on your ViewObject to get an XML representation.
If you are using IE you can change the content type for a page to :
<%@ page contentType="application/vnd.ms-excel" %>
This will open excel within your browser. It seems to deal nicely with any data in the page that is formatted in HTML <table> elements.
Matt

Similar Messages

  • Export Data to excel from JSP

    Hi Friends,
    I want to generate a excel file on click of a button storing the report whose content are based on some sql query. I got following code from the group.
    <%@ page language="java" import="java.io.*" %>
    <%@ page contentType="application/vnd.ms-excel" %>
    <%
    response.setHeader("Content-Disposition","attachment;filename=Test.xls");
    %>
    <html>
    <body>
    <table>
    <tr>
    <td>TnameA</td>
    <td>4.1.1999</td>
    <td>200.12</td>
    </tr>
    <tr>
    <td>TnameB</td>
    <td>03.10.2000</td>
    <td>2000</td>
    </tr>
    <tr>
    <td>TnameC</td>
    <td>22.12.1989</td>
    <td>400.60</td>
    </tr>
    </table>
    </body>
    </html>
    This works fine. But the generated excel file does not have the cell format. Background is white, with no cells being seen.
    Secondly, can i give the name dynamically for the excel file.
    Thanks
    RM

    hi
    following code should run. In such code you should be careful in two point:
    1. In statement (<%@page import="java.io.*"%><% ) no blank between %> and <%
    2. no html code, no header, nothing about html.
    you can change ( String message = ( String )session.getAttribute( "EXCEL" ); ) however you want.
    \t : next cell
    \n: next line
    <%@page language='java' contentType='text/html;'%>
    <%@page session="true"%>
    <%@page import="java.io.*"%><%
    response.setContentType("application/vnd.ms-excel");
    String excelFileName = "Hello";
    response.setHeader("Content-Disposition","attachment; filename=" + excelFileName+".xls" );
    String message = ( String )session.getAttribute( "EXCEL" );
    PrintWriter pw = response.getWriter();
    pw.println(message);
    pw.flush();
    pw.close();
    %>
    your second question : yes you can. ( excelFileName )

  • Displaying data in xml using jsp

    how do we display data in database from jsp using xlst format in xml browser view

    how do we display data in database from jsp using xlst
    format in xml browser viewRefer this Post
    http://forum.java.sun.com/thread.jsp?forum=45&thread=482077&tstart=0&trange=15
    -Regards
    Manikantan

  • Export Data To Excel From DVWP

    Hi,
    I created DVWP in SPD.
    Is it possible to Export Data To Excel From DVWP?
    What should I do?
    Thanks in advance!

    Hello,
    try this:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/c2e2eb0c-202e-49c1-80cb-2fbf5159b10c/how-to-export-dataview-webpart-to-an-excel-file?forum=sharepointcustomizationprevious
    Via script:
    http://ameyakawale.wordpress.com/2011/08/04/exporting-dataview-webpart-data-into-excel-using-javascript/
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/e01ed0bb-63bc-49fc-b1ff-5d2342f897ae/exporting-data-view-webpart-to-excel-spreadsheet?forum=sharepointcustomizationprevious
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • XML question export data to XML

    I need to export XML in a certain format. This is the first time i need to export XML. What i can do is:
    select xmlelement("IDpart",
         xmlelement("ID", XMLAttributes( e.ID_SUBID AS "ID_SUBID"),
              xmlelement("timeperiod", XMLAttributes( e.start_date AS "startdate"))))
    AS "result"
    from example e
    <IDpart><ID ID_SUBID="2:2_O_2"><timeperiod startdate="2008-01-22"></timeperiod></ID></IDpart>
    Create table script
    -- DDL for Table EXAMPLE
    CREATE TABLE "HR"."EXAMPLE"
    (     "ID_SUBID" VARCHAR2(20),
         "END_DATE" DATE,
         "START_DATE" DATE,
         "VALUE" NUMBER,
         "STATUS" VARCHAR2(5)
    -- DATA FOR TABLE EXAMPLE
    -- FILTER = none used
    -- INSERTING into EXAMPLE
    Insert into EXAMPLE (ID_SUBID,END_DATE,START_DATE,VALUE,STATUS) values ('2:2_O_2',to_date('22-JAN-08','DD-MON-RR'),to_date('22-JAN-08','DD-MON-RR'),0.2,'A');
    Insert into EXAMPLE (ID_SUBID,END_DATE,START_DATE,VALUE,STATUS) values ('2:2_O_2',to_date('22-JAN-08','DD-MON-RR'),to_date('22-JAN-08','DD-MON-RR'),0.2,'B');
    -- END DATA FOR TABLE EXAMPLE
    Can you help me to get my output like this?
    <IDpart><ID ID_SUBID= "2:2_O_2"/><timeperiod startdate="22-JAN-08"/> <Readings><Reading Value="0.2"> <statuscodes><code>A</code><code>B</code>
    </Reading></Readings></IDpart>
    ---------------------------------------------------

    My xml does summarize some data but i want it in another format/ range. Can you help me?
    My code:-->
    SELECT XMLElement("MeterReadingDocument",
    XMLAttributes('http://www.w3.org/2001/XMLSchema' AS "xmlns:xsd",
    'http://www.w3.org/2001/XMLSchema-instance' AS "xmlns:xsi"),
         XMLElement("Channels", XMLElement("Channel",
         Xmlelement("ChannelID",xmlattributes(d.CHANNELID_SPCID "IntervalChannelID")),
         Xmlelement("ContigiousIntervalSets",xmlelement("ContigiousIntervalSet",
    xmlattributes(d.REC_AANTAL "NumberOfReadings"),
    Xmlelement("TimePeriod",
    xmlattributes(to_char(d.START_TIME, 'dd-mm-yyyy"T"hh24:mi:ss"Z"') “StartTime", to_char(d.END_TIME, 'dd-mm-yyyy"T"hh24:mi:ss"Z"') "EndTime")),
         Xmlelement("Readings", xmlelement("Reading",xmlattributes(d.WAARDE "Value"),
    Xmlelement("Readingstatus",xmlelement("Unencodedstatus", xmlattributes(d.SOURCE "SourceValidation"),
    Xmlelement("StatusCodes", xmlagg(xmlelement("Code", d.DESCRIPTION))))))))))))
    .extract('*').getstringval() xml FROM DM_IEE d
    where to_char(d.END_TIME, 'dd-mm-yyyy"T"hh24:mi:ss"Z"')= '03-04-2007T09:55:00Z'
    Or to_char(d.END_TIME, 'dd-mm-yyyy"T"hh24:mi:ss"Z"')= '03-04-2007T10:00:00Z'
    group by d.CHANNELID_SPCID, d.REC_AANTAL, d.START_TIME, d.END_TIME, d.WAARDE, d.SOURCE
    My output-->
    <MeterReadingDocument xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Channels>
    <Channel>
    <ChannelID IntervalChannelID="68979_OP_98189091:10111"/>
    <ContigiousIntervalSets>
    <ContigiousIntervalSet>
    <TimePeriod StartTime="03-04-2007T09:55:00Z" EndTime="03-04-2007T10:00:00Z"/>
    <Readings>
    <Reading Value="-54.5">
    <Readingstatus>
    <Unencodedstatus SourceValidation="Passed">
    <StatusCodes>
    <Code>MANACCEPTED</Code>
    <Code>MISSING</Code>
    </StatusCodes>
    </Unencodedstatus>
    </Readingstatus>
    </Reading>
    </Readings>
    </ContigiousIntervalSet>
    </ContigiousIntervalSets>
    </Channel>
    </Channels>
    </MeterReadingDocument>
    <MeterReadingDocument xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Channels>
    <Channel>
    <ChannelID IntervalChannelID="68979_OP_98189091:10111"/>
    <ContigiousIntervalSets>
    <ContigiousIntervalSet NumberOfReadings="2">
    <TimePeriod StartTime="03-04-2007T09:50:00Z" EndTime="03-04-2007T09:55:00Z"/>
    <Readings>
    <Reading Value="87">
    <Readingstatus>
    <Unencodedstatus SourceValidation="Passed">
    <StatusCodes>
    <Code>MANACCEPTED</Code>
    <Code>MISSING</Code>
    </StatusCodes>
    </Unencodedstatus>
    </Readingstatus>
    </Reading>
    <Reading Value="-54.5">
    <Readingstatus>
    <Unencodedstatus SourceValidation="Passed">
    <StatusCodes>
    <Code>MANACCEPTED</Code>
    <Code>MISSING</Code>
    </StatusCodes>
    </Unencodedstatus>
    </Readingstatus>
    </Reading>
    </Readings>
    </ContigiousIntervalSet>
    </ContigiousIntervalSets>
    </Channel>
    </Channels>
    </MeterReadingDocument>
    2 rows selected
    The output i want:-->
    start_time is the start time of the first record and end_date the end_date of the last record. Can you help me?
    <MeterReadingDocument xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Channels>
    <Channel>
    <ChannelID IntervalChannelID="68979_OP_98189091:10111"/>
    <ContigiousIntervalSets>
    <ContigiousIntervalSet NumberOfReadings="2">
    <TimePeriod StartTime="03-04-2007T09:50:00Z" EndTime="03-04-2007T10:00:00Z"/>
    <Readings>
    <Reading Value="87">
    <Readingstatus>
    <Unencodedstatus SourceValidation="Passed">
    <StatusCodes>
    <Code>MANACCEPTED</Code>
    <Code>MISSING</Code>
    </StatusCodes>
    </Unencodedstatus>
    </Readingstatus>
    </Reading>
    </Readings>
    </ContigiousIntervalSet>
    </ContigiousIntervalSets>
    </Channel>
    </Channels>
    </MeterReadingDocument>

  • Export data to excel from oracle ?

    Hi,
    Is it possible to export the table data to an excel sheet??? If yes, please let me know how to achieve it !!!
    Regards
    Venkat

    Numerous threads about this issue....
    Just a pair of example...
    Export from oracle to excel
    Export Data to Excel using PL/SQL
    If you were not satisfied ... , you could search extensively the forums:
    http://forums.oracle.com/forums/search.jspa?threadID=&q=export+data+to+excel&objID=f75&dateRange=lastyear&userID=&numResults=15
    Greetings...
    Sim

  • How to read xml from jsp?

    i hav written database into xml file .
    now i want to read that xml file data from JSP
    pls help me out.

    Now is a good time to start reading about XML parsers and some OOP principles. It's not a good idea to mix all the xml parsing logic within a JSP. Try a Google search for XML parsers and find out which is the best way for you to go about.

  • Insert data into table from JSP page using Entity Beans(EJB 3.0)

    I want to insert data into a database table from JSP page using Entity Beans(EJB 3.0).
    1. I have a table 'FRIENDS', (in Oracle 10g database).
    2. It has two columns, 'NAME' and 'CITY'. Both have datatype strings(varchar2).
    3. Now from a JSP page, having two textfields, 'NAME' and 'CITY', I want to insert data into table 'FRIENDS'.
    4. In between JSP and database is a Entity Bean(EJB 3.0) and a stateless session bean.
    5. I am using JDev as editor.
    Please provide me code ASAP or link with similar example.
    Thank you.
    Anurag

    Hi,
    I am also trying that scenario. So u can
    Post the jsp form data to a Servlet which will act as a Controller.
    In the servlet invoke the business method.
    Similar kind of app is in www.roseindia.net
    Hope this would help u.
    Meanwhile if u get any optimal solution, pls post it.
    Thanks,
    Happy Java Coding.

  • Export data into Excel from PL/SQL Block

    Hi,
    Please tell me how to export data into excel comming out from PL/SQL code in APEX.
    We can simply export data into excel if we have Report region, but my query is dynamic for which i had to use PL/SQL block. Now i want to export that data into excel.
    Thanks & Regards,
    Smith

    Hi,
    Take a look here http://spendolini.blogspot.com/2006/04/custom-export-to-csv.html
    Regards
    Paul

  • EXPORT DATA TO EXCEL FROM PORTAL

    HELLO
    user has saved one of the web reports in his favourites...he has customized the report according to his needs and then saved it in his favourites...now when he acesses the report from his favourites and..
    enters the values for the variables
    the data is displyed accordinly as he customized it.
    now when he wants to export this data to excel he is getting the error.
    contact ur system admin..ur request cannot be processed.
    it is not happening with any of his other reports.its only this one he is not able to export the data.
    please suggest what steps can be taken

    yea the reports worked fine...it is only this report which is not exporting data...he is able to view all the data and everything in portal for this report but when he exports to excel he is getting this error.
    cannot find advanced load with uid:FILTER_PANE_ac_unid0_dropdown
    i tried with the oss notes but nothing..
    this is not an authorization issue as the user is able to acess the report.it is only that he is not able to export to excel..
    please let me know what can i do..
    thanks

  • Want to extract data in xml from pdf.....

    i am newbie to LIVECYCLE ES.
    i made a pdf form design.
    Now i need a process which which can extract data in xml format
    from pdf form...
    Please give me example which i can understood or...step by step information.

    Hi Arun,
    Where there you are using WHERE condition  in select statement while fetching the records?
    if yes means check for the fields are primary key, available in WHERE condition, or else create secondary index for those
    non Primary key Fields in WHERE condition.
    This may help you.
    Thanks and Regards,
    Prakash.K

  • How export data in Excel From Visual Composer

    Hay everybody,
    I would like to export my data result from Visual Composer to Excel. I've tried with an export data buton, but the exported file has a very bad format in Excel. I've tried an hyperlink buton which contain the Reptname data of the query too, but I can't keep my filters. This second solution can be nice for the format. If anyone knows how I can keep my filters, I would be fine.
    Thanks

    I did not get solution by using BW 3.5 , can we export data to Excel ? I am refering
    [HOW TO EXPORT DATA FROM VISUAL COMPOSER|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/47fe4fef-0d01-0010-6f87-ed8ecb479123?overridelayout=true] following link??

  • How to prevent data-sources.xml from being included in EAR

    I cannot get rid of the data-sources.xml file in my EAR file in the meta-inf folder.
    Deselecting the "Bundle Default data-sources.xml during deployment" in my preferences didn't have any effect. I also tried shutting down/restarting JDeveloper just in case it was cached.
    I also tried adding an exclude filter for data-sources.xml in my deploy profile for both Web files and WEB-INF/classes.

    The way I resolved this was to create the data-sources.xml, right click it, select Properties then uncheck Auto-update data sources.xml. That way it stays empty (hopefully).

  • Export data to excel from jsf

    How can I export data to excel sheet using jsf ..Any components available..
    Thanks in advance.

    There is no JSF component which does all the task, but there are enough ways to achieve this. You can use a reporting framework, such as JasperReports or BIRT. You can use a Java Excel API, such as Apache POI HSSF or Andy Khan's JExcelAPI. You can write a plain vanilla CSV or HTML TABLE file which can also be read by Excel.

  • How Get JDev to Omit data-sources.xml from every .war deployment

    I want a global data-sources.xml file to be used for all deployments. I do not want a copy of my standard data-sources.xml file to be included in every single deployment. I want my global data-sources.xml file to reside in the standard J2EE location of:
    oc4j_home/oc4j_instance_name/j2ee/config/data-sources.xml
    JDeveloper, for whatever reason, includes a data-sources.xml into every .war file. How do we configure JDev to omit the data-sources.xml? How do we set up JDev to automatically configure the .xml files (orion-application.xml, application.xml, etc) to use the global data-sources.xml? I do not want to manually do this for every deployment.
    I've been trying hard to find the answer in JDev online help and other OAS manuals. I read everywhere that I can have a "global" data-sources.xml, but I find no way to easily configure JDeveloper to do it this way.
    I would be grateful for you insights/help.
    thanks
    -Paul Janda

    I found the answer:
    In JDeveloper, Go to Tools | Preferences
    Select Deployment
    Uncheck the option for "Bundle default data-sources.xml during deployment"
    Upon the next generation of the .ear or .war file (including the next deployment), data-sources.xml will be omitted.
    -paul janda

Maybe you are looking for

  • How do I make multiple movies look like one?

    I created a demo of 136 slides with mostly screencaps and one small flash animation. The final published flash file is approximately 30MB. When the demo is run on multiple computers, the CPU utilization rises up to almost 100%, this makes the demo ru

  • Lens Correction and JPEGs

    Hi, I'm new to LR. I've spent the last two months watching every tutorial, practicing with a portfolio/video instructional off the Adode site and reorganizing my own photos and folders on my computer. I finally took the "bold" step to put a few of my

  • How to specify The Language in Which Siebel Installers and Wizards Run

    Hi, Yes (i think) i have read all about it in the manuals, but cannot find the solution to my problem :-( I am currently installing Siebel SBA 8.1.1.0 on a Windows 2003 SP2 server. This server has the following regional and language settings; - regio

  • Run process flow over database link

    Hi guys, I have two projects here, A and B. Each project has its own process flow, lets say Process A (in project A)and process B(in project B). I need to run process B in process A, so I use the database link, and WB_RT_API_EXEC.run_task function. B

  • Ipod nano game not working

    i had phase and the sims dj which cost alot to buy and now they dont work since i synced my ipod in itunes do i get a refund cause its not fair