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

TreeList Export to Excel

1 Answer 66 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
karen
Top achievements
Rank 1
karen asked on 13 Nov 2016, 05:57 AM

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

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 15 Nov 2016, 03:54 PM
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.
Tags
TreeList
Asked by
karen
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or