TreeList Export to Excel

2 posts, 0 answers
  1. karen
    karen avatar
    3 posts
    Member since:
    May 2015

    Posted 12 Nov 2016 Link to this post

    Hi,

    I am using a TreeList with "Load-on-Demand" approach due to large number of record (>5000). The tree is first loaded with the parent node and expanded accordingly. However, my problem is that only one record will get exported to Excel .

    If I change to "Load-All" approach, exporting to Excel is fine if there is less than 2000 record. Once the record size goes over, the TreeList will fail to load.

    Here is my Load-on-Demand code;

            public JsonResult Read_AssemblyTreeList([DataSourceRequest] DataSourceRequest request, int? id)
            {
                var result = GetAssemblyPartList().ToTreeDataSourceResult(request,
                    e => e.AssemblyPartListID,
                    e => e.ParentSequence,
                    e => id.HasValue ? e.ParentSequence == id : e.ParentSequence == null,
                    e => e.ToAssemblyPartListVM());

                return Json(result, JsonRequestBehavior.AllowGet);
            }

    Here is my Load-All code;

            public JsonResult Read_AllAssemblyTreeList([DataSourceRequest] DataSourceRequest request)
            {
                var result = GetAssemblyPartList().ToTreeDataSourceResult(request,
                    e => e.AssemblyPartListID,
                    e => e.ParentSequence,
                    e => e.ToAssemblyPartListVM()
                    );
                return Json(result, JsonRequestBehavior.AllowGet);
            }

    Any help is much appreciated.

    Thanks

    Karen

  2. Daniel
    Admin
    Daniel avatar
    4950 posts

    Posted 15 Nov 2016 Link to this post

    Hello Karen,

    A possible solution would be to generate the Excel file on the server. The benefits are obvious, but you will need to do build the tree and export on your own. Once you have a ready to use tree, exporting it will be easy with either RadSpreadProcessing or RadSpreadStreamProcessing.

    Regards,
    Daniel
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top