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

NestedViewtemplate EXPORT - resulting in huge file size even if the data is not that much

2 Answers 82 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Srikrishna
Top achievements
Rank 1
Srikrishna asked on 05 Oct 2016, 08:41 PM

Hi,  

   I am trying to export a NestedViewtemplate Radgrid using the following

 

C#:

protected void rd_ItemCommand(object sender, GridCommandEventArgs e) {

rd.MasterTableView.HierarchyDefaultExpanded = true;

rd.ExportSettings.ExportOnlyData = true;

rd.ExportSettings.IgnorePaging = true;

rd.ExportSettings.HideStructureColumns = true;

rd.ExportSettings.OpenInNewWindow = true;

rd.ExportSettings.UseItemStyles = true;

rd.MasterTableView.ExportToExcel();

 

In Aspx:

<ExportSettings Excel-AutoFitImages="true" Excel-DefaultCellAlignment="Left" FileName="rdChild">     

    <Excel DefaultCellAlignment="Left" />

</ExportSettings>

 

ISSUE:

   I have 54 column in the Parent Radgrid and with 2200 records only

   Child Radgrid : 4 columns , only 1400 parents have child.  Maximum child might have 10 records 

  Data in it is very small no big descriptions or images ....

  But when I export it gives me 7 MB file. 

  Strange : if I copy the same content into a new excel it is only 500kb. So wonder what is the problem and how to address this ??

 

I saw the following : below

(Also it is important to note that the hierarchy and the nested controls have a considerable effect on the performance in this scenario.) ..

Any tips to reduce the Exported file size (already tried exml , csv nothing helped )

 

 

http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/functionality/exporting/overview

Exporting a large amount of data : We strongly recommend not to export large amounts of data since there is a chance to encounter an exception(Timeout or OutOfMemory) if more than one user tries to export the same data simultaneously. RadGrid is not suitable for such scenarios and therefore we suggest that you limit the number of columns and rows. Also it is important to note that the hierarchy and the nested controls have a considerable effect on the performance in this scenario.

2 Answers, 1 is accepted

Sort by
0
Srikrishna
Top achievements
Rank 1
answered on 10 Oct 2016, 02:47 AM
I also noticed that the same data exported through 'Radgrid'  and 'general export using database with out Radgird'  --> results in different file sizes. I mean like radgrid resulting in double the size than the other .
0
Kostadin
Telerik team
answered on 10 Oct 2016, 12:14 PM
Hi Srikrishna,

I assume you are using the default export format which is Html based one. You should note that this format export not only the data but it also exports the styles and the html structure as well. This information might not be visible but it is still included in the exported document.
What I can suggest you is to manually generate the Excel document from your database without using the grid. You can check out the following code library which demonstrates that.

Regards,
Kostadin
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Grid
Asked by
Srikrishna
Top achievements
Rank 1
Answers by
Srikrishna
Top achievements
Rank 1
Kostadin
Telerik team
Share this question
or