|
Posted by krigare on 05/31/06 23:06
Hope this is the right place to post :-)
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).
Here is a snippet of PERL code that works:
$worksheet->Columns("c")->{ColumnWidth}=56;
my @edges = qw (xlEdgeBottom xlEdgeLeft xlEdgeRight xlEdgeTop
xlInsideHorizontal xlInsideVertical);
$range = "b1:c56";
foreach my $edge (@edges)
{
with (my $Borders =
$worksheet->Range($range)->Borders(eval($edge)), LineStyle
=>xlContinuous, Weight => xlThin, ColorIndex => 1);
}
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.
Thanks for your help!!
[Back to original message]
|