Spreadsheet_excel_writer (Pear) Related issues

Source: Internet
Author: User
Tags pear
Spreadsheet_excel_writer (Pear) question
Thank you.

I'm having a strange problem when I use Spreadsheet_excel_writer to generate Excel.
If the generated Excel is saved on your hard disk, you will not be able to generate a popup box;
and generate the pop-up box source code, put on the company server is no problem,
But in the local environment can not, is not my configuration is what negligence,
Please the hero to guide the maze, 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 (); Initialize class

$workbook->send ("Testreport.xls");

Setversion, $workbook (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, ' Align ' = ' Center ', ' valign ' = ' vcenter '
));

$formart->settextwrap ();
$format _title= $workbook->addformat (Array (' right ' = = 1, ' bottom ' = 1, ' Size ' =>9, ' Align ' = ' Center ', ' valign ' = ' vcenter '
));


$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 (); Complete the download


------Solution--------------------
What is the difference between your local and server environment?
------Solution--------------------
If the generated Excel saved on your hard disk is not a problem, but you can not generate a popup box?

What is the meaning of this remark?
------Solution--------------------
Your question should have been solved now, right?
------Solution--------------------
It's not related to 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.