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

3 posts, 0 answers
  1. Srikrishna
    Srikrishna avatar
    10 posts
    Member since:
    May 2015

    Posted 05 Oct Link to this post

    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. Srikrishna
    Srikrishna avatar
    10 posts
    Member since:
    May 2015

    Posted 09 Oct Link to this post

    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 .
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Kostadin
    Admin
    Kostadin avatar
    1711 posts

    Posted 10 Oct Link to this post

    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.
Back to Top