PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, October 4, 2022

[FIXED] How to load excel template and write to it in PHPExcel?

 October 04, 2022     php, phpexcel, templates     No comments   

Issue

How do I load an Excel Template with PHPExcel and write to its cells and also insert images to cells dynamically?


Solution

You can read your excel template like this with PHPExcel:

$objPHPExcel = PHPExcel_IOFactory::load("./forms/english/cash.xlsx");

and you can write to cells like this:

  $objPHPExcel->setActiveSheetIndex(0)
                            ->setCellValue('A2', "No")
                            ->setCellValue('B2', "Name")
                            ->setCellValue('C2', "Email")
                            ->setCellValue('D2', "Phone")
                            ->setCellValue('E2', "Address");


Answered By - MJ X
Answer Checked By - David Goodson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing