Error Loading Spreadsheet

13 posts, 0 answers
  1. Trent
    Trent avatar
    11 posts
    Member since:
    Apr 2010

    Posted 19 Oct 2015 Link to this post

    I am trying to test the functionality of Spreadsheet using the example at http://demos.telerik.com/aspnet-ajax/spreadsheet/examples/overview/defaultvb.aspx?show-source=true.

    I am using Telerik version 2015.3.930.45 in vb.net.

    This is pretty simple code and I am receiving the following error.  What am I missing?

    -----------------------
    Object reference not set to an instance of an object. 
      Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

     Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

    Source Error: 
     An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

    Stack Trace: 
    [NullReferenceException: Object reference not set to an instance of an object.]
       Telerik.Web.UI.SpreadsheetDocumentProvider.GetSheets() +72
       Telerik.Web.UI.RadSpreadsheet.PerformSelect() +110
       System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +30
       Telerik.Web.UI.RadSpreadsheet.EnsureDataBound() +98
       System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(EventArgs e) +22
       Telerik.Web.UI.RadDataBoundControl.OnPreRender(EventArgs e) +36
       Telerik.Web.UI.RadSpreadsheet.OnPreRender(EventArgs e) +79
       System.Web.UI.Control.PreRenderRecursiveInternal() +83
       System.Web.UI.Control.PreRenderRecursiveInternal() +155
       System.Web.UI.Control.PreRenderRecursiveInternal() +155
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +974
    ------------------------------

    Code snippets
    aspx
       
    <div>
        <telerik:RadSpreadsheet runat="server" ID="rssTest"></telerik:RadSpreadsheet>
    </div>


    aspx.vb
       
    Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
    Dim provider As SpreadsheetDocumentProvider<br>       
    Dim path As String = Server.MapPath("~/App_Data/20150530_C09_Schedule.xlsx")
    provider = New SpreadsheetDocumentProvider(path)
    rssTest.Provider = provider
    End Sub

  2. Bozhidar
    Admin
    Bozhidar avatar
    1102 posts

    Posted 20 Oct 2015 Link to this post

    Hi,

    There are two possible reasons for the exception. The first is that you haven't included the Telerik Document Processing Library dlls into your project. The SpreadsheetDocumentProvider relies on these dll-s, as described in the following article:
    http://docs.telerik.com/devtools/aspnet-ajax/controls/spreadsheet/data-binding/providers/using-a-data-provider

    The dlls you need to add into your project are listed here:
    http://docs.telerik.com/devtools/aspnet-ajax/controls/spreadprocessing/getting-started

    If you already have added the dlls and the exception is still thrown, the other possible issue might be that the file cannot be read for some reason. If this is the case, please send us the file so that we may inspect what could be the problematic data.

    Regards,
    Bozhidar
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Trent
    Trent avatar
    11 posts
    Member since:
    Apr 2010

    Posted 20 Oct 2015 in reply to Bozhidar Link to this post

    Yes, I have the DLLs you referenced.  See Screenshot_1.

    I created a new spreadsheet and only add "1" to cell A1 and saved.  

    I changed my Page_Init to use one line like your example so it looks like this.

    Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init            rssTest.Provider = New SpreadsheetDocumentProvider(Server.MapPath("~/App_Data/SpreadsheetTest.xlsx"))   End Sub

    Same result.  I am attaching a screenshot of the spreadsheet.  How do I send the file?

  5. Trent
    Trent avatar
    11 posts
    Member since:
    Apr 2010

    Posted 20 Oct 2015 Link to this post

    Code formatter fart.

    Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init      rssTest.Provider = New SpreadsheetDocumentProvider(Server.MapPath("~/App_Data/SpreadsheetTest.xlsx"))
    End Sub

  6. Bozhidar
    Admin
    Bozhidar avatar
    1102 posts

    Posted 20 Oct 2015 Link to this post

    Hi,

    You cannot send attachments in forum threads. Please open a support ticket and attach the sample excel file there, so that we can inspect it on our end. Once we find the reason for the issue, we will post it in this thread.

    Regards,
    Bozhidar
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  7. Trent
    Trent avatar
    11 posts
    Member since:
    Apr 2010

    Posted 26 Oct 2015 in reply to Bozhidar Link to this post

    Sorry, turns out that I did not have the newest DLLs referenced.  Works fine now.  Thanks for your help.
  8. Nilesh
    Nilesh avatar
    1 posts
    Member since:
    Apr 2016

    Posted 04 Apr Link to this post

    while Updating my telerik dll from 2015 to 2016 version. The SpreadSheet funcationality not working.

    Please help me out in this.

     

    Object reference not set to an instance of an object.

     

    [NullReferenceException: Object reference not set to an instance of an object.] Telerik.Web.UI.SpreadsheetDocumentProvider.GetSheets() +30 Telerik.Web.UI.RadSpreadsheet.PerformSelect() +58 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74 Telerik.Web.UI.RadSpreadsheet.EnsureDataBound() +53 Telerik.Web.UI.RadSpreadsheet.OnPreRender(EventArgs e) +27 System.Web.UI.Control.PreRenderRecursiveInternal() +88 System.Web.UI.Control.PreRenderRecursiveInternal() +160 System.Web.UI.Control.PreRenderRecursiveInternal() +160 System.Web.UI.Control.PreRenderRecursiveInternal() +160 System.Web.UI.Control.PreRenderRecursiveInternal() +160 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +883

  9. Rodrigo
    Rodrigo avatar
    7 posts
    Member since:
    Jan 2011

    Posted 11 May in reply to Trent Link to this post

    Hi Trent,

    Which version of the dlls you got, I´m facing the same trouble.

    thanks.

  10. Bozhidar
    Admin
    Bozhidar avatar
    1102 posts

    Posted 12 May Link to this post

    Hello,

    This exception can happen if the Excel file is opened by another process at the time you are trying to access it. Try closing the excel file and running the application again.

    Regards,
    Bozhidar
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  11. Rodrigo
    Rodrigo avatar
    7 posts
    Member since:
    Jan 2011

    Posted 12 May in reply to Bozhidar Link to this post

    Bozhidar,

     

    Thanks but the file is closed, I'm using the spreadsheet inside a RadMultiPage control, I tried to but the spreadsheet control outside the multipage and it works.

     

    Now my doubt is how can I emulate something similar like a RadMultiPage in order to achive the same behavior?

    This control just accept .xlsx format?

     

    Thanks in advance.

  12. Bozhidar
    Admin
    Bozhidar avatar
    1102 posts

    Posted 13 May Link to this post

    Hi,

    I tried the following confituration with the Spreadsheet inside a MultiPage and it again works as expected:
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0">
        <telerik:RadPageView ID="RadPageView1" runat="server">
            <telerik:RadSpreadsheet ID="RadSpreadsheet1" runat="server"></telerik:RadSpreadsheet>
        </telerik:RadPageView>
    </telerik:RadMultiPage>

    protected void Page_Load(object sender, EventArgs e)
    {
        RadSpreadsheet1.Provider = new SpreadsheetDocumentProvider(Server.MapPath("Book1.xlsx"));
    }

    The Spreadsheet offers several databinding options, which are explained in detail in our online documentation:
    http://docs.telerik.com/devtools/aspnet-ajax/controls/spreadsheet/data-binding/providers/using-a-data-provider
    http://docs.telerik.com/devtools/aspnet-ajax/controls/spreadsheet/data-binding/providers/custom-database-provider
    http://docs.telerik.com/devtools/aspnet-ajax/controls/spreadsheet/data-binding/programmatic-binding

    Regards,
    Bozhidar
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  13. Yogesh
    Yogesh avatar
    1 posts
    Member since:
    Jan 2015

    Posted 27 May in reply to Bozhidar Link to this post

    Hi,

    I tried RadMultiPage  option as well as all other binding option but I am getting below error.

    [NullReferenceException: Object reference not set to an instance of an object.] Telerik.Web.UI.SpreadsheetDocumentProvider.GetSheets() +72 Telerik.Web.UI.RadSpreadsheet.PerformSelect() +110 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74 Telerik.Web.UI.RadSpreadsheet.EnsureDataBound() +98 System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(EventArgs e) +22 Telerik.Web.UI.RadDataBoundControl.OnPreRender(EventArgs e) +36 Telerik.Web.UI.RadSpreadsheet.OnPreRender(EventArgs e) +80 System.Web.UI.Control.PreRenderRecursiveInternal() +88 System.Web.UI.Control.PreRenderRecursiveInternal() +160 System.Web.UI.Control.PreRenderRecursiveInternal() +160 System.Web.UI.Control.PreRenderRecursiveInternal() +160 System.Web.UI.Control.PreRenderRecursiveInternal() +160 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +883

    I am using Telerik.Web.Spreadsheet v2016.1.108.45

     

    Please advice.

    Thanks.

  14. Bozhidar
    Admin
    Bozhidar avatar
    1102 posts

    Posted 30 May Link to this post

    Hello,

    Follow the suggestions from the previous posts in this thread, and if this doesn't help you can open a support ticket and send us a sample project, so that we can take a look at your concrete implementation.

    Regards,
    Bozhidar
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017