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


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,

#2 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 3,630
  • 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.

And, about writing the word contents, you have to follow the instructions of phpWord documents.
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.

Note that phpWord can not write .DOC file. It only supports .DOCX file.

#3 Guest_ssshobhit_*

  • Group: Guests

Posted 08 August 2013 - 07:38 AM


simply copy all code of function actionDownload and follow the instruction

#4 Guest_ShobhitPokhriyal_*

  • Group: Guests

Posted 12 October 2013 - 07:04 AM

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

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