PHP Classes

cannot create or download excel file

Recommend this page to a friend!

      Niger PHP MySQL Excel Export  >  All threads  >  cannot create or download excel file  >  (Un) Subscribe thread alerts  
Subject:cannot create or download excel file
Summary:every works okay but file not gets created.
Messages:9
Author:Maninder Singh
Date:2021-11-10 04:08:16
 

  1. cannot create or download excel file   Reply   Report abuse  
Picture of Maninder Singh Maninder Singh - 2021-11-10 04:08:16
Hi i follwed the instructions in read me file but csv/excel file not created and cannot download although I get "You succeed ! Congratulations." message.

My page does not show any error. Can you please tell how to create and download excel file.

  2. Re: cannot create or download excel file   Reply   Report abuse  
Picture of Hassane Moussa Hassane Moussa - 2021-11-10 08:21:22 - In reply to message 1 from Maninder Singh
Hi Maninder,

Very thanks to have use this package !
Below are the actions to be do :
1- Check well :
$extension = ".csv"; // Extension File : ex : .txt ; .xls; .xlsx; ...
$filename = "TestFile"; // the file name or path ex: file/TestFile

2- Check if you have right to create file.

3- See in your racine folder (the folder where you have a sources codes files), you should see it.

Please let's me know any problem !

Best regards,
Hassane


  3. Re: cannot create or download excel file   Reply   Report abuse  
Picture of Maninder Singh Maninder Singh - 2021-11-10 11:58:26 - In reply to message 2 from Hassane Moussa
PHP Warning: Invalid argument supplied for foreach() in /home/mstipsin/public_html/test/final.php on line 122 i.e. foreach ($Resulats as $Valeur)




$limit = 100; // number of rows in the file
$extension = ".xlsx"; // Extension File : ex : .txt ; .xls; .xlsx; ...
$filename = "tmp/maninder"; // the file name

$Resulats=$sql;

if ($Resulats){
$i =0;
$j = 1 ;

foreach ($Resulats as $Valeur)
{
if ($nigerconnect->Modulo($i,$limit) ==0){

$newfile = $nigerconnect->CreatFile($filename,$extension,$j) ; // create new file
fputs($newfile, 'Class;Type;Question;Marks'); // file header
fputs($newfile, "\r\n");
$j++;
}
$i++;
fputs($newfile, '"'.$Valeur[0].'";"'.$Valeur[1].'";"'.$Valeur[3].'"'); // put the data from database in the file
fputs($newfile, "\r\n");
if ($nigerconnect->Modulo($i,$limit) ==0){fclose($newfile);} // close file


} // foreach
echo "You succeed ! Congratulations.";
} // if
else {
echo "You did not succeed.Check your sql!";
}

  4. Re: cannot create or download excel file   Reply   Report abuse  
Picture of Hassane Moussa Hassane Moussa - 2021-11-10 14:02:45 - In reply to message 3 from Maninder Singh
Hello,

It is just a warning but the file has been created, please check !
Please show me your variable array $sql ?

I am waiting your return !

best regards,
Hassane

  5. Re: cannot create or download excel file   Reply   Report abuse  
Picture of Maninder Singh Maninder Singh - 2021-11-10 15:21:21 - In reply to message 4 from Hassane Moussa
Live Example:
mstips.in/test/final.php?id=5qks&sc ...


my file code (without DB credentials)

mstips.in/test/code.txt

  6. Re: cannot create or download excel file   Reply   Report abuse  
Picture of Hassane Moussa Hassane Moussa - 2021-11-11 08:34:35 - In reply to message 5 from Maninder Singh
Those sites links is inaccessible !
let's me know if file created or no ?

  7. Re: cannot create or download excel file   Reply   Report abuse  
Picture of Maninder Singh Maninder Singh - 2021-11-11 10:28:51 - In reply to message 6 from Hassane Moussa
no file created.

txt code link works try that

  8. Re: cannot create or download excel file   Reply   Report abuse  
Picture of Hassane Moussa Hassane Moussa - 2021-11-11 11:06:00 - In reply to message 7 from Maninder Singh
I try again but I do not still access !
Please show me the code in this forum, I will check !

  9. Re: cannot create or download excel file   Reply   Report abuse  
Picture of Hassane Moussa Hassane Moussa - 2021-11-15 08:54:23 - In reply to message 7 from Maninder Singh
Hello,
I do not receive your feedback !!!

I am waiting !!!

best regards,

 
For more information send a message to info at phpclasses dot org.