Export to Excel - time waiting

Export to Excel - time waiting

horus1613horus1613 Posts: 19Questions: 6Answers: 0

Hello.
At the moment, it takes about 6 minutes to export 1200 rows to Excel (browser Google Chrome). This is normal?

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @horus1613 ,

    No, that seems long. Take a look at the example here, this exports 5000 rows of 6 columns in a few seconds. Are you doing any rendering with columns.render or customize that would slow it down?

    Cheers,

    Colin

  • horus1613horus1613 Posts: 19Questions: 6Answers: 0
    edited June 2018

    Thank you. Experienced it was possible to establish the reason:

                        $('row', sheet).each(function(x) {
                            if ($('c[r=E'+x+'] t', sheet).text() === 'отключен') {
                                $('row:nth-child('+x+') c', sheet).attr('s', '10');
                            }
                        });
    

    However, I can not abandon this code(((

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    You'll need to optimise it in that case. Perhaps something like:

    $('row c[r^="E"] t', sheet).each(function() {
      if ($(this).text() === 'отключен') {
        $(this).closest('c').attr('s', '10');
      }
    });
    

    One less query for jQuery to perform.

    Allan

  • horus1613horus1613 Posts: 19Questions: 6Answers: 0

    But it then applies the attr to the cell, and I need to row it...

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin
    Answer ✓

    Oh yes, sorry.

    $(this).closest('row').children('c').attr('s', '10');
    

    Allan

  • horus1613horus1613 Posts: 19Questions: 6Answers: 0

    Thanks, it's works!!!

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Out of curiosity, how much faster is that, given you were looking at 6 minutes?

  • horus1613horus1613 Posts: 19Questions: 6Answers: 0

    2 seconds))

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    Wow - really? Reckon I might take the rest of the day off now... :).

    Allan

  • fserafinfserafin Posts: 7Questions: 0Answers: 0
    edited July 2018

    About the first answer of @colin ... and the example
    you posted.
    I saw that if I use the version >= 1.10.17 (or the nightly in that case) it takes ~2 seconds.
    But if you use version <= 1.10.16 it's really faster!! about 0.3 seconds.
    Something must have changed after 1.10.17 update.

    I will open a new discussion. thanks

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    If you could include a link to a test case showing the issue that will let us profile the problem.

    Allan

  • fserafinfserafin Posts: 7Questions: 0Answers: 0

    Hi @allan I saw you answered my other post. Thanks

This discussion has been closed.