Saving a form in JSP as .CSV format

Hi,
I have created a JSP page that contains a textbox. i want to save that textbox value to the CSV FIle. .
How can I save that information from the jsp page as a .csv format, and is there a way to save it straight into a .csv format?
Thanks,
subodh

yes you can do it by using poi api which is downloadable at apache web site using the HSSF class u can insert a value from text field to .csv

Similar Messages

  • EXPORT to text or CSV format from a form

    Dear all,
    Could you please help me to export the data from my form to a text file or to a csv format. I am very new to forms.
    i need to export the data from the oracle form to a text file or CSV file format.
    I had created form named as form1.
    In form1 i have a block named as block1. In this block i have 4fields as field1, field2, field3, field4. using a tabe1 which has the same 4fields.
    This form is in tabular form.
    Example:
    In the form i have data like as below and i got this data from table1. I used a execute query to get the data from the table into this form.
    field1 field2 field3 field4
    raj 1234 abc 510
    dil 777 hi 787
    Now my requirement is i need to export this data into a file, when i click on a button(Export) it has to browse for a folder on my desktop and i have to name the filename to save the data.
    Please help me.
    Thanks in advance.

    This should be almost same as in your previous task for import data.
    Try this:
    DECLARE
       v_file_name   VARCHAR2 (100);
       v_file        client_text_io.file_type;  
       v_delimiter VARCHAR2(1) := ',';
    BEGIN
       v_file_name := webutil_file.file_save_dialog;
       v_file := client_text_io.fopen (v_file_name, 'w');
       GO_BLOCK ('block1');  
       FIRST_RECORD;
       LOOP
            client_text_io.PUT_LINE(v_file, :block1.field1||v_delimiter||:BLOCK1.field2||v_delimiter||:BLOCK1.field3||v_delimiter||:BLOCK1.field4);
        IF :SYSTEM.LAST_RECORD = 'TRUE' THEN
             EXIT;
        END IF;     
        NEXT_RECORD;
       END LOOP;
       client_text_io.fclose (v_file);
    END;

  • How to run a report from oracle 10g form in .csv format

    dear all,
    how to run a report from oracle 10g form in .csv format? i've already run in pdf & excel format.
    i'm using
    SET_REPORT_OBJECT_PROPERTY (ro_report_id, report_desformat, 'PDF'); --for pdf
    SET_REPORT_OBJECT_PROPERTY (ro_report_id, report_desformat, 'SPREADSHEET'); ---for excel
    Please Help..

    i have already tried.
    but the report show in htm or html format. that file will not save into csv. please help.

  • Saving a report with two  query providers into .csv format

    Hi,
    I have developed a webi report which has two query providers. I have linked the objects from these two queries at the report level using merged dimensions. the report is running fine. When I save it in EXCEL or PDF it saves the same report, but when I try to save the report in .CSV format, the output of the second query provided is getting appened at the bottom of the report.
    Has anyone encountered similar problem is so whats the solution for it.
    For me business wants the report to be saved as .csv only as it acts as a source file to other application.

    Hi
    please take a look at the explanation area in the following note
    https://css.wdf.sap.corp/sap/support/notes/1417382
    When saving Web Intelligence document as Excel format, the result is saved based on the report design.
    When saving Web Intelligence document as CSV format, all data in the Data Provider are saved.
    I believe that the behaviour you described is by design so there is not much to do about it. You can open a case by SAP support though asking if this changed in a later service pack (actual service pack version for XI R2 is SP 6).
    Regards,
    Stratos

  • Saving the output of a .sql file in .csv format

    Hi,
    I am saving the output of a .sql file in .csv format. But the problem is , the record of few columns have "new line" character in it, so when it is getting saved in .csv format, those records are coming in multiple rows, but they should come in one single row in single block. Please advise how to overcome this problem.
    Regards,
    Niraj

    Hi Guys,
    I guess, there is a misunderstanding.
    He is talking about the issue caused as a result of the data containing a "CRLF" ( Carriage return Line feed ) .
    That is mainly a data issue.
    The query i presume, must be right.
    I guess you should be able to fix it using some string functions.
    Some thing similar to this
    CREATE TABLE ASH (NAME VARCHAR2(10))
    SELECT REPLACE(NAME, CHR(13)||CHR(10), 'ISH') FROM ASH;
    SELECT REPLACE(NAME, CHR(10), 'ISH') FROM ASH;
    SELECT REPLACE(NAME, CHR(13), 'ISH') FROM ASH;
    depending on the type of new line whether it is CR or LF. or CRLF.
    Regards
    Ashish/-

  • Change codepage in OIM reports saved in CSV format (e.g. UTF8 - Win1251)

    Hello guys.
    I have OIM V.9.1 installed on WebLogic. For some reason my customer would like to have OIM reports saved in CSV format encoded with codepage differ from default UTF8 (actually desired codepage is Windows 1251 but it is doesn't matter). I think that there should be a way to change default codepage for OIM reports via OIM's settings.
    There is no any information on it in the documentation.
    Does anybody already met this problem? Any help would be highly appreciated.
    Regards,
    Ivan

    Hello guys.
    I have OIM V.9.1 installed on WebLogic. For some reason my customer would like to have OIM reports saved in CSV format encoded with codepage differ from default UTF8 (actually desired codepage is Windows 1251 but it is doesn't matter). I think that there should be a way to change default codepage for OIM reports via OIM's settings.
    There is no any information on it in the documentation.
    Does anybody already met this problem? Any help would be highly appreciated.
    Regards,
    Ivan

  • Temse File form PU12 in CSV Format

    Hi,
    I need to download Temse file in csv format. Normally Temse file contains data without any separator and it used to have layout based on the interface layout for example, first 10 digit employee no, next 2 digit year.
    Is there any standard FM which can read the Interface Layout and separated the data with some separator. Or any FM which can give the interface layout information and I can split the data based on the information.
    Br,
    Piyush

    Hi Piyush,
    Please let me know how you got a CSV file from PU12
    Regards,
    Manu

  • Unable to save the data in a .CSV format

    Hi All,
    I am trying to pull some data with the help of the sql query from the database and then trying to save this string of data in csv file by using the following code as shown below.The problem iam facing here is that while the file Save as window opens stating to be saved as .CSV format but when i try to save it ,it doesnt givme a csv option ,only html option appears.Can any one help me on this..,,,,,,,,,,,,?
    <%@include file="jtfincl.jsp" %>
    <%@page session="false" %>
    <%@page import="java.io.PrintWriter"%>
    <%@page import="oracle.apps.ibe.util.RequestCtx"%>
    <%@page import="oracle.apps.iri.iribe.postsales.IrIbeOrderSearch"%>
    <%@page import="oracle.apps.ibe.util.*" %>
    <%@page import="java.io.IOException" %>
    <%
    pageContext.setAttribute("_securePage", "true", PageContext.REQUEST_SCOPE);
    pageContext.setAttribute("_guestNotAllowed", "true", PageContext.REQUEST_SCOPE);
    pageContext.setAttribute("_unapprovedNotAllowed", "true", PageContext.REQUEST_SCOPE);
    RequestCtx rCtx = RequestCtx.start(request, response);
    int status = Session.checkContextValues(request, response);
    if(RequestCtx.userIsAnonymous()) {
    signin(out, pageContext, request, response, false);
    return;
    // Set the response type which in this case will be a .csv file
    response.setContentType("application/csv");
    response.setHeader("Content-disposition","attachment;filename=SearchResults.csv");
    String queryStartDate = request.getParameter("queryStartDate");
    String queryEndDate = request.getParameter("queryEndDate");
    String queryField = request.getParameter("queryField");
    String queryOperator = request.getParameter("queryOperator");
    String queryValue = request.getParameter("queryValue");
    String queryOrderByField = request.getParameter("queryOrderByField");
    String showOpenOrdersOnly = request.getParameter("showOpenOrdersOnly");
    IrIbeOrderSearch orderSearch = new IrIbeOrderSearch(
    queryStartDate,
    queryEndDate,
    queryField,
    queryOperator,
    queryValue,
    queryOrderByField,
    showOpenOrdersOnly
    orderSearch.initialise();
    java.util.ArrayList results = orderSearch.getItemTrackerSearchResults();
         out.println("The result array size is======="+results.size()) ;
    // Output the results as the page resonse as a csv file
         try
    write(results, response.getWriter());
         catch(exception e)
         out.println("The stack trace is======="+e.printStackTrace()) ;
         if(IBE_logEnabled) IBEUtil.log("iribeCOtdOrdSearchExport.jsp","Inside the exception"+e.toString);
    %>
    <%!
    * This method will take a ResultSet and JspWriter object and print out the details of the ResultSet as a
    * comma seperated value file.
    * @param results
    * @param writer
    public static void write(java.util.ArrayList results, PrintWriter writer) {
    if(results == null || results.size() == 0) {
    writer.print("No Data Available");
    return;
    String [] data = null;
    String output = "";
              if(IBE_logEnabled) IBEUtil.log("iribeCOtdOrdSearchExport.jsp","Inside the write method");
    for(int i = 0; i < results.size(); i++) {
    data = (String []) results.get(i);
    output = "";
    for(int j = 0; j < data.length; j++) {
    // If its not the last column
    if(j != data.length - 1) {
    output += formatField(data[j]) + ",";
    // If it is the last column
    } else {
    output += formatField(data[j]);
    writer.println(output);
    writer.flush();
    * Format a string value so that it becomes a valid field in a .csv file. This involves making sure that any null
    * data is treated as an empty string, that any quotes are padded and if the file contains any commas that the
    * field is surrounded by quotes.
    * @param value
    private static String formatField(String value) {
    String output = null;
    // Check for null values
    if(value == null) {
    output = "";
    } else {
    output = value;
    // Pad any existing quotes
    output = output.replaceAll("\"", "\"\"");
    // If there is a space or commas then add surrounding quotes
    if(output.startsWith(" ") || output.endsWith(" ") || output.indexOf(",") != -1) {
    output = "\"" + output + "\"";
    return output;
    %>
    <%!
    void signin(
    JspWriter out,
    PageContext pageContext,
    HttpServletRequest request,
    HttpServletResponse response,
    boolean reauth
    ) throws IOException, SQLException, FrameworkException {
    String query = IBEUtil.passQueryString(request, null).toString();
    String uri = request.getRequestURI();
    String targetJsp = uri.substring(uri.lastIndexOf("/") + 1);
    String ref = null;
    if ("true".equals(pageContext.getAttribute("_securePage", PageContext.REQUEST_SCOPE))) {
    ref = RequestCtx.getSecureFormAction(targetJsp);
    } else {
    ref = RequestCtx.getNonSecureFormAction(targetJsp);
    if(!query.equals("")) {
    ref = oracle.apps.jtf.util.Utils.encode(ref + "?" + query);
    String redirect = RequestCtx.getSecureURL("ibeCAcpSSOLogin.jsp", "ref=" + ref + (reauth ? "&reauth=t" : ""));
    // don't add the ref if the session expired and restarted
    RequestCtx rCtx = RequestCtx.getRequestCtx();
    if(rCtx.startRequestException!=null) {
    redirect = RequestCtx.getSecureURL("ibeCAcpSSOLogin.jsp", "ibe_se=t"+(reauth ? "&reauth=t" : ""));
    RequestCtx.end(request);
    response.sendRedirect(redirect);
    regds
    manish
    %>

    This would occur if you were using IE and the requested URL doesn't contain the filename part. The real web browsers would pick up the filename from the response header flawlessly.
    Having said that, this kind of logic doesn't belong in a JSP. Use Java classes (Servlet, Bean, DAO). Further on, JSP/Servlet related questions should be posted in the JSP/Servlet forum.

  • How to Store resultset in .xls or .csv format

    How we can store a resultset in .xls or .csv format, When we don't know the colum names,or no. of columns in the result set, or you want to generlize the code.
    Each time for every query execution.getting the field from the resultset and appending ',' to it, and storing it in file is doing the work as i want to do.
    I want to use it as to take backup of any table from database server to my system
    if any other rather thn xls or csv by that i can reload it easily if required.
    Pleae help

    There are lots of ways to do this via tools or rolling your own. I use the FormattedDataSet API for this.
    import com.fdsapi.*;
    FormattedDataSet fds=new FormattedDataSet();
    String csv=null;
    csv=fds.getFormattedDataSet("select * from table", "csv");
    // or
    csv=fds.getFormattedDataSet(resultSet.getMetaData(), resultSet, "csv");Here is a link to a live demo that allows you to format in html/xml/csv. Although the example on this page formats form submissions the code would work for ResultSets too.
    http://ssouza.kgbinternet.com/fdsapi/basicdemo.jsp
    steve - http://www.fdsapi.com

  • Creating DataSources for File Source Systems in csv format in sap bw 7.0

    Hi,
    Please explain how to Create DataSources for File Source Systems in csv format in sap bw 7.0. WITH SCREENSHOTS
    Thanks
    JINI
    Edited by: Jini  Jayan on Jun 11, 2008 11:36 AM

    Step 1. Select Source systems under Modelling in the left panel. In the right panel, right-click Source systems and select Createu2026.
    Step 2. Select the FileSystem, manual meta data, data using file inte option, and then click  to continue.
    Step 3. Enter a name and a description for the source system, and then click  to create the source system.
    Now create an application component
    Step 1. Select InfoSources under Modelling in the left panel. In the right panel, right-click InfoSources and select Create application componentu2026.
    Step 2. Enter a name and a description for the application component, and then click  to continue. (BW automatically adds a prefix of "Z" to the technical names of application components, unlike the naming system used for other BW objects.If u give the name as AC_DEMO it will be saved as ZAC_DEMO in the system.
    Now create infosource
    Step 1.Select InfoSources under Modelling in the left panel. Right-click the newly created Application Component , and then select Create InfoSourceu2026.
    Step 2. Select the option Master data/texts/hierarchies, and then click  to continue.
    Step 3. Enter your infoobject name, and then click  to continue.
    Now you will be asked
    Infosource(name) assigned to Appln component(name)?
    Click continue
    Now go back to workbench and see the Infoobject listed under the Application component name (under Infosource)
    Right click the infoobject name and select Assign Datasource
    Enter the Infoobject name as Infosource name and the source system name and continue
    Now you ll get datasource assignment confirmations for Infosource_ATTR and Infosource_TEXT for master data and text.
    Click yes and continue
    Now you ll be taken to the Infosource(master data) change screen
    Source system name will be given
    Below that u need to give the datasource name u2026.._ATTR
    Click Activate.
    Now Click the tab transfer rules
    Copy the communication str infoobject names to an excel sheet
    For ex if your infoobj are IO_MATNUM and IO_MATNAME (material number and material name) copy and paste as
    IO_MATNUM      IO_MATNAME
    MAT001     TEA
    MAT002     COFFEE
    MAT003     SUGAR
    GIVE YOUR DATA IN THE EXCEL. AND CLICK File Save As CSV(comma delimited) and save to ur system. Give file name as something like infosourcename_ATTR.csv
    Now back to the Infosourcechange screen
    Source system name will be given
    Below that u need to give the datasource name u2026.._TEXT
    And activate
    Now Click the tab transfer rules
    Copy the communication str infoobject names to an excel sheet
    GIVE YOUR DATA IN THE EXCEL. AND CLICK File Save As CSV(comma delimited) and save to ur system. Give file name as something like infosourcename_TEXT.csv
    Now create Infoobject to load data
    Go to Infosourceu2014Appln Componentu2014InfoObju2014SourceSystemu2014rightclick->create Infopackage
    Step 2. Select the DataSource Material number (Master data), enter a description for the InfoPackage, and then click  to continue.
    Give infopackage description as Infopackage:InfoObj_ATTR
    Now take care to select the first item in datasource and click continue
    In the next screen click external data tab
    Click client workstation
    Datafileu2026.file name (browse to give the file u saved in ur system)
    There will be an option to remove header data from file.remove 1 row.
    File typeu2014csv file
    Now click schedule tabu2014start dataload immediatelyu2014start.
    In the same way
    Go to Infosourceu2014Appln Componentu2014InfoObju2014SourceSystemu2014rightclick->create Infopackage
    Step 2. Select the DataSource Material number (text)enter a description for the InfoPackage, and then click  to continue.
    Give infopackage description as Infopackage:InfoObj_TEXT
    Now take care to select the second  item in datasource and click continue
    In the next screen click external data tab
    Click client workstation
    Datafileu2026.file name (browse to give the file u saved in ur system)
    There will be an option to remove header data from file.remove 1 row.
    File typeu2014csv file
    Now click schedule tabu2014start dataload immediatelyu2014start.
    Click the icon below admn workbench to go to monitor and check the load
    Or you go back to Infosourceu2014Appln Componentu2014InfoObju2014right clickmaintain master data
    Click execute
    You can see the data load
    Hope this helps!!!

  • Output report data to excel file format or csv format

    Is there any way to save softcopy of report output to excel file format or csv format.

    Hi,
    Regarding csv file format, i have no issues. The file is generating without any issues in using oracle reports without using any PL/SQL code.
    My requirement is to design oracle reports to generate excel (.xls) file with multiple worksheets. Each sheets are having many data and graphs(chart).
    Using oracle reports alone, how to achieve this.
    In oracle reports 10g 1.2.0 version, I tried by creating .rdf file but, it is generating single worksheet only.
    In oracle reports 10g 1.2.0 ver, I tried by creating .jsp file. For this first i am creating excel template about how my ouput column headings all that going to be with one sample hard coded data and save the excel file as web page.
    Eg employee.html.
    Next open the html file in oracle reports builder and double click the websource now, you will see the jsp tags, html and xml tags. Now include the contentType="application/vnd.ms-excel " and charset also.
    Next, include the <rw:foreach id="G_EMPNO_1" src="G_EMPNO">
    here insert the fieldl for each column by removing the hard coded values.
    close the tag
    </rw:foreach>
    Save the file as .jsp and deploy it in oc4 enabled folder (say, devsuite_home/reports/j2ee/reports_ids/web
    Start the oc4J server
    Run it in the browser http://server:port/reports/emp.jsp?useride=uid/pwd@db
    It is invoking the Microsoft excel with 3 sheets default and my emp table output in the first page.
    We can save this output file as .xls file by clicking file -> save as.
    1) The question is, it is working fine with Microsoft excel 97-2003 version. But for excel 2007, i am not able to create single html file like how 2003 save web page option.
    2) I found this in oracle getting started demo
    http://www.oracle.com/technology/products/reports/htdocs/getstart/demonstrations/index.html
    Which is more useful. This is what i am looking for.
    I done that in excel 2003 as per demo. But excel 2007 with reports 10g issues.
    Is there any demo for 10g with excel 2007
    3) For most of excel issues working fine with excel 2003 and 10g. But excel 2007 with 10g reports are issues.
    I want the excel output from oracle reports with multiple worksheet similar to the above demo.
    Thank you.

  • How to use CSV format in making a data connection.

    Hello All,
    I have got a form to develop. There are over 1000 entries to be imported. Can I use CSV format to embed those data in the forms. Mainly those data would be embedded as dropdowns.If I can use how to do it ? If i can not use is there any better way without using the Database like MySQL or something.
    Thanks.
    Bibhu.

    Hi Afroz,
    To be more specific, if the csv file doesn't has header, please refer to this script to add header:
    $csv = Import-Csv d:\haha.csv -Header "UserA","UserXYZ","EmailA"
    Then you can loop this csv file to run the "add-mailboxpermission" cmdlet, I recommend you can test this script before running against production environment, please also note I haven't tested this script:
    $csv = Import-Csv d:\users.csv -Header "UserA","UserXYZ","EmailA"
    foreach($each in $csv){
    write-host "assign fullaccess permission of user $($each.UserXYZ) on mailbox $($each.EmailA)"
    get-mailbox -identity $each.EmailA | add-mailboxpermission -user $each.UserXYZ -accessrights 'fullaccess'
    If there is anything else regarding this issue, please feel free to post back.
    Best Regards,
    Anna Wang
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • How to export report IN CSV format through JAVA.

    how to export report in csv format.when try to export in csv format.its exporting into csv but report not containing column heading , report heading and it showing all the data in a single line.we have integrated the reports with java.

    Use a Java API which can create PDF files based on some collection of plain vanilla Java objects (List, String, Number, etc).
    Google can find them all. Just feed it with something like "Java PDF API" or so. A commonly used one is iText.
    That said, when talking about this in JSP context, ensure that you do NOT write raw Java code in JSP files using scriptlets. Raw Java code belongs in Java classes. In such case you need a Servlet. In JSP just use taglibs and EL to interact with backend Java code and data. Scriptlets are discouraged since over a decade.

  • Apply conditional formatting when a report is exported to CSV format

    Hello
    OBIEE dasboard has the option to export the report data to CSV format.
    But the problem is that on some columns of the report, it uses various different types of conditional formatting that tells, what to display when data is equal to one of those edge cases. So hence the report on the dashboard page shows accordingly which is fine.
    But when the report is exported to CSV format, no conditional formatting is applied and all the raw data is shown without any formatting.
    Is there any way to make sure that the conditional formatting is applied even in the data exported to CSV format.
    thanks

    CSV is supposed to be a data dump .. i dont think you can have formatting saved when u download csv file.. try downloading it to excel and changing it to CSV

  • Saving/naming forms issue

    Does anyone know what I can do about this? My client, a medical practice, is trying to save forms in a rather interesting way. They have charts that are divided up into different sections or tabs such as Progress Notes, Patient Info and more. These charts have been scanned, separated by tab and placed onto a shared network drive for all the employees within this practice to view.
    This practice has now gotten into creating new forms using Acrobat, which obviously eliminates the need to create more paper. The problem now is that each employees is saving these forms differently, in different locations as well, and it's a huge mess.
    The file name by which they'd like these chart sections to be saved follows this format:
    Last Name_First Name_Date of Birth_Section of Chart_Date of Service_Initials of Person Who Created the Form
    So, if the patient's name was Jeff Hansen, their date of birth was 7-30-1982, the section was Progress Notes, the date of service was 12-12-1997 and the initials were HM, the file name would look like this:
    HANSEN_JEFF_07-30-1982_PN_12-12-1997_HM
    With me so far?
    What they would like is, after someone's done with a form and they click Save As, they'd like something like this to pop up:
    LAST NAME:
    FIRST NAME:
    DOB:
    TAB:
    DOS:
    INITIALS:
    They would then be able to fill out these fields with the appropriate info, with the exception of TAB and INITIALS, which would be drop-down lists.
    After these have been filled out and the file name has been created, they now want the form to be saved in a specific folder-the same folder every time. Right now, there's files all over the place on their drive and it's a mess.
    Does ANYONE have ANY idea how the heck we can do this? Seriously? Any idea would be ideal! I don't know of how we can create a Save function like this using Acrobat or LiveCycle Designer. Please help!

    You will need to create a special trusted function using Acrobat JavaScript and place the code in one of Acrobat's application level JavaScript folders to perform the "saveAs" method. You will then be able to call the trusted function from LiveCycle Designer. Depending upon how you write your specific function you could pass the file name or have the function query for the name. See, http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=16903 , "How to "SaveAs" with filename generated from form field?" for an example of the necessary code.
    You will also will need to write some code to use the Acrobat JavaScript "Dialog" object for the pop-up and gathering the necessary data and generating the necessary file name. You might want to look at, http://www.windjack.com/products/acrodialogs.html, WindJack Solutions' AcroDialogs product to quickly and easily create the dialog pop-up.
    Neither of these scripts is a simple programing task.

Maybe you are looking for