getRange in V11 is working weird when we pass params as numeric strings

Posted by: viswanath.malepati on 7 February 2018, 5:04 am EST

    • Post Options:
    • Link

    Posted 7 February 2018, 5:04 am EST

    Hi,

    We are using getRange() instead of getCells() in V11. So we found that when we pass params as string, this getRange() is returning more cells than what are requested.

    Example: sheet.getRange(“10”, “3”, 1 , 1); is returning more than one cells.

  • Posted 8 February 2018, 3:28 am EST

    Hello,

    You should use getCell() method for single cell instead. getRange() is meant to be used for getting a range of cells.

    Thanks,

    Deepak Sharma

  • Posted 12 February 2018, 8:04 am EST

    getCell() Makes sense but,

    sheet.getRange(10, 3, 1 , 1) gives me exactly 1 cell. Where as sheet.getRange(“10”, “3”, 1 , 1) is not doing it. My question was around this issue.

  • Posted 13 February 2018, 5:07 am EST

    Hello,

    I used following code and it seems to be working fine with SpreadJS v11.0.2. The Cellrange always colors one cell:

    
     <link href="http://cdn.grapecity.com/spreadjs/hosted/css/gc.spread.sheets.excel2013white.11.0.2.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="http://cdn.grapecity.com/spreadjs/hosted/scripts/gc.spread.sheets.all.11.0.2.min.js"></script>
        <script>
            window.onload = function () {
                var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), {});
                var activeSheet = spread.getActiveSheet();
            
                document.getElementById("btn1").addEventListener("click", function () {        
                    activeSheet.getRange("1", "0", 1,1).backColor("lemonChiffon");           
                });
              
            }
        </script>
    
    
    

    Let me know if you can replicate this issue with the new build.

    Thanks,

    Deepak Sharma

  • Posted 13 February 2018, 6:35 am EST

    Hi Deepak,

    I tried the same code that you gave above, but I can still see the issue, background color is being applied to more than one cells.

    please find the attachment of the file.

    Thanks,

    Viswanath

    getRange.zip

  • Posted 15 February 2018, 4:51 am EST

    Hi Viswanath,

    I am able to replicate this issue this time and hence submitted it as a bug to development team. The bug number for this issue is # 254515. I will let you know once I get an update on this.

    Thanks,

    Deepak Sharma

  • Posted 16 February 2018, 2:58 am EST

    Hi Viswanath,

    This is found to be a designed behavior. You have to use the correct parameters(numbers not string) to get the correct result.

    Thanks,

    Deepak sharma

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels