How to convert data to scientific count when exporting data to excel
- // In the excel. php file
- $ ObjActSheet = $ objPHPExcel-> getActiveSheet ();
- // Set the topic name
- $ ObjActSheet-> setCellValue ("b1", "Card number ");
- // Set the column width
- $ ObjActSheet-> getColumnDimension ('B')-> setWidth (20); // change the length value set here.
2. the character is understood as a number in excel. generally, it is set to text or try to add spaces.Solution:
- // Add data, mainly to process the data to be displayed using the chunk_split () function. you can view the specific usage of this function on your own.
- $ ObjActSheet-> setCellValue ("B $ I", chunk_split ("123456789", 4, ""); // of course, if you do not want to see a space between digits, set the value of the field to be split to a greater value. for example, set 4 to a value greater than or equal to 9.
|