Announcement

Collapse
No announcement yet.

Trouble with XLS export

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Trouble with XLS export

    Guys I have a problem with XLS export, when I try to export my grid with more than 5000 records is too slow (20 to 30 minutes). How do I fix this problem?
    First it shows me an error: allowed memory limit, that I resolved by modifying the php.ini but the problem continue.
    HELP!!!!

  • #2
    Re: Trouble with XLS export

    Hello,

    try to change these lines, max_execution_time to 3600 and memory_limit = 512M,

    regards

    Comment


    • #3
      Re: Trouble with XLS export

      I already changed these lines in my php.ini and still I have the same problem, even I tried changing the memory_limit to 1024M.
      What else I can do?

      Comment


      • #4
        Re: Trouble with XLS export

        if you try to generate the xls, with less than 5000 records, just a simple one, with 100 for example. It will take too long to ?

        Comment


        • #5
          Re: Trouble with XLS export

          No with 100 records it take a few seconds.
          But I solved the problem by creating a javascript button called "XLS" which opens in a new window a php page, with the following code:
          Code:
          <?php
            header('Content-type: application/vnd.ms-excel');
            header("Content-Disposition: attachment; filename=< nombre_archivo.xls >");
            header("Pragma: no-cache");
            header("Expires: 0");
            $res=array();
            //
            //Here should be the connection to the database and the SQL query that passes the data to the array $ res
            // 
            $arr=(array_keys($res[0]));
              for($i=0;$i<count($res);$i++){
                $val&#91;]=(array_values($res[$i]));
              }
              echo "<table border=1>
          ";
              echo "<tr>
          ";
              for($i=0;$i<count($arr);$i++){
                echo "<th>".$arr[$i]."</th>
          ";
              }
              echo "</tr>
          ";
              echo "<tr>
          ";
              for($i=0;$i<count($res);$i++){
                for($j=0;$j<count($arr);$j++){
                  echo "<td>".$val[$i][$j]."</td>
          ";
                }
                echo "<tr>
          ";
              }
              echo "</table>
          ";
            }
          ?>

          Comment


          • #6
            I too am having the same problem with large record sets. Specifically it doesn't export if the record set is above 4,000 to XLS. No problem with CSV or other formats. I have made changes to php.ini and mysql parameters. I can do an external control work around, but I really don't want to. Does anybody have any further information on this?

            Comment


            • #7
              I think that it may depend on the xls version. Which one do you use?
              Last edited by bob; 07-19-2013, 04:19 AM.
              Use www.wrike.com for effective web-based project management

              Comment


              • #8
                Just to share,
                I managed to solve it by increasing value : max_execution_time to 3600 inside php.ini

                But maybe my datas are not that big.

                Cheers

                Comment


                • #9
                  Thanks kakibox !!
                  I had success with changing the value.

                  Comment

                  Working...
                  X