Problems using Spread.NET load on demand

Posted by: rodrigosouzamendonca on 8 September 2017, 3:02 pm EST

  • Posted 8 September 2017, 3:02 pm EST

    Hi everybody,

    I am using Spread.NET 6 on a ASP.NET project and I would like to know if there is any limitation for load on demand on trial version. I am testing Spread.NET to see if it covers my project requirements. If so, I will buy the professional version.

    I tried to load up to 50k rows from a DataTable, but load on demand works only until line 1k/1,1k. Reading the documentation, I did not find any restriction or limitation on the properties that can be set to make load on demand works.

    Here are my .cs and .aspx files:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Data;

    namespace Scc
    {
        public partial class _Default : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                sccSpread.CommandBar.Visible = false;

                sccSpread.ActiveSheetView.PageSize = 2000;
                sccSpread.ActiveSheetView.AllowLoadOnDemand = true;
                sccSpread.ActiveSheetView.LoadInitRowCount = 500;
                sccSpread.ActiveSheetView.LoadRowIncrement = 300;

                DataTable dtPerson = new DataTable("Person");

                DataColumn dcFirstName = new DataColumn("First name");
                dcFirstName.DataType = typeof(string);
                dcFirstName.Caption = "First name";
                dtPerson.Columns.Add(dcFirstName);

                DataColumn dcLastName = new DataColumn("Last name");
                dcLastName.DataType = typeof(string);
                dcLastName.Caption = "Last name";
                dtPerson.Columns.Add(dcLastName);

                DataColumn dcAge = new DataColumn("Age");
                dcAge.DataType = typeof(int);
                dcAge.Caption = "Age";
                dtPerson.Columns.Add(dcAge);

                DataColumn dcHeight = new DataColumn("Height");
                dcHeight.DataType = typeof(double);
                dcHeight.Caption = "Height";
                dtPerson.Columns.Add(dcHeight);

                DataColumn dcWeight = new DataColumn("Weight");
                dcWeight.DataType = typeof(double);
                dcWeight.Caption = "Weight";
                dtPerson.Columns.Add(dcWeight);

                DataColumn dcGender = new DataColumn("Gender");
                dcGender.DataType = typeof(string);
                dcGender.Caption = "Gender";
                dtPerson.Columns.Add(dcGender);

                DataColumn dcSingle = new DataColumn("Single");
                dcSingle.DataType = typeof(bool);
                dcSingle.Caption = "Single";
                dtPerson.Columns.Add(dcSingle);

                DataColumn dcEmail = new DataColumn("E-mail");
                dcEmail.DataType = typeof(string);
                dcEmail.Caption = "E-mail";
                dtPerson.Columns.Add(dcEmail);

                DataColumn dcBirthDate = new DataColumn("Birth date");
                dcBirthDate.DataType = typeof(string);
                dcBirthDate.Caption = "Birth date";
                dtPerson.Columns.Add(dcBirthDate);

                for (int i = 0; i < 50000; i++)
                {
                    DataRow drPerson = dtPerson.NewRow();
                    drPerson["First name"] = "John";
                    drPerson["Last name"] = "Smith";
                    drPerson["Age"] = "28";
                    drPerson["Height"] = "1,83";
                    drPerson["Weight"] = "88,4";
                    drPerson["Gender"] = "Male";
                    drPerson["Single"] = "true";
                    drPerson["E-mail"] = "john.smith@gmail.com";
                    drPerson["Birth date"] = "01/12/1982";
                    dtPerson.Rows.Add(drPerson);
                }

                dtPerson.AcceptChanges();

                sccSpread.DataSource = dtPerson;
            }
        }
    }

    ####################################################################

    <%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
        CodeBehind="Default.aspx.cs" Inherits="Scc._Default" %>

    <%@ Register assembly="FarPoint.Web.Spread, Version=6.0.3505.2008, Culture=neutral, PublicKeyToken=327c3516b1b18457" namespace="FarPoint.Web.Spread" tagprefix="FarPoint" %>




                BorderStyle="Solid" BorderWidth="1px" Height="200" Width="800">
                        buttonhighlightcolor="ControlLightLight" buttonshadowcolor="ControlDark">
           

           
               
               

           

       



  • Replied 8 September 2017, 3:02 pm EST

    Hello,

    I was able to replicate the issue at my end, however I would need some time to investigate the issue further. I would soon share my observations on the same.

    Thanks,

    Manpreet Kaur

  • Replied 8 September 2017, 3:02 pm EST

    Hello,

    There is no restrictions as such with trial version you are only missing to check for a postback on Page Load. i.e.

    if you use your code like this it should work fine:

      protected void Page_Load(object sender, EventArgs e)
            {
                if (!IsPostBack)
                {
                    FpSpread1.CommandBar.Visible = false;

                    FpSpread1.ActiveSheetView.PageSize = 2000;
                    FpSpread1.ActiveSheetView.AllowLoadOnDemand = true;
                    FpSpread1.ActiveSheetView.LoadInitRowCount = 500;
                    FpSpread1.ActiveSheetView.LoadRowIncrement = 300;

                    DataTable dtPerson = new DataTable("Person");

                    DataColumn dcFirstName = new DataColumn("First name");
                    dcFirstName.DataType = typeof(string);
                    dcFirstName.Caption = "First name";
                    dtPerson.Columns.Add(dcFirstName);

                    DataColumn dcLastName = new DataColumn("Last name");
                    dcLastName.DataType = typeof(string);
                    dcLastName.Caption = "Last name";
                    dtPerson.Columns.Add(dcLastName);

                    DataColumn dcAge = new DataColumn("Age");
                    dcAge.DataType = typeof(int);
                    dcAge.Caption = "Age";
                    dtPerson.Columns.Add(dcAge);

                    DataColumn dcHeight = new DataColumn("Height");
                    dcHeight.DataType = typeof(double);
                    dcHeight.Caption = "Height";
                    dtPerson.Columns.Add(dcHeight);

                    DataColumn dcWeight = new DataColumn("Weight");
                    dcWeight.DataType = typeof(double);
                    dcWeight.Caption = "Weight";
                    dtPerson.Columns.Add(dcWeight);

                    DataColumn dcGender = new DataColumn("Gender");
                    dcGender.DataType = typeof(string);
                    dcGender.Caption = "Gender";
                    dtPerson.Columns.Add(dcGender);

                    DataColumn dcSingle = new DataColumn("Single");
                    dcSingle.DataType = typeof(bool);
                    dcSingle.Caption = "Single";
                    dtPerson.Columns.Add(dcSingle);

                    DataColumn dcEmail = new DataColumn("E-mail");
                    dcEmail.DataType = typeof(string);
                    dcEmail.Caption = "E-mail";
                    dtPerson.Columns.Add(dcEmail);

                    DataColumn dcBirthDate = new DataColumn("Birth date");
                    dcBirthDate.DataType = typeof(string);
                    dcBirthDate.Caption = "Birth date";
                    dtPerson.Columns.Add(dcBirthDate);

                    for (int i = 0; i < 50000; i++)
                    {
                        DataRow drPerson = dtPerson.NewRow();
                        drPerson["First name"] = "John";
                        drPerson["Last name"] = "Smith";
                        drPerson["Age"] = "28";
                        drPerson["Height"] = "1,83";
                        drPerson["Weight"] = "88,4";
                        drPerson["Gender"] = "Male";
                        drPerson["Single"] = "true";
                        drPerson["E-mail"] = "john.smith@gmail.com";
                        drPerson["Birth date"] = "01/12/1982";
                        dtPerson.Rows.Add(drPerson);
                    }

                    dtPerson.AcceptChanges();

                    FpSpread1.DataSource = dtPerson;
                  
                }

            }

     

    Thanks,

Need extra support?

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

Learn More

Forum Channels