- $this->formatHeaderLeft = $this->xml->addStyle("formatHeaderLeft");
- $this->formatHeaderLeft->fontItalic();
- $this->formatHeaderLeft->border('Top', '2', 'darkgray');
- $this->formatHeaderLeft->border('Bottom', '2', 'darkgray');
- $this->formatHeaderLeft->alignVertical('Center');
- $this->formatHeaderRight = $this->xml->addStyle("formatHeaderRight");
- $this->formatHeaderRight->fontItalic();
- $this->formatHeaderRight->alignHorizontal('Right');
- $this->formatHeaderRight->border('Top', '2', 'darkgray');
- $this->formatHeaderRight->border('Bottom', '2', 'darkgray');
- $this->formatHeaderRight->alignVertical('Center');
- $tsep = $thoseps[user_tho_sep()];
- $dsep = $decseps[user_dec_sep()];
- $amountformat = "###{$tsep}###{$tsep}###{$tsep}##0";
- $this->formatAmount[0] = $this->xml->addStyle("formatAmount0");
- $this->formatAmount[0]->numberFormat($amountformat);
- $this->formatAmount[0]->alignHorizontal('Right');
- $this->formatAmount[1] = $this->xml->addStyle("formatAmount1");
- $this->formatAmount[1]->numberFormat("$amountformat{$dsep}0");
- $this->formatAmount[1]->alignHorizontal('Right');
- $this->formatAmount[2] = $this->xml->addStyle("formatAmount2");
- $this->formatAmount[2]->numberFormat("$amountformat{$dsep}00");
- $this->formatAmount[2]->alignHorizontal('Right');
- $this->formatAmount[3] = $this->xml->addStyle("formatAmount3");
- $this->formatAmount[3]->numberFormat("$amountformat{$dsep}000");
- $this->formatAmount[3]->alignHorizontal('Right');
- $this->formatAmount[4] = $this->xml->addStyle("formatAmount4");
- $this->formatAmount[4]->numberFormat("$amountformat{$dsep}0000");
- $this->formatAmount[4]->alignHorizontal('Right');
- $this->formatFooter = $this->xml->addStyle("formatFooter");
- $this->formatFooter->border('Top', '2', 'darkgray');
+ $this->formatHeaderLeft =& $this->addFormat();
+ $this->formatHeaderLeft->setItalic();
+ $this->formatHeaderLeft->setTop(2);
+ $this->formatHeaderLeft->setTopColor('gray');
+ $this->formatHeaderLeft->setBottom(2);
+ $this->formatHeaderLeft->setBottomColor('gray');
+ $this->formatHeaderLeft->setAlign('vcenter');
+ $this->formatDate->setAlign($rtl ? 'right' : 'left');
+ $this->formatHeaderRight =& $this->addFormat();
+ $this->formatHeaderRight->setItalic();
+ $this->formatHeaderRight->setTop(2);
+ $this->formatHeaderRight->setTopColor('gray');
+ $this->formatHeaderRight->setBottom(2);
+ $this->formatHeaderRight->setBottomColor('gray');
+ $this->formatHeaderRight->setAlign('vcenter');
+ $this->formatHeaderRight->setAlign('right');
+ $this->formatFooter =& $this->addFormat();
+ $this->formatFooter->setTop(2);
+ $this->formatFooter->setTopColor('gray');
+ }
+
+ function NumFormat($dec)
+ {
+ if (!isset($this->formatAmount[$dec]))
+ {
+ //global $thoseps,$decseps;
+ $dec = (int)$dec;
+ //$tsep = $thoseps[user_tho_sep()];
+ //$dsep = $decseps[user_dec_sep()];
+ $tsep = ',';
+ $dsep = '.';
+ $format = "###{$tsep}###{$tsep}###{$tsep}##0";
+ if ($dec>0)
+ $format .= "{$dsep}".str_repeat('0',$dec);
+ $this->formatAmount[$dec] =& $this->addFormat();
+ $this->formatAmount[$dec]->setNumFormat($format);
+ $this->formatAmount[$dec]->setAlign('right');
+ }
+ return $this->formatAmount[$dec];