PHP Classes

how?

Recommend this page to a friend!

      eiseXLSX  >  All threads  >  how?  >  (Un) Subscribe thread alerts  
Subject:how?
Summary:does it work
Messages:25
Author:synthetron
Date:2014-04-25 13:37:41
Update:2014-05-21 07:42:14
 
  1 - 10   11 - 20   21 - 25  

  21. Re: how?   Reply   Report abuse  
Picture of synthetron synthetron - 2014-05-19 13:57:20 - In reply to message 20 from Ilya Eliseev
cant u put it in the zip file?

  22. Re: how?   Reply   Report abuse  
Picture of synthetron synthetron - 2014-05-20 18:01:09 - In reply to message 21 from synthetron
other problem

$xlsx->data('R1C2', 1);
$xlsx->data('R1C3', 1);
$xlsx->data('R1C4', '=B1+C1');

is just putting text fields

and I want numeric and formula fields

  23. Re: how?   Reply   Report abuse  
Picture of Ilya Eliseev Ilya Eliseev - 2014-05-21 07:28:58 - In reply to message 21 from synthetron
Regarding zip: no I can't - it doesn't allow it, it says that it is 'incompatible file name format'.

Regarding numbers: data() method puts given data as string by default. If you need to set numeric value as number, set the third parameter of data($cellAddress, $data = null, $t = "s") to 'n', like this:
$xlsx->data('R3C4', 1234, 'n');

Regarding formulas: formulas are not supported in current version.

brgds,
-Ilya

  24. Re: how?   Reply   Report abuse  
Picture of synthetron synthetron - 2014-05-21 07:42:15 - In reply to message 23 from Ilya Eliseev
already found to add "v" at end


for formuals i found


t="str"><f>VLOOKUP(AJ$3,koppeling!$C:$I,4,0)</f>



  25. Re: how?   Reply   Report abuse  
Picture of Larry Wakeman Larry Wakeman - 2015-08-25 23:35:48 - In reply to message 24 from synthetron
I am having an issue with data being truncated

<code>
require_once($this->plugin_dir.'/includes/eiseXLSX.php');
$xlsx = new eiseXLSX($this->plugin_dir.'/includes/templates/template2007.xlsx');
# code to fetch data from database
$i = 3;
foreach ($posts as $item) {
$xlsx->data('A'.$i, $item->product_group_section_name);
$xlsx->data('B'.$i, $item->product_name);
$xlsx->data('C'.$i, $item->retail_min);
$xlsx->data('D'.$i, $item->retail_max);
$xlsx->data('E'.$i, $item->retail_price);
$xlsx->data('F'.$i, $item->sale_price);
$xlsx->data('G'.$i, $item->sale_start);
$xlsx->data('H'.$i, $item->sale_end);
$i++;
}
$xlsx->Output($file, "F");
$message = '<a href="'.str_replace($this->plugin_dir, $this->plugin_url, $file).'" target="_BLANK">Export File</a>';
</code>
A typical post looks like (abbreviated):
WP_Post Object
(
[ID] => 1362
[post_title] => Hosting - Web - Economy - Windows Plesk - US Region - Renewal - 4 years (recurring)
[product_id] => 32421
[product_group_section_id] => 87
[product_group_section_name] => Hosting - Web - Economy - Windows Plesk - US Region - Renewal
[product_export_group] => Web Hosting
[retail_default] => 335.52
)

The issue is that the post_title is written to the spreadsheet as '4 years (recurring)'

 
  1 - 10   11 - 20   21 - 25