This is a migrated thread and some comments may be shown as answers.

Named Ranges in formula

1 Answer 93 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Jerry
Top achievements
Rank 1
Jerry asked on 23 Apr 2020, 08:12 PM

I created a simple xlsx file with 2 worksheets - Sheet1, and Sheet2.

Create a Named Range called NR1 that References Sheet2:B5

On Sheet1 create a formula "=NR1"

This looks great in excel.

Open it in RadSpreadsheet and it comes up as #NAME?

Is this a shortcoming in RadSpreadsheet, or am I missing something VERY fundamental?

 

1 Answer, 1 is accepted

Sort by
0
Peter Milchev
Telerik team
answered on 27 Apr 2020, 10:45 AM

Hello,

Indeed it seems that the RadSpreadsheet server-side object does not support Named Ranges. 

Nevertheless, you can load them client-side with the code below, by saving a JSON in a hidden field and loading it via the API:

protected void Page_Init(object sender, EventArgs e)
{
    var path = Server.MapPath("~/App_Data/spreadsheet.xlsx");
    var workbook = Workbook.Load(path);
    HiddenField1.Value = workbook.ToJson();
}

<script>    
    function pageLoadHandler() {
        var spreadsheet = $find("<%= RadSpreadsheet1.ClientID %>");
        var hiddenfield = $get("<%= HiddenField1.ClientID %>");
        if (hiddenfield.value) {
            spreadsheet.get_kendoWidget().fromJSON(JSON.parse(hiddenfield.value))
            hiddenfield.value = '';
        }

        // Sys.Application.remove_load(pageLoadHandler);  
    }
    Sys.Application.add_load(pageLoadHandler);
</script>
<telerik:RadSpreadsheet runat="server" ID="RadSpreadsheet1"></telerik:RadSpreadsheet>
<asp:HiddenField runat="server" ID="HiddenField1" />

A similar project you can find here:

Also, I have logged a feature request for the server-side support for NamedRanges which you can follow here:

As a token of gratitude for helping us identify the issue, I have updated your Telerik points.

Regards,
Peter Milchev
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Spreadsheet
Asked by
Jerry
Top achievements
Rank 1
Answers by
Peter Milchev
Telerik team
Share this question
or