Phpexcel Export file Format solver, how to handle

Source: Internet
Author: User
Phpexcel Export File Format Solver
Http://zhidao.baidu.com/question/515423304.html?oldq=1 Thank you.


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

It is important to loop out each line 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, when I asked, it was based on a different person's statistics.

Do not know the character does not meet your requirements

$last =array (); Output when $row[' name ']!= $last [' name ']

It feels like you're going to turn that part of my calculation into the word you're outputting.

------Solution--------------------
With MergeCells ("A1": "A2"), the specific code to write your reference should be written.
------Solution--------------------
Reference:
Now I can get it out, but I don't know why there's always a record missing when inserting Excel into the loop
.

Looked under no first line of code you are to do after comparison, is the same before the output compared to different times, no output so there is a small line of the situation phpexcel specific how to deal with not very clear

This is my 4 floor. Direct output in the PHP page output method is for reference only

$sql = "SELECT * from the 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 ']) {//or the same group
$distance + = $row [' Distance ']; Calculate Total distance
$xingshi + = $row [' Xingshi ']; Calculate travel time
}
else {
When the group changes, the driving time is 0
$row [' xingshi '] = 0;
?>
Total




Reset travel distance and travel time when total is complete
$distance = $row [' Distance '];
$xingshi = 0;
}
}
else {
Travel distance and time for the first entry of each name
$distance = $row [' Distance '];
$xingshi = 0;
}
$last = $row;
?>


  • Related Article

    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.