Problem in Reading XLSX File (MS EXCEL 2007).

Dear All ,
I am reading all the properties to XL sheet and then utilising it in my code .
I am getting some problem in reading the Border of the Cell , my code is working fine with most of the Excel Sheet but it can not correctly read the Border of a few Excel files.
I am using the method ,
getBorderBottomEnum()
or
getBorderBottom()
but I can not read the Border used correctly for all the Excel Sheet .
Please Help.
Please revert if I am not clear.
Thanking You All.

I'm guessing that your question is about Apache POI. They don't have a forum AFAIK, but they do have a [url http://poi.apache.org/mailinglists.html]mailing list.
John

Similar Messages

  • How to read .XLSX files using org.apache.poi.ss.usermodel.* classes

    Hello,
    I want to read in excel files to a JTable. I was able to read in .xls files, but have problems reading .xlsx files. Maybe there is something i need to add to the following code:
    FileInputStream iStream = new FileInputStream(newFile);
    POIFSFileSystem fs = new POIFSFileSystem(iStream);
    Workbook wb1 = WorkbookFactory.create(fs);
    Sheet sheet = wb1.getSheetAt(0);       // get the first sheet data
    // Iterate over each row in the sheet
      Iterator rows = sheet.rowIterator();
       while(rows.hasNext()) {
          Row row = (Row) rows.next();
          .............The compiler is complaining about the 3rd line: Workbook wb1 = WorkbookFactory.create(fs);
    Thanks.

    @ejp:
    I quite agree with you. It's a runtime exception -
    org.apache.poi.poifs.filesystem.OfficeXmlFileException: The supplied data appears to be in the Office 2007+ XML. You are calling the part of POI that deals with OLE2 Office Documents. You need to call a different part of POI to process this data (eg XSSF instead of HSSF)I've tried searching before coming here to ask. HSSF processes .xls files only, XSSF processes .xlsx files only while SS is supposed to read both .xls and .xlsx files. Maybe there's anyone that has used it before who can help out.
    Thanks

  • Repair xlsx file of Excel 2013?

    How to repair xlsx file of Excel 2013?

    When a Microsoft Excel file is corrupt or damaged, then you can try several methods to repair and recover data from it:
    1. First of all, try to repair the corrupt file manually. Follow below steps:
    A. On the File menu, click Open.
    B. In the Open dialog box, select the file that you want to open, and click the arrow next to the Open button.
    C. Click Open and Repair, and then choose which method you want to use to recover your workbook.
    Check-out following articles for more information about at:
    http://office.microsoft.com/en-us/excel-help/repairing-corrupted-files-in-excel-HA001034656.aspx (for MS Excel
    2003)
    http://office.microsoft.com/en-us/excel-help/repairing-a-corrupted-workbook-HA010097017.aspx?CTT=1 (for MS Excel
    2007)
    http://office.microsoft.com/en-us/excel-help/repairing-a-corrupted-workbook-HA010342840.aspx?CTT=1 (for MS Excel
    2010)
    http://office.microsoft.com/en-us/excel-help/repair-a-corrupted-workbook-HA102749554.aspx?CTT=1 (for MS Excel
    2013)
    2. Second, since MS Excel 2003, it provides a "Document Recovery" mechanism so that when Excel is shutdown abnormally, the Excel file being edited will be recovered when Excel is launched next time, which makes the file recovery possible.
    Read below article for more details:
    http://office.microsoft.com/en-us/excel-help/recover-your-office-files-HP010354299.aspx?CTT=1
    3. If method 1 and 2 do not work, then you may try 3rd party Microsoft certified tools such as Stellar Phoenix Excel Repair at
    http://www.repair-excel-file.com/
    Software is available as both free demo & full user license versions. You can try demo version to see the preview of your file. 

  • Problem While reading a file in text mode from Unix in ECC 5.0

    Hi Experts,
    I am working on Unicode Upgrade project of ECC5.0.
    Here i got a problem with reading a file format which it does successfully in 4.6 and not in ECC5.0
    My file format was as follows:
    *4 000001862004060300000010###/#######L##########G/##########G/########
    It was successfully converting corresponding field values in 4.6:
    *4
    00000186
    2004
    06
    03
    00000010
    25
    0
    4
    0
    54.75
    0
    54.75
    0.00
    While i am getting some problem in ECC5.0 during conversion of the above line:
    *4 000001862004060300000010###/#######L##########G/##########G/########
    it was consider in the same # values.
    I have used the following statement to open and read dataset.
    OPEN DATASET i_dsn IN LEGACY TEXT MODE FOR INPUT.
    READ DATASET i_dsn INTO pos_rec.
    Thanks for your help.
    Regards,
    Gopinath Addepalli.

    Hi
          You might be facing this problem because of uni code. So while opening or reading the file, there is a statement call ENCODING. Use that option and keep the code page which you want. Then the problem may be solved.
    Thanks & Regards.
    Harish.

  • Problem  while reading XML file from Aplication server(Al11)

    Hi Experts
    I am facing a problem while  reading XML file from Aplication server  using open data set.
    OPEN DATASET v_dsn IN BINARY MODE FOR INPUT.
    IF sy-subrc <> 0.
        EXIT.
      ENDIF.
      READ DATASET v_dsn INTO v_rec.
    WHILE sy-subrc <> 0.
      ENDWHILE.
      CLOSE DATASET v_dsn.
    The XML file contains the details from an IDOC number  ,  the expected output  is XML file giving  all the segments details in a single page and send the user in lotus note as an attachment, But in the  present  output  after opening the attachment  i am getting a single XML file  which contains most of the segments ,but in the bottom part it is giving  the below error .
    - <E1EDT13 SEGMENT="1">
      <QUALF>001</QUALF>
      <NTANF>20110803</NTANF>
      <NTANZ>080000</NTANZ>
      <NTEND>20110803<The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource 'file:///C:/TEMP/notesD52F4D/SHPORD_0080005842.xml'.
    /SPAN></NTEND>
      <NTENZ>000000</NTENZ>
    for all the xml  its giving the error in bottom part ,  but once we open the source code and  if we saved  in system without changing anything the file giving the xml file without any error in that .
    could any one can help to solve this issue .

    Hi Oliver
    Thanx for your reply.
    see the latest output
    - <E1EDT13 SEGMENT="1">
      <QUALF>003</QUALF>
      <NTANF>20110803</NTANF>
      <NTANZ>080000</NTANZ>
      <NTEND>20110803</NTEND>
      <NTENZ>000000</NTENZ>
      <ISDD>00000000</ISDD>
      <ISDZ>000000</ISDZ>
      <IEDD>00000000</IEDD>
      <IEDZ>000000</IEDZ>
      </E1EDT13>
    - <E1EDT13 SEGMENT="1">
      <QUALF>001</QUALF>
      <NTANF>20110803</NTANF>
      <NTANZ>080000</NTANZ>
      <NTEND>20110803<The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource 'file:///C:/TEMP/notesD52F4D/~1922011.xml'.
    /SPAN></NTEND>
      <NTENZ>000000</NTENZ>
    E1EDT13 with QUALF>003 and  <E1EDT13 SEGMENT="1">
    with   <QUALF>001 having almost same segment data . but  E1EDT13 with QUALF>003  is populating all segment data
    properly ,but E1EDT13 with QUALF>001  is giving in between.

  • Problem with reading config file

    Hello,
    I have problem with reading config file from the same dir as class is. Situation is:
    I have servlet which working with DB, and in confing file (config.pirms) are all info about connection (drivers, users, passw, etc.). Everything work fine if I hardcoded like:
    configFileName = "C:\\config.pirms";I need to avoid such hardcoding, I tryied to use:
    configFileName = Pirms.class.getClassLoader().getResourceAsStream ("/prj/config.pirms").toString();but it isn't work.
    My config file is in the same directory as Pirms.class (C:\apache-tomcat-5.5.17\webapps\ROOT\WEB-INF\classes\prj)
    Also I tryied BundledResources, it isn't work fo me also.
    Can anybody help me to solve this problem? with any examples or other stuff?
    Thanks in advance.
    Andrew

    Thanks, but I am getting error that "non-static method getServletConfig() cannot be referenced from a static context"
    Maybe is it possibility to use <init-param> into web.xml file like:
    <init-param>
      <param-name>configFile</param-name>
      <param-value>/prj/config.pirms</param-value>
    </init-param>If yes can anybody explain how to do that?
    I need to have that file for:
    FileReader readFile = new FileReader(configFile);Thanks in advance.

  • Problems when reading pdf files

    I use windows 7, and also have available Adobe Reader 5 and Adobe Reader X, but i receive some problems when reading pdf files. What can I do???

    Reader 5 is not Windows Compatible. Two different versions of the same computer can cause all sorts of problems. Remove all Acrobat and/or Reader software then re-install Reader X.

  • Problem Creating PDF Files from Excel 2007

    I am running WinXP SP2, Office 2007, and Acrobat v8.1.2. I have an Excel workbook with multiple worksheets. When I was using Excel 2003 I could create a PDF file using five of the six worksheets. Since upgrading to Office 2007 I am unable to create PDF files from Excel. I can create PDF files from Word 2007. When I attempt to use the Acrobat Plug-in to create a PDF I get a message saying the file needs to be saved first. It then attempts to save the file to a strange, somewhat random, file name (e.g. A234G53). When I say OK Excel just hangs and is unresponsive. The way that I can clear it is to stop Excel using Task Manager. I have tried reinstalling Acrobat without successfully solving the problem. Any ideas on how I can diagnose and/or solve the problem?
    Thanks.

    Is your Excel file on a location outside your machine's disk? If so, try copying to local disk.
    Does the Excel file have any protection applied to it? If so, try removing the protection
    If these don't work, can you post a sample file that demonstrates the problem.

  • Microsoft Office 2010 Professional - Problem - Will Not Auto-Open Downloaded Excel 2007 file!

    Problem, see title.  If I save excel file and go Microsoft Office 2010 Pro and open file after opening excel it will open file but it will not open when downloaded as I did before I let windows process 51 updates to windows (new computer).  The
    error message I get is, "file is not a valid Win32 application".  My OS is Windows 7 Premium.

    If none above methods work, then you may try third-party tools such as next software at:-
    http://www.excel.fixtoolbox.com/
    Excel Fix Toolbox - Using Excel Repair Software to Recover Damaged Excel files - A Step-by-Step Guide
    It supports both .xls and .xlsx file formats. I have used it to recover some Excel files successfully. It provides a free demo version so that you can try
    to see if the data you want can be recovered or not.
    Good luck!

  • How to read xlsx files using file sender adapter in PI7.11

    Hi All,
    i have scenario where i need to read the xlsx file and convert it into idoc.
    i have gone through the few bolgs
    but not got proper result to read the xlsx file.
    please guide me how can i achieve this scenario using standard way(like standard adapter modules,graphical mapping).
    i saw in some blogs using API....
    but i am not aware of the process of develop custom modules in PI.
    please if there is any step by step process document to develop custom module for adapters.
    thanks in advance.
    mahesh

    HI Hareesh,
    i have gone through that blog.
    i tried it...but i am getting mapping error  no receiver determination fond because there are so  many excel files.
    my data is available on sharedString.xml but also it is in not same order.
    i have no clue how to handle this part form the blog.
    "This way our mapping will receive all data from the sheet in an XML format. The only thing that's left is to create an XSD file from the XML file we received in order to be able to use it in the mapping and as our Service Interface and we can proceed with mapping. As you can see from the sheet.xml files all the data is placed with column name and row number so it's not that difficult to map it to an table type format using the Message Mapping only (no java, abap mapping required)."

  • Read lvm file in excel

    Hi.
    How do you open and read a lvm file in excel spreadsheet?

    The hardest problem is just seeing it. In the File of type field in the file dialog, select All Files (*.*). Navigate to your file and select it. Excel will correctly interpret the LVM file as a text file and import it. If you use the default settings (tab separator), just hit the Finish button and it will be imported.
    NOTE: An LVM file can easily be longer than Excel can import. I haven't tried, but I think it will just truncate the file with a warning.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • How to open TXT file with excel 2007

    With Excel 2003  if we right click the txt source file name, there will be an option to open the file Excel, but with Excel 2007, then we right  click txt fiel name , there is no option of open the file with excel, is this mean that we have to copy the txt file to excel file to manipulate the source file? Any idea how to do this?

    just find out that we can use the browser to find the excel and open the file, next time the excel option will be there.

  • Problem while reading the file from FTP server

    Hi Friends,
    I have a problem while fetching files from FTP server.
    I used FTP_Connect, FTP_COMMAND function modules. I can able to put the files into FTP server.
    but I cant able to pick the files from FTP server.
    anyone have faced similar issues kindly let me know.
    Thanks
    Gowrishankar

    Hi,
    try this way..
    for reading the file using FTP you need to use different unix command ..
    Prabhuda

  • Problems with reading XML files with ISO-8859-1 encoding

    Hi!
    I try to read a RSS file. The script below works with XML files with UTF-8 encoding but not ISO-8859-1. How to fix so it work with booth?
    Here's the code:
    import java.io.File;
    import javax.xml.parsers.*;
    import org.w3c.dom.*;
    import java.net.*;
    * @author gustav
    public class RSSDocument {
        /** Creates a new instance of RSSDocument */
        public RSSDocument(String inurl) {
            String url = new String(inurl);
            try{
                DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
                Document doc = builder.parse(url);
                NodeList nodes = doc.getElementsByTagName("item");
                for (int i = 0; i < nodes.getLength(); i++) {
                    Element element = (Element) nodes.item(i);
                    NodeList title = element.getElementsByTagName("title");
                    Element line = (Element) title.item(0);
                    System.out.println("Title: " + getCharacterDataFromElement(line));
                    NodeList des = element.getElementsByTagName("description");
                    line = (Element) des.item(0);
                    System.out.println("Des: " + getCharacterDataFromElement(line));
            } catch (Exception e) {
                e.printStackTrace();
        public String getCharacterDataFromElement(Element e) {
            Node child = e.getFirstChild();
            if (child instanceof CharacterData) {
                CharacterData cd = (CharacterData) child;
                return cd.getData();
            return "?";
    }And here's the error message:
    org.xml.sax.SAXParseException: Teckenkonverteringsfel: "Malformed UTF-8 char -- is an XML encoding declaration missing?" (radnumret kan vara f�r l�gt).
        at org.apache.crimson.parser.InputEntity.fatal(InputEntity.java:1100)
        at org.apache.crimson.parser.InputEntity.fillbuf(InputEntity.java:1072)
        at org.apache.crimson.parser.InputEntity.isXmlDeclOrTextDeclPrefix(InputEntity.java:914)
        at org.apache.crimson.parser.Parser2.maybeXmlDecl(Parser2.java:1183)
        at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:653)
        at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
        at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
        at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:185)
        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
        at getrss.RSSDocument.<init>(RSSDocument.java:25)
        at getrss.Main.main(Main.java:25)

    I read files from the web, but there is a XML tag
    with the encoding attribute in the RSS file.If you are quite sure that you have an encoding attribute set to ISO-8859-1 then I expect that your RSS file has non-ISO-8859-1 character though I thought all bytes -128 to 127 were valid ISO-8859-1 characters!
    Many years ago I had a problem with an XML file with invalid characters. I wrote a simple filter (using FilterInputStream) that made sure that all the byes it processed were ASCII. My problem turned out to be characters with value zero which the Microsoft XML parser failed to process. It put the parser in an infinite loop!
    In the filter, as each byte is read you could write out the Hex value. That way you should be able to find the offending character(s).

  • DMS file opening problem for docx & xlsx files.

    Hi All,
    while opening docx & xlsx files data is getting truncated when they are transmited as external attachments from SRM with ERP PO mail through DMS.
    I feel there should be some problem with DMS itself as file format doc, xls are opening correctly as they were mapped with work station type DOC & XLS.
    Need your iputs to rectify the problem.
    Thanks,
    Ramakrishna

    Hi Ramakrishna,
    Kindly maintain the settings in SPRO->Document Management->General Data->Define Workstation Application (DC30).
    For XLS application define file format as *.xlsx and DOC application maintain file format as *docx.
    Hope this might resolve ur issue.
    Regards
    Bhanu

Maybe you are looking for

  • Export SQL query from link or button

    I want to list several 'canned' SQL queries on one page as buttons or links; and have the result of selection be an immediate extract/download to excel of the data. How can I best do this? I suppose I could create separate hidden regions with their o

  • What to delete to make space ? apps dont some

    up to what itunes say they take if ill leave the "other" alone its arount 1 giga no videos songs pics not even close i do have over 100 apps but most of them are under 50 mb lets asume the apps actualy take 6 or 7 gb so some of them have hidden files

  • Opening a Q&A database

    Hello, I'm trying to make a program that convert Symantec Q&A databases to Access databases. Is there any way to do this? Symantec has quit giving support for Q&A and i couldn't find a document on the internet describing the file format. Is there a O

  • How to uninstall older version of iTune? Lost a file name iTune msi

    Hi, I wanted to update newer version of iTune. But was not able to due to some files missing. Under the windows installer, path to this file name iTune MSI was not able to detect. Any advise to skip this step & uninstall?

  • Kernel upgrade - no module loading

    No other way to put it, guys: Arch Linux has just gone completely batshit on me. I just upgraded to the 2.6.11 kernel, which is now in the Current repo. However, something seems to have been missed during the update... Because when I boot, my system