You are here: Re: PHP COM Excel Obj « PHP Programming Language « IT news, forums, messages
Re: PHP COM Excel Obj

Posted by Steve on 06/01/06 09:45

> I am trying to use an Excel COM object via PHP. I am able to read/write
> data to cells, use AutoFilter, and AutoFit on columns. I can even set
> the cell background color.
>
> However, I am having problems with setting borders on cells and making a
> column have centered text. I am able to do this with PERL. So, I am
> looking for a an expert to tell me how to do it in PHP (I am a noob with
> PHP).

> My problem is the Borders. I have tried numerous combinations without
> luck. Such as:

> $workseet->Range($range)->Borders()->LineStyle = "xlContinuous";
> $workseet->Range($range)->Borders("xlEdgeTop)->LineStyle = "xlContinuous";
> $workseet->Range($range)->Borders()->LineStyle->Value = "xlContinuous";
> $workseet->Range($range)->Borders("xlEdgeTop)->LineStyle->Value =
> "xlContinuous";

> Nothing seems to work. I am sure it is the PERL array and how I am
> trying to lay the syntax out in PHP, but I am at a loss.

This is probably more of an MSExcel question, but I suppose it
overlaps...

xlEdgeTop, xlContinuous are VBA constants, and you used them correctly
in your PERL sample. You are using them incorrectly in your PHP sample.
Correcting other typos (so I assume this is not a cut-and-paste from
the actual code - tut tut!)

$worksheet->Range($range)->Borders()->LineStyle = xlContinuous;

This assumes you have previously DEFINEd xlEdgeTop and xlContinuous
somewhere, such as:

' XlBordersIndex enumerated constants
DEFINE( "xlEdgeTop", 8 );
' XlLineStyle enumerated constants
DEFINE( "xlContinuous", 1 );

---
Steve

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация