Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notice: Undefined property: PhpOffice\PhpWord\Shared\OLERead::$documentSummaryInformation #462

Closed
nafwa03 opened this issue Jan 4, 2015 · 1 comment
Milestone

Comments

@nafwa03
Copy link

nafwa03 commented Jan 4, 2015

I believe this is a simple variable misnaming. In class oleread you you have $this->docSummaryInfos, but in MSDOC it is $ole->documentSummaryInformation. Is there a forum to ask for help?
I didn't want to open another issue for this b/c it is more of a forum thing, so sorry if I offend.
I would really appreciate if someone could help me solve this basic php to html to go into phpword. I keep getting a corrupt docx.
It is simply a four row/col layout that varies depending on car types in my query. Please help or share.

<?php
                                        $counter = 0;
                        $carCt = count($cars);
                        $arrCars = array_values($cars); 
        echo '<table width="100%" cellpadding="1" cellspacing="5">' . PHP_EOL;
        echo '<tr><th>Cars</th></tr>';
        for($i = 0; $i < $carCt; ++$i){
            $counter ++;
            echo $i % 4 == 0 ? "<tr>\n" : "";

            echo '<td width="25%" align="center" valign="middle">'.$arrCars[$i]['CarName'] . '</td>' . PHP_EOL;

            echo $i % 4 == 3 ? "</tr>\n" : "";
        }
        echo '</table>';
?>

My biggest question is...is there an endRow? How do I traverse this?

@nafwa03
Copy link
Author

nafwa03 commented Jan 5, 2015

Solved. For anyone looking to do this, it is simple. I just needed to leave it and come back.

<?php

                        $counter = 0;
                        $carCt = count($cars);
                        $arrCars = array_values($cars);
          $header = array('size' => 16, 'bold' => true);
          $section->addText(htmlspecialchars('Cars'), $header);

       $table = $section->addTable();
        for($i = 0; $i < $CarCt; ++$i){
            $counter ++;
            $i % 4 == 0 ? $table->addRow() : "";
            $table->addCell(1750)->addText(htmlspecialchars($arrCars[$i]['CarName']));
    }

@ghost ghost closed this as completed Feb 6, 2016
@Progi1984 Progi1984 assigned ghost Feb 8, 2016
@Progi1984 Progi1984 added this to the 0.13.0 milestone Feb 8, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants