Atitit.excel Export Functionality Solution PHP Java version c#.net total collection. doc

Source: Internet
Author: User

Atitit.excel Export functionality Solution PHP java version c#.net Total collection . docx

.1. save format office2003 office2007/2010 format 1

1 . 2. Class Library Selection java. NET has Apache.poi available,php uses phpexcel1.8.0 1

1 . 3. issues that need to be addressed 2

1 . 4. Custom class Library Atiexcel 2

1 . 5. process details for Excel export - - export headers 2

1 . 6. process details for Excel export - - Export Data 2

1 . 7. The difference between phpexcel and poi 3

1.1. Excel save format office2003 office2007/2010 format

The Legacy office Family uses The Save format of Office 2003, which is essentially a binary compound document storage format that is now deprecated.

And the old version of theOffice (Office ), -,XP,2003)compared to the common format ofOfficethe extension of the document file adds aX, such asWordof the document. DOCthe format becomes. DOCXformat,Excelof the spreadsheet. XLSthe format becomes. XLSXformat, and so on

 openxml ( ooxml office office word , excel , powerpoint openxml format.

new version of The office family is stored in zip+ooxml format

The storage format used by the latest version of the OFFICE2016 series is still in the office2007/2010 format:

1.2.Class Library Selection java. NET has apache.poi available,php uses phpexcel1.8.0

Author :: ★ (Attilax) >>>    nickname : old Wow's paw   (   full name:: ATTILAX AKBAR AL RAPANUI  Attilax   Baroque   Alpha   Rapa Nui   )   Kanji name: Ayron, Email:[email protected]

reprint Please indicate source: http://www.cnblogs.com/attilax/

1.3. issues that need to be addressed

You need to be able to save list<map> data as Excel.

You need a table header mapping table that can bind list<map ...

Java PHP. NET version API uniformity

1.4. Custom class Library Atiexcel

Open source for flexibility, the provision of APIs too trivial, resulting in less efficient development. Further encapsulation is required.

1.5. process details for Excel export - - export headers

function AddLine ($objPHPExcel, $line, $lineNum, $isFirstTitle =false) {

$line = $list [0];

$keys =array_keys ($line);

$alphas _str= "A,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t";

$alphas =explode (",", $alphas _str);

$sheet = $objPHPExcel->setactivesheetindex (0);

$i = 0;

Print_r ($keys);d ie ();

foreach ($keys as $key)

{

$alp = $alphas [$i];

// Die ($alp);

if ($isFirstTitle)

$cell = $key;

Else

$cell = $line [$key];

$sheet->setcellvalue ($alp. $lineNum, $cell);

$i + +;

}

}

1.6. process details for Excel export - - Export Data

Export data basic and Export header API has been, but the data cell value is different, the table header method is to take the row key , the data mode is the valuethat needs row :

1.7. The difference between phpexcel and poi

Phpexcel directly operates the cell, using a1,b2 to locate the cell mode, Poi needs to find the rowfirst, more cumbersome.

Reference

PHP Operations Excel – phpexcel Basic usage -diandian_520 's column - Blog Channel -CSDN.NET.html

Atitit.excel Export Functionality Solution PHP Java version c#.net total collection. doc

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.