Hi,
i've a problem about excel exportation with php.
when i run the script, it make the xls file without problems but...
the file is very big... 41 megabyte for 10k rows.
the area around this 10k rows is white.

how i can to resolve this problem?

sorry for my english,

    It would be helpful to see your script first.

      mhhh the script is simply... ther are only the xls header information...
      instead of the data are in 1000 rows in html code... part of this rows are in a while and print that 10000 rows.

      this is the php headers

      <?php
         $filename="Export_Previsioni_" . date("Ymd") . ".xls";
         #header ("Content-Type: application/vnd.ms-excel");
         #header ("Content-Disposition: inline; filename=$filename");
      
      header("Content-type: application/x-msdownload");
      header("Content-Disposition: attachment; filename=$filename");
      header("Pragma: no-cache");
      header('Cache-Control: no-store, no-cache, must-revalidate');     // HTTP/1.1 
      header('Cache-Control: pre-check=0, post-check=0, max-age=0');    // HTTP/1.1
      header("Expires: 0");
      header('Content-Transfer-Encoding: none');
      header('Content-Type: application/vnd.ms-excel;');                 // This should work for IE & Opera
      header("Content-type: application/x-msexcel");                    // This should work for the rest
      ?>
      

        if it's printing 10000 rows and none of them have data, that would explain the white space.

          these 10000 rows have data.. the rest of the page is completely white (without standard grid)

            It may not be the headers that cause the problem, but I can't tell without seeing the other code. I'd bet you are actually exporting a CSV file which is not an excel file. If the download thinks it really is an excel file, it may be trying to interpret a binary file rather than a comma-separated text file.

              Write a Reply...