phpexcel

Php Excel set whole column data alignment not working

佐手、 提交于 2019-12-21 07:08:37
问题 I am Using this code For E column data set to right align but Its not showing me effect $objPHPExcel->getActiveSheet() ->getStyle('E') ->getAlignment() ->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT); instead of 'E' if i write E6 then it display E6 cell data to right. $objPHPExcel->getActiveSheet() ->getStyle('E6') ->getAlignment() ->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT); 回答1: You're correct: row and column styles aren't supported by PHPExcel. Cell styling is,

Class 'ZipArchive' not found error while using PHPExcel

半世苍凉 提交于 2019-12-21 05:34:12
问题 When I use PHPExcel on a new server, I faced the error "Class 'ZipArchive' not found" and it seems to be blocked by my hosting service provider. Can't I use PHPExcel on the server without Zip support? PHP 5.2.8 is installed on this server but I can't use a basic PHP source code for PHPExcel. Any help will be appreciated, thanks. 回答1: Certain spreadsheet file formats, such as OfficeOpenXML used as the default format by Excel 2007 and above, require ZipArchive. In most recent versions of PHP,

How to use print ready functionality in PHPExcel library

随声附和 提交于 2019-12-21 04:28:20
问题 I am using PHPExcel library for spreadsheet operations. I am to apply print ready functionality. Does this functionality exist? 回答1: If you read the documentation, particularly the section entitled " Setting printer options for Excel files ", there's a lot of information about page setup for printing:- Orientation and Paper Size: $objPHPExcel->getActiveSheet() ->getPageSetup() ->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE); $objPHPExcel->getActiveSheet() ->getPageSetup(

PHPExcel will not export to CSV

不羁岁月 提交于 2019-12-21 03:58:08
问题 I am banging my head against a wall trying to figure out why I cannot get PHPExcel to output a csv file. Oddly enough, this works in Internet Explorer- it outputs as csv, but in every other browser I try it outputs it as an xls that Excel refuses to open. Any pointers would be exceedingly appreciated. error_reporting(E_ALL); $username="blah"; $password="blahz"; $database="hollatme"; $sqlsrv="localhizzost"; date_default_timezone_set('US/Central'); $currenttime=date("m-d-Y"); require_once

PHPExcel color to specific row

旧巷老猫 提交于 2019-12-20 19:43:50
问题 I am currently working with PHPExcel and I am trying to give 1 specific row a color, I have read Set Background cell color in PHPExcel already and I have try all of those options. Without luck! Maybe I do something wrong, but here it goes: //Table $objPHPExcel->setActiveSheetIndex(0) ->setCellValue('B2', 'Beller ') ->setCellValue('D2', 'Beller nummer') ->setCellValue('F2', 'Datum') ->setCellValue('H2', 'ontvanger naam') ->setCellValue('J2', 'ontvanger nummer') ->setCellValue('L2', 'Billing

Setting width of spreadsheet cell using PHPExcel

て烟熏妆下的殇ゞ 提交于 2019-12-20 09:21:15
问题 I'm trying to set the width of a cell in an Excel document generated with PHPExcel with: $objPHPExcel->getActiveSheet()->getColumnDimensionByColumn('C')->setWidth('10'); $objPHPExcel->getActiveSheet()->getColumnDimensionByColumn('C')->setAutoSize(false); but that does not works. What is the method that I need to call here? 回答1: It's a subtle difference, but this works fine for me: $objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(10); Notice, the difference between

Some Questions about PHPExcel Charts

寵の児 提交于 2019-12-20 04:57:31
问题 I am using PHPExcel for generating charts in Excel Files. I have some question whoes answer I couldn't find even after lot of R&D those are How can I show data labels to chart? How can I control the width of bar charts? How can I customize colors of bar charts? I tried to show labels with layout class like : $layout = new PHPExcel_Chart_Layout(); $layout->setShowVal(TRUE); But no success. I have also explored DataSeries class and Chart Class but couldn't find any solution. Any body here who

Calculating interest rate in PHP

旧时模样 提交于 2019-12-20 04:09:47
问题 I'm trying to calculate the interest on a loan given the initial loan amount, the number of repayments and the amount of repayments. I can't seem to get a close enough figure using a basic formula, so I've been trying to use the Newton Raphson method, which can be seen in use here: http://www.efunda.com/formulae/finance/loan_calculator.cfm (this is the exact functionality I am looking to implement) I've tried using the RATE() function from PHPExcel, however I'm not getting a correct output

Date and Datetime using PHPExcel function writes in excel as Text

£可爱£侵袭症+ 提交于 2019-12-20 03:22:11
问题 I have a problem with PHPExcel function, this is my code: <?php # Load slim WP define( 'WP_USE_THEMES', false ); require( './wp-load.php' ); # http://phpexcel.codeplex.com/ require_once dirname(__FILE__) . '/Classes/PHPExcel.php'; global $wpdb; $query = "Select tsales_funnel.ID As ID, wp_users.display_name As Darijuma_vaditajs, tcportal_starpnieks.Cp_Name As Starpnieks, tcportal_stucture.Cp_Name As OWCA, n_products.Product_Nos As Produkts, tsales_funnel_mrecord.Product_type as Produkta_kods,

PHPExcel setCellValueByColumnAndRow not writing data to spreadsheet

只谈情不闲聊 提交于 2019-12-19 23:30:13
问题 i'm outputting data from a mysql database to an excel workbook using PHPExcel. My workbook has 3 sheets and most of it is working fine. I'm having problems with the last section of output to the third sheet. What I am trying to do is output a table with row headers and column headers the values of which are taken from a mysql table and then a figure per row/column combination also taken from the mysql table based on what that row/column header is. The row and column headers are written to the