Tag Archives: excel

Save with phpexcel to temporary file

Questions: I have to save an excel in a temporary file but I do not know how Originally this way I keep the excel file header(‘Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet’); header(‘Content-Disposition: attachment;filename=”Autolarte.xlsx”‘); header(‘Cache-Control: max-age=0’); header(‘Cache-Control: max-age=1’); header (‘Expires: Mon, 26 Jul 1997 05:00:00 GMT’); header (‘Last-Modified: ‘.gmdate(‘D, d M Y H:i:s’).’ GMT’); header (‘Cache-Control: cache, must-revalidate’); header (‘Pragma:… Read More »

import excel to database in codeigniter with multiple where_in condition

Questions: I have database like this for table nilai_siswa, master_nilai and siswa_kelas I need to input data to nilai_siswa, but i stuck in Array to string conversion here my controller : function import() { if(isset($_FILES[“file”][“name”])) { foreach($objPHPExcel->getWorksheetIterator() as $worksheet) { for($row=2; $row<=$highestRow; $row++) { $induk = $worksheet->getCellByColumnAndRow(1, $row)->getValue(); $induk1[]=array( ‘Induk’=> $induk ); $semester1[]=array( ‘semester’=> $semester);… Read More »

How to increase the number of columns in the generation of a file in xls – Laravel-Excel

Questions: I need to generate an Excel file that will have approximately 1000 columns. But at the time of generation the Laravel-Excel library can only generate 256 columns. I’ve tried almost everything: I increased memory_limit, max_execution_time, … But nothing worked so far. Versions PHP version: 7.0.26 Laravel version: 5.6 Package version: 2.1 Here is test… Read More »

Convert curl command to PHP for csv->Excel converter

Questions: Looks simple enough, but I can’t get this to work in PHP. curl -F files[]=@myfile.csv ‘https://www.rebasedata.com/api/v1/convert?outputFormat=xlsx&errorResponse=zip’ -o output.zip myfile.csv is my data file to convert. output.zip is the response containing the Excel file. It’s a csv to Excel converter service from this website https://www.rebasedata.com/convert-csv-to-excel-online Can anyone assist? Answers:

PHP: reading xls with phpexcel

Questions: I am having trouble reading the .xls file. Values ​​are read as null and in unknown characters. The file is downloaded from an ftp server and it comes protected $path = ‘doc/20180719-ASK FIDC_EVOLUCAO_COTA.xls’; $inputFileType = PHPExcel_IOFactory::identify($path); $reader = PHPExcel_IOFactory::createReader($inputFileType); $reader->setReadDataOnly(true); $reader->setInputEncoding(‘ISO-8859-1’); //$reader->setDelimiter(“\t”); $excel = $reader->load($path); var_dump($excel); echo $inputFileType; $writer = PHPExcel_IOFactory::createWriter($excel, ‘CSV’); $writer->setUseBOM(true); $writer->save(‘data.csv’);… Read More »

How to download an excel file in Spring RestController

Questions: I am using Apache POI to generate .xlsx file. I would like to return that file from Spring controller. Here’s what I’ve done so far: Controller: @RequestMapping(method = RequestMethod.GET) public HttpEntity<byte[]> createExcelWithTaskConfigurations(HttpServletResponse response) throws IOException { byte[] excelContent = excelService.createExcel(); HttpHeaders header = new HttpHeaders(); header.setContentType(new MediaType(“application”, “vnd.openxmlformats-officedocument.spreadsheetml.sheet”)); header.set(HttpHeaders.CONTENT_DISPOSITION, “attachment; filename=my_file.xls”); header.setContentLength(excelContent.length); return new… Read More »

Move API Calls in Excel to a Java program [on hold]

Questions: Hi hope this isn’t confusing, but there’s a tool I use at work that’s in an excel file that makes an API call (I think my usage of the term is correct?) to an external program that sends data back to the Excel sheet. Unfortunately it’s pretty buggy just given the nature but it… Read More »