Buy Now
Sign in

Numbers exported as text to Excel?

kizo , October 30 2007, 15:03
K
kizo 9
October 30 2007, 15:03 #3204
Hi.

When choosing to backup my data to xls, Excel says that all my "number-cells" are preceeded with an apostrophe (which they're not)or formated as text.

This makes it impossible for automatic number-functions in Excel.
Of course, this is easily fixed in Excel by just choosing to convert to numbers, but I was wondering if there is any way to change the settings so that numbers will be exported as numbers.

I've tried every kind of table for the field. It should be INT, but that doesn't work nor does anything else.

I'd really appriciate the help.

Thank you.

admin 27
October 30 2007, 19:27 #3212
Hi Kizo,

This is something to change at the function which exports but how do I know if your data type is INT or TEXT ?

Max
Max
If your main question got answered then please mark the answer using the button!
Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
K
kizo 9
October 30 2007, 20:01 #3216
"admin":
Hi Kizo,

This is something to change at the function which exports but how do I know if your data type is INT or TEXT ?

Max
Well, partly because you choose type when creating the tables via Joomla, but I've also checked in phpMyAdmin to make sure.
admin 27
October 30 2007, 20:13 #3218
Hi,

Iam not very good at excel, but is this type something to set for a cell by cell ? we can check with every cell to see if the value is an integer and make this cell data as integer!!

Sincerely,

Max
Max
If your main question got answered then please mark the answer using the button!
Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
K
kizo 9
October 31 2007, 00:01 #3224
"admin":
is this type something to set for a cell by cell ?
Yes, as far as I know.

"admin":
we can check with every cell to see if the value is an integer and make this cell data as integer!!
I'm not quite sure what you mean?

Thank you.
admin 27
October 31 2007, 00:19 #3229
Hi Kizo,

at line 641 of admin.chronocontact.php:

$sheet->writeString($rowcount, $datacol, $datarow->$table_field, 0);


we can replace it by :

if(is_int($datarow->$table_field)){ $sheet->writeNumber($rowcount, $datacol, $datarow->$table_field, 0);
}else {$sheet->writeString($rowcount, $datacol, $datarow->$table_field, 0);}


Let me know if it will go fine!

Cheers

Max
Max
If your main question got answered then please mark the answer using the button!
Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!