ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

HSSF to XSSF POI

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • HSSF to XSSF POI

    Hello,

    If I want to use the ooxml format in POI would I just substitute the "hssf" with "xssf" in all the class/method prototypes?

    It seems that's all that I have to do ...

    Thank You

    "When all is said and done, more will be said than done"

  • #2
    Re: HSSF to XSSF POI

    You should use the "ss" prototypes, which work with either format. Only need to use "hssf" or "xssf" when creating the new workbook so it knows which type to create.

    Comment


    • #3
      Re: HSSF to XSSF POI

      Ok, I converted to the xssf/ss format. But, it's putting it in the binary xls format. It's not creating the openxml format.

      Ive run some of the demos in that come with the poi service program and they also are not in the openxml format.
      Last edited by davisty; October 21, 2013, 02:42 PM.

      Comment


      • #4
        Re: HSSF to XSSF POI

        Can you provide more details about what you're doing? When I've done this, it has created the OOXML format...

        Comment


        • #5
          Re: HSSF to XSSF POI

          What was the call and parms you gave in the demo programs?

          Can you send me a sample of the openxml your getting. Im talking about receiving, for example,

          <?xml version="1.0" encoding="UTF-8"?>
          <Workbook xmlns:c="urn:schemas-microsoft-comffice:component:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns="urn:schemas-microsoft-comfficeffice" xmlns:xsi="http://www.w3.org/2001/XMLSchema

          When I run the hdrdemo program I get :
          PK |UC docProps/core.xml&#$ MKÄ0
          A íúïÍv× âÑãä}Þ aR&#$öjGÞÑùÑè ²,§ µ4ݨû >¶ëô ® $©¤q¸qÆ¢
          òUô E Ÿ  : l©]tôèãÒþ»² Ò¾¹Ý,è$à êà e ¾Ù Nù? s²
          BHu²séP ìHtðða±¦_ÉSyuÝ®iSä¬LY ¬eg¼,8+Ÿ+øÕ?9 £qÍe<Ë d
          In my service program Im saying:

          Code:
           ****************************************************************   
           *Create Spread Sheet                                               
           ****************************************************************   
          D xcCrtSS         pr                  like(SSWorkbook)              
          D filename                      32    const                         
                                                                           
                                                                 
          P xcCrtSS         b                   export           
          D xcCrtSS         pi                  like(SSWorkbook) 
          D filename                      32    const            
                                                                 
          D book            s                   like(SSWorkbook) 
          D sheet           s                   like(ssSheet)    
          D aString         s                   like(jString)    
                                                              
           /free                                              
                                                              
              book = new_XSSFWorkbook;                        
              aString = new_String(%trim(filename));          
                                                              
           /end-free
          Last edited by davisty; October 23, 2013, 02:32 PM.

          Comment


          • #6
            Re: HSSF to XSSF POI

            The XLSX format is actually a ZIP file made up of many different XML files. Try renaming fromn YOURFILE.XLSX to YOURFILE.ZIP and then opening with an unzip tool. Inside you will find lots of XML files in the format you named. From your output from hdrdemo (as you suggested) this is indeed what you are getting -- so all seems to be working properly.

            You should get the exact same thing if you open up Excel, create a doc, and then save in the XLSX format (which has been the default Excel format for the last several releases.)

            They did introduce an pure, plain XML format at one point, but it does not support all Excel features, and is now only provided for backward compatibility. It is not the open spreadsheet format that Microsoft standardized on for Excel going forward.

            Comment


            • #7
              Re: HSSF to XSSF POI

              I didnt realize that.

              Thanx Scott

              Comment

              Working...
              X