Spreadsheet_Excel_Writer (Pear)

Source: Internet
Author: User
Spreadsheet_Excel_Writer (Pear) thank you. I encountered a strange problem when using Spreadsheet_Excel_Writer to generate an Excel file. if the generated excel file is saved on the hard disk, it is OK, but the pop-up box cannot be generated. Besides, the source code of the pop-up box is generated, it is okay to put it on the company server, but it cannot be placed in the local environment. it is not a Spreadsheet_Excel_Writer (Pear) problem.
Thank you.

I encountered a strange problem when using Spreadsheet_Excel_Writer to generate an Excel file,
If the generated excel file is saved on the hard disk, the pop-up box cannot be generated;
In addition, the source code of the pop-up box is generated and put on the company server,
But it cannot be stored in the local environment. Is there any negligence in my configuration,
Thank you again.

The code example is as follows:
#! /Usr/local/bin/php. cli
Require_once (dirname (_ FILE _). "/.../../init. php ");
Require_once (APP_INC_PATH. "pear/Spreadsheet/Excel/Writer. php ");

$ Workbook = new Spreadsheet_Excel_Writer (); // Initialization class

$ Workbook-> send ("TestReport.xls ");

$ Workbook-> setVersion (8 );


$ Worksheet = & $ workbook-> addWorksheet ('sheet1 ');
$ Worksheet-> setInputEncoding ('utf-8 ');

$ Current = Date_API: getCurrentDateGMT4 ();

$ Worksheet-> setHeader ("Test Report as at". $ current. "", 0.5 );

$ Worksheet-> setColumn (0, 6, 20 );
$ Formart = $ workbook-> addFormat (array ('right' => 1, 'bottom '=> 1, 'size' => 9, & apos; Align & apos; = & apos; Center & apos; VAlign & apos; = & apos; vcenter & apos'
));

$ Formart-> setTextWrap ();
$ Format_title = $ workbook-> addFormat (array ('right' => 1, 'bottom '=> 1, 'size' => 9, & apos; Align & apos; = & apos; Center & apos; VAlign & apos; = & apos; vcenter & apos'
));


$ Format_title-> setTextWrap ();
$ Format_title-> setBold ();



$ Worksheet-> write (0, 0, "Supplier Name", $ format_title );
$ Worksheet-> write (0, 1, "Item Name", $ format_title );
$ Worksheet-> write (0, 2, "Parts Number", $ format_title );
$ Worksheet-> write (0, 3, "Price", $ format_title );
$ Worksheet-> write (0, 4, "Speed", $ format_title );
$ Worksheet-> write (0, 5, "Service Ranks", $ format_title );
$ Worksheet-> write (0, 6, "Remark", $ format_title );



$ Workbook-> close (); // download completed


------ Solution --------------------
What is the difference between your local environment and the server environment?
------ Solution --------------------
If the generated excel file is saved on the hard disk, but the pop-up box cannot be generated?

Why?
------ Solution --------------------
Your problem should have been solved now?
------ Solution --------------------
It has nothing to do with Apache 2.0 Handler

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.