Opening Excel sheet from server

Hi I have one requirement to open Excel Sheet.
The Excel sheet is residing in a directory parallel to WEB-INF. I am using Jboss server in Linux. in UI whenever I click on link I have to open Excel sheet from the server. Before opening Excel sheet I have to fill with some data. i am using JSP/Servlets .
Can any one help me on this?
Guru

this piece of code is just open a xsl file with writing some data on the file
it may be helpful for u .i am giving only logic.
import java.util.*;
import java.io.* ;
import java.text.* ;
public class a{
     // Main method
     public static void main (String args[])
          // Stream to write file
          //File file;
          FileWriter fout;
          String TimeStamp;
          try
          // Open an output stream
          Calendar currentdate= Calendar.getInstance();
               int currmonth=currentdate.get(Calendar.MONTH)+1;
               String strMonth="";
               if(currmonth<10)
                    strMonth="0"+currmonth;
               String wbname="Equifax"+strMonth+currentdate.get(Calendar.YEAR)+".xls";
               System.out.println(wbname);
          BufferedWriter outfile = new BufferedWriter(new FileWriter(wbname));
               //file=new File(filename);
               fout = new FileWriter (wbname);
          // Print a line of text
          TimeStamp = new java.util.Date().toString();
          //String filename1=file.getName();
          outfile.write(" Apply ");
          // Close our output stream
          outfile.close();          
          // Catches any error conditions
          catch (IOException e)
               System.err.println ("Unable to write to file");
               System.exit(-1);
}

Similar Messages

  • EXCEPTION RAISED WHILE OPENING EXCEL SHEET FROM E-BUSINESS SUITE FORM

    Hi,
    I got error message ORA-10656I when was trying to open excel sheet which is in my local drive from e-business suite form. the following is the code where it is raising error.
    Appid := dde.app_begin('C:\Program Files\Microsoft Office\Office12\EXCEL.EXE '||'D:\emp.xls' ,dde.app_mode_normal);
    Oracle EBS version : 11.5.10.2cu
    Server : HP
    OS : HP Unix 11.11
    Could anyone help me out
    Thanks

    Two different forum users, exactly the same question? Hardly possible. So I guess this is just a double post.

  • Problem when opening excel sheet in jsp

    Hi friends
    When i try to open excel sheet from my program I am getting two problems
    1. first row of excel sheet is empty
    2. while opening I am getting error message of "the file is not in a recognizable format"
    Please help me..It is an urgent work
    my code
    <%@page language="java" import="java.io.*,java.text.*,java.sql.*,java.util.*"%>
    <%
    Class.forName("org.gjt.mm.mysql.Driver");
    Connection conn = DriverManager.getConnection("jdbc:mysql://256.136.119.86/mydb","zzz","zzz");
    Statement st = conn.createStatement();
    StringBuffer sb = new StringBuffer();
    sb.append("SAP#" + "\t");
    sb.append("x-plant status" + "\t");
    sb.append("Total Amount" +"\t");
    sb.append(">90 days" + "\t");
    sb.append("\n");
    try
    String query="select * from temp_Xplant";
    ResultSet rs = st.executeQuery(query);
    while(rs.next()){
    sb.append(rs.getString("sapNo") + "\t");
    sb.append(rs.getString("status")+ "\t");
    sb.append(rs.getString("amt") + "\t");
    sb.append(rs.getString("days") + "\t");
    sb.append("\n");
    conn.close();
    st.close();
    catch (Exception e)
    out.println("error");
    conn.close();
    st.close();
    response.setContentType("application/vnd.ms-excel");
    // response.setHeader("Content-Disposition", "attachment; filename=\"test.xls\"");
    String testt = "tests.xls";
    response.setHeader("Content-Disposition", "attachment; filename="+testt);
    out.println(sb.toString());
    out.close();
    %>
    thanks in advance

    The problem here is, you have setted the content type as excel sheet and you are writing some String content into the output stream. when excel tries to read the String content it will surely throw some error. Lot of excel APIs are available in the market to generate excel sheets.
    you can find one in the below URL.
    http://www.teamdev.com/downloads/jexcel/docs/JExcel-PGuide.html

  • How to open and read Excel Sheet from SharePoint 2013 Document Library using C# Visual Studio 2012

    Hi,
    To achieve these are the steps that I had followed :
    1. Add the document Library path into Central Admin -> Application Mgmt -> Manage Service App -> Excel Service App -> Trusted File Locations
    2. Add Documnet Library link to Trusted Connection Proivder
    3. Open Visual Studio as Run as Administrator
    4.Create an SharePoint 2013 Empty Project.
    5.Add Service Reference : http:\\<server>\_vti_bin/excelservice.asmx
    6.Service added successfully
    7.Create a class file and add the Service Reference namespace
    There is no such class as ExcelService to call. 
    Please let me know if somebody knows how to open the Excel file into C#(2012)  either using ExcelService or any other way to open. I tried old methods of Sharepoint 2010 server but it's not able to access classes.
    Requirement is :
    Need to read the excel sheet  from Document Library and transfer all data into DataTable.
    Please help asap. 

    Hi,
    This is the forum to discuss questions and feedback for Microsoft Office, I'll move your question to the SharePoint 2013 development forum
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/home?forum=sharepointdevelopment
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    George Zhao
    TechNet Community Support

  • Is there a way to open Excell file from the server and display in the UI and save it back on to the

    Hello there,
    Is there a way to open Excell file from the server and display in the UI and save it back on to the server? (like showing xell file as a datagrid - add rows, columns etc.)

    Hi Mike,
    Welcome you to the forum.
    You may try:
    SELECT * FROM MyDBNameHere.dbo.OUSR T0
    Thanks,
    Gordon

  • Sending an Email by taking excel sheet from Application Server.

    Hi.
    I Searched in SDN related 'Sending an Email by taking excel sheet from Application Server'.
    But i didnt get. I got sending mails from local pc.
    Can some bdy provide me sample code how to send mail with an attachment. the attached file should get from Application Server
    Regards,
    Renu

    Hi,
    For writing data to app server from internal table:
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/prog%252bon%252bopen%252bdataset%252binput
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/prog%252bon%252bopen%252bdataset%252boutput
    Checkout this wiki for sending XL in mail attachment:
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/multiple%252battachment%252bon%252be_mail
    Thanks,
    Krishna

  • Compare Server Names in Excel sheet from column1 with column 2 and exact matched server names should be saved in column 3 in same Excel sheet

    Hi Guys,
    First of all thanks in advance any help much appriciated.
    I am new in scripting and excel, i am looking for below solution as my job requires daily work of this kind and i came to know by automating this work lots of time can be saved.
    Compare Server Names in Excel sheet from column1  with column 2 and exact matched server names should be saved in column 3 in same Excel sheet.
    Looking solutions first using excel i.e.vlookup itself so that it will not require any approval in my job else using powersell ,vbscript.
    Once again Thanks for you guys.
    /Regards
    Nitesh24in

    Hi Edward,
    Thanks once again
    I have only changed excel file path and after that this is saved as below , i am not sure which three lines should be together in one line. Please advise.
    $excel = New-Object -ComObject Excel.Application
    $Workbook = $excel.Workbooks.Add("F:\NewDocsToReadNitesh26-May2013\Excel\test.xls")
    $WorkSheet = $Workbook.Worksheets.Item(1)
    $WorkSheet.Activate() | Out-Null
    For ($i=1;$i -le $worksheet.UsedRange.Rows.Count;$i++) {
       If ($worksheet.cells.item($i,1).value2 -eq $worksheet.cells.item($i,2).value2) {
          $worksheet.cells.item($i,3).value2 = $worksheet.cells.item($i,1).value2
    }$Workbook.Save()$excel.Quit()[System.Runtime.InteropServices.Marshal]::ReleaseComObject([System.__ComObject]$excel) | Out-Null
    Thanks and Regards
    Nitesh24in

  • Downloading logo in excel sheet from application server

    hi all
    how can i download a logo in excel sheet from the application server(logo is in OAOR tcode) .you can also specify with OOPS concept.
    rewards assured.
    Reagrds
    Swarnali Basu

    hi naresh
    i think there is some miscommunication in case of my question,my requirement is to add a logo in excel sheet from application server,i mean when the user clicks to download the excel sheet the logo should immediately appear in the excel sheet,and it is not a fixed logo it can be anything which appears in applicaton server(on that program).
    as far as excel sheet stanalone is concerned i know to do it and as well as to get the logo  in the application server standalone ,but i cant download the logo in excel sheet from the application server.now does my question make sense ?
    Reagrds
    Swarnali

  • Reading excel  sheet from out side of the server though sql developer.

    Hi ALL,
    Is it possible to read the excel sheet from the out side of the oracle server.
    If it possible please send me the sample code.

    Duplicate thread.
    Reading excel  sheet from local system though sql developer
    Also a FAQ
    SQL and PL/SQL FAQ

  • Unhandled exception while opening excel file from e-business suite form

    Hello,
    I am getting error ORA-106561 (Unhandled errorg) when I am trying to open excel sheet which is reside in my desk top from Oracle E-business suite customized form using dde.app_begin('C:\Program Files\Microsoft Office\Office12\EXCEL.EXE'||'d:\emp.xls' ,dde.app_mode_normal)
    E-BUSINESS SUITE is in Unix server and EBS version is 10.5.10.2cu and hp Unix version is 11.11
    Please help me out in the above issue
    My objective is to open an excel sheet which is in my local disk and read and update the excel.
    Edited by: user538673 on Jul 23, 2010 2:20 AM

    Hello,
    This is the standalone Forms forum here.
    Please, ask your EBS questions on the E-Business Suite forum ;-)
    Francois

  • How to get data to excel sheet from background

    Hello Experts,
    I have be assigned a task where i have to find out all the reports and the variants containing a ' / '. I have written the code where i am able to scan through the entire list and get a set of reports and the variantsin the internal table. NOW i have to run the code in the background and the entire set of reports and the variants in the internal table to the excel sheet . So how do I do this? I am able to get the data in the excel sheet from the foreground using the FM GUI_download. But this FM does not work in the background.
    So what should be the ideal way to do this ?
    Thanks
    Aditya

    Hi,
    You can write the file into Application server.
    OPEN DATASET dataset FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
      LOOP AT it_itab INTO wa_itab.
        TRANSFER wa_itab TO dataset.
      ENDLOOP.
      CLOSE DATASET dataset
    use CG3Y transaction to download file from app server to presentation server.
    Regards
    Sree

  • How to open Excel Sheet using JSP?

    Hi Dear,
    I want to open Excel Sheet in client browser, How to do this using JSP?
    If it is possible to open, client can make the changes in the sheet if he saves those changes, those changes must reflect on server.
    So pl. tell me how to do this?
    Thanks

    The following code gets data from an ODBC link to an Excel spreadsheet and displays it as a HTML table. You can modify the table to include <input> fields to update the spreadsheet when the form is submitted.
    I hope that this helps. -Don
    <%
    /* Establish connection to excel database(spreadsheet)
    ODBC DSN="xltest" */
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    java.sql.Connection con= java.sql.DriverManager.getConnection("jdbc:odbc:xltest");
    java.sql.Statement st = con.createStatement();
    java.sql.ResultSet rs = st.executeQuery("SELECT * from [Sheet1$]");
    java.sql.ResultSetMetaData rsmd = rs.getMetaData();
    %>
    <html>
         <head><title>Excel Database connection test</title></head>
         <body><table border=1 cellspacing=0><tr>
    <% // Print Column headings (first row of spreadsheet)
    for (int i = 1; i <= rsmd.getColumnCount(); i ++){
              %><td id='td1'><%=rsmd.getColumnName(i)%></td><%
    }//End for
    %></tr><%
    while(rs.next()) { // Print row data
    %><tr><%
         for (int i = 1; i <= rsmd.getColumnCount(); i ++) {
                   %><td id='td2'> <%=rs.getString(i)%></td><%;}// End for
    }//End while
    st.close();
    con.close();
    %>
    </tr></table></body></html>

  • "An error occurred sending the command to the application" When trying to open excel document from outlook 2007

    Error message "An error occurred sending the command to the application" When trying to open excel document from outlook 2007.
    OS: Windows Server 2008 R2
    If I save the document then it opens fine, messing with default file associations does not resolve this problem, I've googled for ir it and some suggest unticking compatibility mode or "run as admin" for excel application, neither is selected in my case.
    Outlook is configured to run as remote application from remoteApp server, this error is only occurring for one user, for others excel documents open just fine.

    Hi
    Thank you for using
    Microsoft Office for IT Professionals Forums.
    From your description, we can Create a trusted location follow these steps
    Click the Microsoft Office Button , and then click Excel Options.
    Click Trust Center, click Trust Center Settings, and then click
    Trusted Locations.
    If you want to create a trusted location that is not local to your computer, select the Allow trusted locations on my network (not recommended) check
    box.
    Click Add new location.
     IMPORTANT   We recommended that you don't make your entire
    Documents or My Documents folder a trusted location. Doing so creates a larger target for a hacker to potentially exploit and increases your security risk. Create a subfolder within Documents or My Documents, and make only that folder a trusted location.
    In the Path box, type the name of the folder that you want to use as a trusted location, or click Browse to
    locate the folder.
    If you want to include subfolders as trusted locations, select the
    Subfolders of this location are also trusted check box.
    In the Description box, type what you want to describe the purpose of the trusted location.
    Click OK.
    More detailed information you can refer to this link:
    http://office.microsoft.com/en-us/word-help/create-remove-or-change-a-trusted-location-for-your-files-HA010031999.aspx?CTT=1#BM12
    Please take your time to try the suggestions and let me know the results at your earliest convenience. If anything is unclear or if there is anything
    I can do for you, please feel free to let me know.
    Hope that helps.
    Sincerely
    William Zhou CHN
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Opening excel sheets

    Hi,
    I have one servlet that is supposed to create an excel sheet. Then I have a couple jsp's with a link to this servlet on each of those jsp's. The content of the excel sheet should depend on wich link has been clicked. My problem is: if I open an excel sheet from one link, and then open another sheet from another link without closing the first one, the new sheet is not created. Is there any solution for this? Thanks

    How? Here is the link to the servlet where ExcelTable.java is the name of the servlet file.
    Download this table in Excel format

  • Opening Excel sheet in Excel Application instead of browser

    Hi,
    I need to open an excel sheet from a JSP. When i click the link it opens a pop-up which asks open/save. This is fine. but when i click open it opens the excel sheet in the IE itself. I want the excel sheet to be opened using MS Excel Application. This is the piece of code i have used:
    response.setHeader("Content-Disposition", "attachment;filename="+ displayFileName);
    Also the pop-up does not show the "displayFileName" as set by me but some other name.
    Please help me out regarding this!
    Thanks in Advance!!!

    I think that for that you have to use java with activeX
    http://www.javaworld.com/javaworld/jw-09-1996/jw-09-blundon.html
    or if possible use the runtime library to call the excel executable and send it arguments.
    MeTitus

Maybe you are looking for

  • Error while installing connector and printer drivers for MDSD

    Hi experts, When installing printer drivers and connector on my handheld i am getting errors. I am usind MDSD21 application. here are the components i am installing. CONNECTOR_WM50_XSL_CRM_1_2_8 PIPRONEMF8I_WM50_XSL_CRM Also pasting the trace file..

  • Returning SAP standard error

    Hello, I have created an RFC to replicate the functionality of VLMOVE (movement type 313) for creating a delivery.For this I have used some standard performs and I able to create the delivery by passing the required inputs(plant,storage location,HU).

  • Can't make phone calls on i6

    Initiated my new i6 after backing up from my 5c. When I try to make a phone call now I'm automatically redirected to an outside operator that's going to require me to use a credit card to make my call. Under Settings when I go to Phone it says my Pho

  • What version of Firefox supports Mac OS X 10.5 with Motorola Power PC G5 processor?

    I inherited a Mac G5 has Motorola Power PC processor, OS X 10.5.8. Is there a Firefox version that will work for this Mac?

  • Aftre MIGO - PO should not be unreleased

    Dear Friends, After MIGO , if i go to ME29N then systems allow me to unrelease PO. WHY? How can stop this .( Means After MIGO , PO should not be unreleasd) Regards, Mahesh.