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

Inventory system doesn't create the word document #1403

Closed
carlosvr90 opened this issue Jun 4, 2018 · 4 comments
Closed

Inventory system doesn't create the word document #1403

carlosvr90 opened this issue Jun 4, 2018 · 4 comments

Comments

@carlosvr90
Copy link

I`m trying to make this system to make a word archive and save it.. but at first it said that string was a special character.. so i just change it from:

"use PhpOffice\PhpWord\Shared\String;"
to "use PhpOffice\PhpWord\Shared\String as POString;"

and i changed it too when the string was.. so i press to get the word file but it doesn't work.. just throw me this:

Fatal error: Uncaught Error: Class 'PhpOffice\PhpWord\Shared\String' not found in C:\xampp\htdocs\texmom\PhpWord\Element\Text.php:139 Stack trace: #0 C:\xampp\htdocs\texmom\PhpWord\Element\Text.php(59): PhpOffice\PhpWord\Element\Text->setText('PROVEEDORES') #1 [internal function]: PhpOffice\PhpWord\Element\Text->__construct('PROVEEDORES', Array) #2 C:\xampp\htdocs\texmom\PhpWord\Element\AbstractContainer.php(145): ReflectionClass->newInstanceArgs(Array) #3 [internal function]: PhpOffice\PhpWord\Element\AbstractContainer->addElement('Text', 'PROVEEDORES', Array) #4 C:\xampp\htdocs\texmom\PhpWord\Element\AbstractContainer.php(112): call_user_func_array(Array, Array) #5 C:\xampp\htdocs\texmom\report\providers-word.php(16): PhpOffice\PhpWord\Element\AbstractContainer->__call('addtext', Array) #6 {main} thrown in C:\xampp\htdocs\texmom\PhpWord\Element\Text.php on line 139

(proveedores means providers in spanish) just a name.

any clue?

@troosan
Copy link
Contributor

troosan commented Jun 6, 2018

you must be using an old version of PHPWord. This class was renamed some time ago.
Please use version 0.14

@troosan troosan closed this as completed Jun 6, 2018
@carlosvr90
Copy link
Author

thank you a lot! now i have to change almost everything but for sure it's going to work! 😄

@carlosvr90
Copy link
Author

carlosvr90 commented Jun 7, 2018

@troosan I have a question, it's possible to change my old phpword folder with the new (yeah it is but..) without touching my code in that folder? cuz' it would be a problem doing all of it again.. hope you asnwer me soon. meanwhile I'll change it one by one not touching my code (i have a long time without programming so I'm learning again) hehehe. Thank you!

@troosan
Copy link
Contributor

troosan commented Jun 8, 2018

@carlosvr90 I don't know which version you were using before and how you were loading the dependencies, but the standard way to do so now is through Composer. I hope you won't have to rewrite your whole application!

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