mercredi 7 août 2019

Export to Excel in laravel

we want to download excel file using excel 3.1 maatwebsite. it can help me to download file but when we increase data through sql file we are getting such type of error given below:-

Gateway Timeout The gateway did not receive a timely response from the upstream server or application.

Also we increased the memory limit in php.ini file to 512 mb and execution time to 300s.

   $records=DB::select('SELECT p.EWSCustID,p.PLAppId,CONCAT(FirstName," ", LastName) AS FULLNAME,p.LoanAmount,e.EmpStatus,csp.EmployerName,p.Designation,p.NetSalary,City,EmailID,MobileNo,State,DateOfBirth,Pincode,ci.PanNo,
         p.AppliedBank,p.AppliedDate,p.UTMCampaign,p.UTMMedium,p.UTMSource,p.UTMTerm,p.UTMContent 
         From personal_loans p, customer_profiles cp,customer_secondary_profile csp,customer_identification ci,employeestatuses e  
         WHERE p.EWSCustID=cp.EWSCustID AND p.EWSCustID=csp.EWSCustID AND p.EWSCustID = ci.EWSCustID AND p.EmployerStatus=e.EmpStatusId AND  
          DATE(p.AppliedDate) BETWEEN ? AND ?',[$StartDate,$EndDate]);

we getting proper data from this query when we increased the data limit then it get occurred error otherwise it able to download the excel file.

For exporting the file to excel we are using this code given below

Excel::download(new UsersExport($Product),$FileName);

here $filename is $FileName="Bank Response.xlsx"; and $Product = "personal_loan";

I expect the excel file will download 60k rows.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire