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
xlInsideHorizon tal xlInsideVertica l);
$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 = "xlContinuo us";
$workseet->Range($range )->Borders("xlEdg eTop)->LineStyle = "xlContinuo us";
$workseet->Range($range )->Borders()->LineStyle->Value = "xlContinuo us";
$workseet->Range($range )->Borders("xlEdg eTop)->LineStyle->Value =
"xlContinuo us";
....
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!!
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
xlInsideHorizon tal xlInsideVertica l);
$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 = "xlContinuo us";
$workseet->Range($range )->Borders("xlEdg eTop)->LineStyle = "xlContinuo us";
$workseet->Range($range )->Borders()->LineStyle->Value = "xlContinuo us";
$workseet->Range($range )->Borders("xlEdg eTop)->LineStyle->Value =
"xlContinuo us";
....
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!!
Comment