octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #56444] [octave forge] (io) oct2xls misinterpr


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #56444] [octave forge] (io) oct2xls misinterprets single cell range input
Date: Wed, 5 Jun 2019 14:28:10 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299

URL:
  <https://savannah.gnu.org/bugs/?56444>

                 Summary: [octave forge] (io) oct2xls misinterprets single
cell range input
                 Project: GNU Octave
            Submitted by: nrjank
            Submitted on: Wed 05 Jun 2019 06:28:08 PM UTC
                Category: Octave Forge Package
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Nicholas Jankowski
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 5.1.0
        Operating System: Any

    _______________________________________________________

Details:

as per a discussion on the help list [1] when oct2xls is given a single cell
range, it only puts data in that single cell instead of using it as the anchor
location of the full data array.  This appears to be insensitive to the xls
interface method. 


>> pkg load io
>> chk_spreadsheet_support ()
ans = 0
>> A = int32(100*rand(5))
A =
   2  70  45  45  14
  99  79  68   5  30
  45  85   8  72  33
  99  90  47  30  10
  19  19  75  92  63
>> XLS = xlsopen('o2xtest.xlsx',1)
XLS =
  scalar structure containing the fields:
    xtype = OCT
    app = xlsx
    filename = o2xtest2.xlsx
    workbook = c:\Programs\Octave\Temp\oct-ZATASh
    changed =  3
    limits = [](0x0)
    sheets =
      scalar structure containing the fields:
        sh_names =
        {
          [1,1] = Sheet1
        }
        rid =  1
        sheetid =  1
        shId =  1
        type =  1

>> [XLS,status] = oct2xls(A,XLS, 'Sheet1', 'A1')
XLS =
  scalar structure containing the fields:
    xtype = OCT
    app = xlsx
    filename = o2xtest.xlsx
    workbook = c:\Programs\Octave\Temp\oct-ZATASh
    changed =  2
    limits = [](0x0)
    sheets =
      scalar structure containing the fields:
        sh_names =
        {
          [1,1] = Sheet1
        }
        rid =
           1   2
        sheetid =  1
        shId =  1
        type =  1

>> XLS = xlsclose(XLS)


The output file o2xtest.xlsx only has the A(1,1) value written in cell A1. 
looking in the workbook temp location mentioned in the struct, the
workbook.xml file only contains information for that single cell.

According to the help for oct2xls:  "If RANGE is omitted or just the top left
cell of the range is specified, the actual range to be used is determined by
the size of ARR.  If nothing is specified for RANGE the top left cell is
assumed to be 'A1'.
...
If RANGE contains merged cells, only the elements of ARR corresponding to the
top or left Excel cells of those merged cells will be written, other array
cells corresponding to that cell will be ignored."

repeating the above script with the windows pkg loaded (such that
chk_spreadsheet_support = 1) produces the same output. also, xlswrite produces
the correct, full array when called with a single range value.


[1]
http://octave.1599824.n4.nabble.com/Problem-with-oct2xls-range-tp4692945.html




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?56444>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]