Objrichtext-an independent font block in PHPExcel $ setting font for objRichText does not work

Source: Internet
Author: User
$ ObjPHPExcelnewPHPExcel (); $ objPHPExcel-& gt; getActiveSheet ()-& gt; getdefastyle style ()-& gt; getFont ()-& gt; setSize (11)-& gt; setName (& #39; UTF-8 & #39;); $ objPHPExcel-& gt; getActiveSheet ()-& gt; setTitle (& #39; sheet1 & #39 ;); $ sheet $ objPHPExcel-& gt; setActiveSh objrichtextphpphpexcel font effect cannot be displayed

$ ObjPHPExcel = new PHPExcel ();
$ ObjPHPExcel-> getActiveSheet ()-> getDefaultStyle ()-> getFont ()-> setSize (11)-> setName ('utf-8 ');

$ ObjPHPExcel-> getActiveSheet ()-> setTitle ('sheet1 ');

$ Sheet = $ objPHPExcel-> setActiveSheetIndex (0 );

$ ObjRichText = new PHPExcel_RichText ();
$ ObjRichText-> createText ('');
$ ObjPayable = $ objRichText-> createTextRun ('red type ');
$ ObjPayable-> getFont ()-> setColor (new PHPExcel_Style_Color (PHPExcel_Style_Color: COLOR_RED ));
$ Sheet-> setCellValue ('e6 ',' followed by a red font: '. $ objRichText );

The above is my code.
The result is that the text in the objPayable file can be displayed, but the text added to it cannot be displayed.
Puzzling, for help

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.