app/Report/ReportHtml.php
public function write($text, $color = '', $useclass = true)
    {
        $style    = $this->getStyle($this->getCurrentStyle());
        $htmlcode = '<span dir="' . I18N::direction() . '"';
        if ($useclass) {
            $htmlcode .= ' class="' . $style['name'] . '"';
        }
        if (!empty($color)) {
            // Check if Text Color is set and if it’s valid HTML color
            if (preg_match('/#?(..)(..)(..)/', $color)) {
                $htmlcode .= ' style="color:' . $color . ';"';
            }
        }

        $htmlcode .= '>' . $text . '</span>';
        $htmlcode = str_replace([
            "\n",
            '> ',
            ' <',
        ], [
            '<br>',
            '>&nbsp;',
            '&nbsp;<',
        ], $htmlcode);
        echo $htmlcode;
    }
public function write($text, $color = '', $useclass = true)
    {
        $style    = $this->getStyle($this->getCurrentStyle());
        $htmlcode = '<span dir="' . I18N::direction() . '"';
        if ($useclass) {
            $htmlcode .= ' class="' . $style['name'] . '"';
        }
        if (!empty($color)) {
            // Check if Text Color is set and if it’s valid HTML color
            if (preg_match('/#?(..)(..)(..)/', $color)) {
                $htmlcode .= ' style="color:' . $color . ';"';
            }
        }

        $htmlcode .= '>' . $text . '</span>';
        $htmlcode = str_replace([
            "\n",
            '> ',
            ' <',
        ], [
            '<br>',
            '>&nbsp;',
            '&nbsp;<',
        ], $htmlcode);
        echo $htmlcode;
    }
public function write ( $ text , $ color = '' , $ useclass = true ) { $ style = $ this -> getStyle ( $ this -> getCurrentStyle ( ) ) ; $ htmlcode = '<span dir="' . I18N :: direction ( ) . '"' ; if ( $ useclass ) { $ htmlcode .= ' class="' . $ style [ 'name' ] . '"' ; } if ( ! empty ( $ color ) ) { // Check if Text Color is set and if it’s valid HTML color if ( preg_match ( '/#?(..)(..)(..)/' , $ color ) ) { $ htmlcode .= ' style="color:' . $ color . ';"' ; } } $ htmlcode .= '>' . $ text . '</span>' ; $ htmlcode = str_replace ( [ "\n" , '> ' , ' <' , ] , [ '<br>' , '>&nbsp;' , '&nbsp;<' , ] , $ htmlcode ) ; echo $ htmlcode ; }
Write text - ReportHtml

@param string $text  Text to print
@param string $color HTML RGB color code (Ex: #001122)
@param bool   $useclass

@return void
Write text - ReportHtml