About the pageSetup: Is it possible to set the page border?

Apr 28, 2009 at 9:10 AM
From the page setup function list I just can find:

$objPHPExcel->getActiveSheet()->getPageSetup()->setFitToHeight(1); //to set the page FitToHeight or FitToWidth,or Scale...

But how to setup the page border? Thanks!
Developer
Apr 28, 2009 at 1:38 PM
Do you mean page margins?

Here is how to set page margins:
http://phpexcel.codeplex.com/Thread/View.aspx?ThreadId=44917

Apr 29, 2009 at 8:39 AM
Yes,it is a great gelp, thanks again!
BTW, where can I find more examples for my study in PHPEXCEL? I think the content of Develops' Ref is not enough.
Apr 29, 2009 at 8:46 AM
Another question, how to set the NumberFormat to my custom Format, Such as "### 500 ##PCS" or "--15 gram--"? The result of that cell wl be a number still.
Developer
Apr 29, 2009 at 5:07 PM
>> BTW, where can I find more examples for my study in PHPEXCEL? I think the content of Develops' Ref is not enough.

There are some tests in the Tests folder with real examples. They may also be helpful?

>> Another question, how to set the NumberFormat to my custom Format, Such as "### 500 ##PCS" or "--15 gram--"? The result of that cell wl be a number still.

Will see if we can expand the documentation to cover some of this. Tried to put something together here:
http://phpexcel.codeplex.com/WorkItem/View.aspx?WorkItemId=9893

Apr 30, 2009 at 4:53 AM
I'll study it.

Yes, I learn some from the tests, and if you can put more it wl be more helpful.

I find PHPEXCEL is quite a powerful tool, thanks for your effort.

I'd like to know that if the border of cell can be set by an "area" but not just only by "cell"? Such as (E1:E15)

 Now I have to write the code as blw:
 for($i=1;$i<16;$i++)    
  {
  $objPHPExcel->getActiveSheet()->getStyle('E'.$i)->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
  }

Or even can I set the outlet for an area "E1:G3"(with border of Left/Right/Top/Bottom)?
Developer
Apr 30, 2009 at 4:52 PM
I have put forward a feature request for this:
http://phpexcel.codeplex.com/WorkItem/View.aspx?WorkItemId=9899

As a side note, I recommend that you get familiar with the duplicateStyleArray() method as it will work much faster starting with PHPExcel 1.7.0. This is the method that corresponds to selecting a rectangular cell region and applying many style properties at once.

The loop that you are showing corresponds to selecting one cell at a time and applying one style property at a time. As you can imagine, this puts a much higher strain on the PHPExcel engine.

You can already now test this by downloading the latest "Source Code".

May 28, 2009 at 4:42 AM
Edited May 28, 2009 at 4:46 AM

Koyama,

I've got the error message as blw that I don't know why, can you help to explain?Thanks!

Stack trace: #0 /var/www/html/cysoft/Classes/PHPExcel/Writer/Excel5/Workbook.php(575): PHPExcel_Shared_OLE_PPS_File-&gt;init() #1 /var/www/html/cysoft/Classes/PHPExcel/Writer/Excel5/Workbook.php(543): PHPExcel_Writer_Excel5_Workbook-&gt;_storeOLEFile() #2 /var/www/html/cysoft/Classes/PHPExcel/Writer/Excel5/Workbook.php(233): PHPExcel_Writer_Excel5_Workbook-&gt;_storeWorkbook() #3 /var/www/html/cysoft/Classes/PHPExcel/Writer/Excel5.php(132): PHPExcel_Writer_Excel5_Workbook-&gt;close() #4 /var/www/html/cysoft/Classes/esp_ger.php(518): PHPExcel_Writer_Excel5-&gt;save('php://output') #5 {main}   thrown in <b>/var/www/html/cysoft/Classes/PHPExcel/Shared/OLE/OLE_File.php</b> on line <b>90</b><br />

Developer
May 28, 2009 at 4:54 AM

It looks like there is a problem creating a temporary file.

Can you tell me whether this error has suddenly appeared on the server, or has it never worked?

 

May 28, 2009 at 8:06 AM

we've re-setuped the server, however, other programs runs properly but with this problem.

Now I realize it maybe the problem of "stream" but not PHPExcel. Thanks!