Click to See Complete Forum and Search --> : Serious Problem while appending an Excel file


thanawala27
07-24-2007, 10:56 AM
Hi guys,

I had a problem while writing into an Excel file.
What i want to do is:
i want to write the contents of 2 variables in one cell of the Excel field.

to write the contents of one variable, i use
$worksheet->write_string($row, $col, $value1, $format);
this works fine.

but to write 2 variables, if i use the following code then the 2nd variable is overwritten on the first one.
$worksheet->write_string($row, $col, $value1, $format);
$worksheet->write_string($row, $col, $value2, $format);

is there any way of appending a cell by another variable? So we can write the first variable, n then append the second variable.

It would be nice if some1 could help me out.

Any Help is appreciated.

Thank You

CyCo
07-24-2007, 06:20 PM
I'm going to assume that by "append", you are referring to the concatenate and assign operator ( .= ). If so, then...$value1 .= $value2;
$worksheet->write_string($row, $col, $value1, $format);