How to solve the problem of exporting file formats in phpexcel-php Tutorial

Source: Internet
Author: User
Phpexcelexported file format for zhidao.baidu.comquestion515423304.html? Oldq1 & nbsp; thank you ------ solution ------------------ www. cnblogs. comdahuzizydarchive2 phpexcel export file format solution
Http://zhidao.baidu.com/question/515423304.html? Oldq = 1 Thanks


------ Solution --------------------
Http://www.cnblogs.com/dahuzizyd/archive/2012/07/06/2579738.html

It is important to output each line cyclically in the code.
Use mergeCells to merge cells as needed.
------ Solution --------------------
Http://bbs.csdn.net/topics/390237081
Http://bbs.csdn.net/topics/390263234
You can refer to these two posts
At that time, I asked statistics based on different people.

I don't know if it meets your requirements.

$ Last = array (); when $ row ['name']! = $ Last ['name'] is output

I feel that you have changed the part of my total computing to the one you want to output.

------ Solution --------------------
Use mergeCells ("A1": "A2"). you can write the code by referring to it.
------ Solution --------------------
Reference:
Now I can get it out, but I don't know why there is always one fewer record when I insert it in an excel loop.


I can see that there is no first line of code. after you compare the code, the output is different only when it is the same, no output, so it is unclear how to deal with phpexcel when there is a few lines.

This is the method I posted on the 4th floor to directly output the Php page for reference only.

$ SQL = "select * from record where officecode = '$ officecode' and searchtime like' % $ riqi % 'order by name limit $ offset, $ Page_size ";
$ Result = mysql_query ($ SQL, $ link );
$ Last = array ();
While ($ row = mysql_fetch_array ($ result )){
If ($ last ){
$ Row ['xingshi'] = (strtotime ($ row ['arrivetime'])-strtotime ($ last ['gotime'])/60;
If ($ row ['name'] = $ last ['name']) {// still the same group
$ Distance + = $ row ['distance ']; // calculates the total distance.
$ Xingshi + = $ row ['xingshi ']; // calculates the travel time.
}
Else {
// When the group changes, the driving time is 0.
$ Row ['xingshi '] = 0;
?>
Total





// Reset the travel distance and time after completing the total
$ Distance = $ row ['distance '];
$ Xingshi = 0;
}
}
Else {
// The distance and time of the first entry of each name
$ Distance = $ row ['distance '];
$ Xingshi = 0;
}
$ Last = $ row;
?>


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.