How to launch an openoffice excel document ?

Hi, I have a method to create an excel file:
public void createExcelFile(String fileName, Long Id){
File file = new File(fileName);
FileWriter writer = null;
try{
catch (IOException e) {
}

Ok.. so now lets stick to this thread. This is the code:
public void createExcelFile(String fileName, String Id){
File file = new File (fileName + ".ods");
FileWriter writer = null;
try{
writer = new FileWrite(file);
String data = "<TABLE BORDER=\"2\">";
data += getData(Id) // other methods to pull data from database
data += "</TABLE>";
writer.write(data);
writer.flush();
} catch (IOException e) {
e.printstacktrace();
finally {
try{
writer.close
}catch (IOException e) {
e.printstacktrace();
and u mentioned abt using Desktop.open(name);
is Desktop another class i have to import?
U also mentioned
Edit: And that is not a spreadsheet of any kind. That is (at least the beginning of) an HTML table. Now, it might be that one of the files in an ods document (which is a zipfile) may contain something like that, but that is not the only thing it contains, and certainly the ods file is not a simple text file.
You need to Google for an API for OpenOffice (I am fairly certain there are some, and one may even be delivered with OpenOffice). "
the .ods file is an open office spreadsheet... the above code creates the file perfectly and I am able to open it seperately. I juz need to open it automatically with the program...

Similar Messages

  • How do I open an excel document in an email and use numbers to edit it

    I receive emails with excel documents in them.  Am I able to open the document and use the numbers app on my iPad 2 to edit this document?

    AFAIK - and I do use Pages on the iPad, you have to use the file sharing feature to transfer the file to iTunes on the computer. That is how I have always made to transfer. Obviously you have to have the iPad connected to the computer And set up for a sync, but I don't think the files will transfer unless to use file sharing. I may be reading the whole thing incorrectly because the article does state ...
    Using iTunes 9.1 or later, you can copy files between your computer and apps on your iOS device that support File Sharing (for example, Pages for iPad supports File Sharing, so you can create a document in Pages on your iPad, then copy it to your Mac so you can open it in Pages for Mac OS X). This article explains how to copy files between your computer and your iOS device using File Sharing.
    This may mean if you want to edit the files on the computer you must use file sharing via the sync process. However, I'm not so sure that syncing, in and of itself will actually transfer the files. The key here is if you want to have access in iTunes you use file sharing. Email, cloud services work as well as you know.
    I don't want to mess the OP up either, but this method is supposed to be the sure fire way to transfer the files. I will try when I get home just using a sync. Actually, once you try the file sharing method, it really is very easy to do.
    OT ... I realize .... But I've been looking for a reason to bring up the subject of the Buccos and the Reds. Such a strange feeling here in the Burgh again. Like the '70's almost. You are right ... Long way to go!
    My next target will be Philly_Phan!

  • How to switch between open excel documents?

    How do I switch between open excel documents.  I am used to windows and really miss this funciton

    The Command +` keys will switch between windows in an application
    ~Lyssa

  • How do i print an excel document?

    I am new to iMac so still learning.  My friend emailed me an Excel document (it opens in Numbers) and I cannot figure out how to print it.  I hold 2 fingers down on my trackpad, and "print" is not an option.  I do not see "print" anywhere as an option.  Help!

    Hi George,
    Numbers 3.1 (but similar in Numbers 2).
    If you don't see this, there is something very wrong!
    If there is no menubar, perhaps the keyboard shortcut command p will bring up a print dialogue.
    I hold 2 fingers down on my trackpad, and "print" is not an option.
    That doesn't work for me. Never has.
    System Preferences > Trackpad > Scroll and Zoom shows Double-tap with two fingers for Smart Zoom, nothing at all to do with Print.
    Please reply with a screen shot of a small part of your screen (large shots are often difficult to read).
    To take a screen shot,
    1. hold down the shift and command keys, then type 4. The cursor will change to crosshairs. Release the shift and command keys.
    2. Drag over that part of your screen then release the mouse/trackpad. A screen shot will appear on your desktop.
    3. In a reply to a message, click on the camera icon in the Toolbar above your reply and
    4. Choose File > Choose > Insert Image.
    If this does not work, Close the Insert Box (red cross on the top right) and go back to Step 3. Camera icon sometimes needs a wake-up call, but works the second time.
    Remove any personal details before taking the screen shot.
    Regards,
    Ian.

  • How do I stop my excel documents opening up in ITunes

    My Excel and Word documents are opening automatically In iTunes when I open my Windows Vista laptop. Infact all my documents seem to be quickly transferring themselves into iTunes, so I cant open them at all. H. When I open an Excel Document that has been emailed to me in Microsoft Outook it can only now be opened in iTunes. Any help will be really appreciated

    Turning your laptop off and starting it again is the equivalent of a reboot but this takes two separate actions whereas a restart/reboot can be performed in one action. But back to your main problem.
    When you refer to your Inbox I presume you are talking about the Inbox in Mail app on your iPad.
    I think what you are trying to tell us is that you cannot open certain files on your iPad that have been synced or emailed to it. If this is correct then you need to have a compatible app on your iPad.
    However, the undermentioned list of file attachments [courtesy of Demo, another participart] are VIEWABLE in the Mail programme as standard but if you want to save and work on them then a compatible app must be installed-
    Viewable document types: .jpg, .tiff, .gif (images); .doc and .docx (Microsoft Word); .htm and .html (web pages); .key (Keynote); .numbers (Numbers); .pages (Pages); .pdf (Preview and Adobe Acrobat); .ppt and .pptx (Microsoft PowerPoint); .txt (text); .rtf (rich text format); .vcf (contact information); .xls and .xlsx (Microsoft Excel)
    If the file is not one of these file types, you will need an app in order to open and view them - i.e. - .wmv files ...
    Are we on the right lines?

  • How to attach a word/excel document to an html DB application

    Hi,
    We have a requirement to attach a document (word/excel etc..) to a customers record in a HTML db application. How can we do this?
    Are there any application wizards to attach a document to the record, which can then be stored in the database as a BLOB field or can be stored in a file system on the application/db server itself.
    I really appreciate your help.
    Thanks,
    Sudheer

    Sudheer,
    If you look at the How-to below you should get a good idea of how you can solve your problem, just modify to suit your application.
    http://www.oracle.com/technology/products/database/htmldb/howtos/howto_file_upload.html
    Greg

  • Store Word/Excel Document in Database 9.2.5

    Hi
    Can you give me sample code how to store word or excel document from forms 10g rel 2 and read the document from forms.
    Thanks

    This question has been asked many times. If you search the forum you will find many answers.

  • Opening Excel documents

    How do I open an Excel document sent to me via email attachment?

    Other possibilities:
    http://www.macupdate.com/info.php/id/9928
    or
    http://www.macupdate.com/info.php/id/23128
    Regards
    TD

  • How do I convert an excel (2008) document to Numbers?  When I drag the Excel document onto the Numbers icon I get, "Import error.  The file format is invalid"

    How can I convert an Excel (2008) document to Numbers.  When I drag the Excel document onto the Numbers icon I get, "Import error.  The file format is invalid.

    That extension identifies the most current Excel file format, a format that can be opened by Numbers '09 (and by Numbers '08).
    A check with Numbers '09 shows it capable of opening .xlsx files when right-clicked (and Numbers chose as the application to open, when double-clicked (if Numbers has been set as the default application to open this type of file, or when dragged to the Numbers icon in the dock.
    I see two possibilities for Numbers inability to open it and the message you receive:
    1. The file is not actually an Excel file, and the sender has added the .xlsx extension to the filename manually.
    2. The file is an Excel file, but has somehow been corrupted.
    Have you tried opening the file with a different application? The open source Office suites, OpenOffice.org, LibreOffice and NeoOffice can also open .xlsx files. If they're unable to open this one, that would point toward the file itself being faulty. You can download these applications from their rspective websites, linked in the names above. All request a donation to support future development, but only Neo requires one to have been made recently, and that only for the current release (which won't be necessary to open .xlsx files).
    Regards,
    Barry

  • How do I convert a pdf file to a Word or Excel document?

    How do I convert a pdf file to a Word or Excel document using the Adobe software?

    Hi,
    There are a few ways to export your PDF file to Word or Excel files.
    Using Web UI:
    Log into https://exportpdf.acrobat.com/signin.html with your Adobe ID and password
    Select “Export from PDF”
    Click “Select Files” button then choose your PDF file
    Select the format from the list below
    Check ON “Recognized text in” if your PDF file is scanned images to recognize the image to text
    Click “Export” button
    Click “Download” button in the progress bar after completion of exporting to download the file to your computer.
    Using Adobe Reader:
    Launch Adobe Reader X or Reader XI
    Select “Tools” and click “Sign In” link to sign in with your Adobe ID and password
    Select “Export PDF” then click “Select PDF file” link
    Select format from “Convert To”
    Click “Convert”
    Click “Download Converted File” link to download the file to your computer after the process is completed.
    Download Files:
    All exported files are stored at https://files.acrobat.com and you can login with your Adobe ID and password.
    Or at Web UI you can click “FILES” next to “TOOLS” at top or click “View All files” in the file list of “Export from PDF” tool( or “Convert to PDF” or “Combine Files” tools for PDF Pack users) that will redirect you to the above site(https://files.acrobat.com)
    From Reader you can click “Store Files” under “Tools” and click the link of “Open Acrobat.com Files”
    Hisami

  • How do you HYPERLINK a web page address to an EXCEL document in Firefox like is possible in Explorer

    How do you HYPERLINK a web page address to an EXCEL document in Firefox like is possible in Explorer?

    When you follow a hyperlink in Excel, usually it should open in your default browser. You shouldn't have to do anything special in Excel to create the link when Firefox is your default browser compared with IE. However, the Insert Hyperlink dialog might work differently. I think it might be able to automatically pre-populate a URL from IE, while in Firefox, you need to copy the URL from Firefox's address bar and paste it into the Insert Link dialog.

  • How do I make Word and Excel Documents readable to PC users that cannot open them

    How do I make Word and Excel Documents readable to PC users that cannot open them

    Be sure to save them in the Office 2007 format as .doc or .xls files.

  • How can I display Excel document saved as html in ebDynpro Office Contol?

    Hello,
    I have a problem with displaying of Excel document saved as html inside WebDynpro Office Control.
    Could you explain why OfficeControl cannot display Excel document with content type =text/htm?
    How you know, control must be bound to binary data. And then mime type is set as
    bin.setMimeType(new WebResourceType("html", "text/html", false));
    The empty document is displayed always.
    Nevertheless, excel file is displayed perfect, when
    bin.setMimeType(new WebResourceType("xls ", "application/msexcel", false));

    The OfficeControl UI element is made available as an ActiveX control, so that the UI element can be displayed in browsers that support ActiveX controls.
    The ActiveX control enables display of the following documents:
    1.Microsoft Word documents with the doc file extension
    2.Microsoft Excel documents with the xls file extension
    This is the reason why document with other content types are not displayed.
    Data source must be bound to binary data because files are read as bytes in this scenario.
    Hope this helps you.
    Do let me know if your problem is solved.
    Regards,
    Vijith

  • How do I insert multiple photos into an excel document vs inserting each individually?  Insert, Picture, From FIle...now what?  it only allows me to choose 1 at a time.

    Help - How do I insert multiple photos into an excel document vs inserting each individually?  Insert, Picture, From FIle...now what?  it only allows me to choose 1 at a time.

    https://discussions.apple.com/thread/3383532?tstart=0
    Stefan

  • How do I get a refund?  I have tried to use this converter to change a PDF to a word document or excel document three of four times and it always fails..  I want my money back but don't see any way to communicate with Adobe.

    How do I get a refund?  I have tried to use this converter to change a PDF to a word document or excel document three of four times and it always fails..  I want my money back but don't see any way to communicate with Adobe.  i really just want my money back.  Very disappointed.  Also disappointed that it is so hard to find a way to communicate with Adobe that I have to resort to asking this question in this forum. 

    You need to use the CHAT link in support to reach Adobe staff. Be sure you know the product name you are trying to cancel, Adobe have lots of products, several converters etc. I think it is ExportPDF you have, most likely.

Maybe you are looking for