Yii Framework Forum: How To Use Phpword With Yii? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How To Use Phpword With Yii? Including phpWord and using it for reports... How to? Rate Topic: -----

#1 User is offline   EdinM 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 26-November 12

Posted 30 December 2012 - 01:34 PM

Hello,

I've problem with exporting records from model into MS Word document. Records contain strings and images, and should be exported to .doc file, with each record on separate page. I'm able to pass IDs of records for export to controller, but how to use phpWord with it???

It would be great if you could help me with example...

Thanks in advance,
0

#2 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 2,084
  • Joined: 16-February 11
  • Location:Japan

Posted 30 December 2012 - 08:44 PM

Hi EdinM, welcome to the forum.

In order to use phpWord library in Yii, what you have to do is just to load it.

The following is a wiki about loading phpExcel library, but you should read it, because you will encounter the same problem when you load the library.
http://www.yiiframew...ibrary-with-yii
http://www.yiiframew...-with-yii#c8432

And, about writing the word contents, you have to follow the instructions of phpWord documents.
http://phpword.codep...m/documentation
The programming in phpWord needs the same kind of knowledge when you do programming for word and/or excel in C# .net/Visual Basic/VB Script/macros. If you have experience in them, you will feel at home.

There's nothing that Yii can do to help you there, except for providing the contents from db or so.

[P.S.]
Note that phpWord can not write .DOC file. It only supports .DOCX file.
0

#3 Guest_ssshobhit_*

  • Group: Guests

Posted 08 August 2013 - 07:38 AM

http://www.yiiframew...ltodocxphpword/


simply copy all code of function actionDownload and follow the instruction
0

#4 Guest_ShobhitPokhriyal_*

  • Group: Guests

Posted 12 October 2013 - 07:04 AM

use table tr td instead of div... it works for me try
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users