Create Excel Using PHPSpreadsheet in CodeIgniter | Download Excel Format

  Рет қаралды 10,445

Knowledge Thrusters

Knowledge Thrusters

Күн бұрын

In this video , you will be able to create excel using phpspreadsheet in codeigniter and also download the created excel in downloadable format.
I have created one button with text download format, I will changing that to an anchor tag.
Pass the href of your controller function.
In controller ,
firstly include vendor/autoload.php file
after that use
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
Spreadsheet - for creating a worksheet in excel
xlsx -for creating excel file
we will be passing worksheet (spreadsheet) to xlsx - this will create a excel file that contain a worksheet.
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet-getActiveSheet();
$sheet- setCellValue('A1', 'Hello World !');
$writer = new Xlsx($spreadsheet);
$writer- save('hello world.xlsx');
For download of excel file, you have to add headers
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="hello_world.xlsx"');
save will save that in a particular folder
For download you need to pass php://output to download in excel
$writer- save("php://output");
In my previous video, I have shown how to install php spreadsheet in codeigniter, if you have not watched it please check it out:
• Installation of PhpSpr...
Documentation:
phpspreadsheet...
Starting hello world:
phpspreadsheet...
Code Link:
github.com/sus...
#codeigniter #knowledgethrusters

Пікірлер: 5
@markeybygeeta4740
@markeybygeeta4740 2 жыл бұрын
Thanks For creating valuable videos
@nabilunnajib3505
@nabilunnajib3505 3 жыл бұрын
Thanks a lot, it's really help me, i'm stuck on that problem for 2 days long or more
@rockon420ful
@rockon420ful 5 ай бұрын
hi I am not able to integrate spread sheet in xampp php8 version - root folder I added vendor folder in vendor folder autoload.php file , add in controller file in top and add name spaces for this line i am getting an error $spreadsheet = new Spreadsheet(); error as - Type: Error Message: Class "Spreadsheet" not found Please let me know ho to fix it
@AnkitaChitkul
@AnkitaChitkul 10 ай бұрын
not getting vendor folder in your code files
@AlokKejriwal
@AlokKejriwal 3 жыл бұрын
How to implement the same Codeigniter 2?
Upload Excel in MySQL using Phpspreadsheet in CodeIgniter
9:34
Knowledge Thrusters
Рет қаралды 13 М.
HAH Chaos in the Bathroom 🚽✨ Smart Tools for the Throne 😜
00:49
123 GO! Kevin
Рет қаралды 13 МЛН
ПРИКОЛЫ НАД БРАТОМ #shorts
00:23
Паша Осадчий
Рет қаралды 5 МЛН
МЕБЕЛЬ ВЫДАСТ СОТРУДНИКАМ ПОЛИЦИИ ТАБЕЛЬНУЮ МЕБЕЛЬ
00:20
No, Einstein Didn’t Solve the Biggest Problem in Physics
8:04
Sabine Hossenfelder
Рет қаралды 270 М.
Spreadsheets #1: Introduction
13:27
ExplainingComputers
Рет қаралды 1 МЛН
how to export data in excel in codeigniter 3
11:20
Codex Time
Рет қаралды 7 М.
How to add Captcha in CodeIgniter | Captcha Helper | Part -1
9:08
Knowledge Thrusters
Рет қаралды 9 М.
Read any Excel File using PHPExcel in PHP
11:44
jinu jawad m
Рет қаралды 41 М.
Installation of PhpSpreadsheet in CodeIgniter using Composer
4:18
Knowledge Thrusters
Рет қаралды 18 М.