Yii Framework Forum: Open A .docx Document - Yii Framework Forum

Jump to content

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

Open A .docx Document Rate Topic: -----

#1 User is offline   freshyiiuser 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 77
  • Joined: 07-March 13

Posted 15 June 2013 - 04:07 PM

i need to open a document in yii application in order to print it.

in a folder i have a x.php file, and a y.docx file

in x.php file i wrote:
<h3> <?php echo CHtml::link('Back', array('/site/page', 'view'=>'y.docx'));?> </h3> 
<a href="y.docx">Click</a>


in the first link the result is : The requested view "y.docx" was not found.
the second link'result is: The system is unable to find the requested action "y.docx".

can anyone help me, how to generally open a document file?
0

#2 User is offline   C Hodges 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 51
  • Joined: 08-April 13

Posted 16 June 2013 - 01:08 AM

You'll need an external library to do what you want.

Here's one that should allow you to open a Word document: http://www.phpdocx.com/
0

#3 User is offline   freshyiiuser 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 77
  • Joined: 07-March 13

Posted 16 June 2013 - 02:12 PM

View PostC Hodges, on 16 June 2013 - 01:08 AM, said:

You'll need an external library to do what you want.

Here's one that should allow you to open a Word document: http://www.phpdocx.com/


it seems that this library generate docx report. i already used the mpdf extension to generate docx and pdf reports. the problem now is to open the generated reports or any other docx documents.

for example if i generated a report using one of these libraries or extension, and i put the output result in protected/reports folder. and i created a link to open the generated documents, how to write this link?

thank you
0

#4 User is offline   fouss 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 394
  • Joined: 05-October 10
  • Location:Bamako Mali

Posted 16 June 2013 - 07:19 PM

Quote

The requested view "y.docx" was not found.

May be the document is not linked correctly
<a href="path_to_y.docx">Click</a>

Posted Image
0

#5 User is offline   freshyiiuser 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 77
  • Joined: 07-March 13

Posted 19 June 2013 - 03:19 PM

i generated a pdf report under \protected\reports\StudentReports\certificate.pdf folder

when i generate the report, it redirect me to the following path:

http://localhost/yii...33-10103/term/4

in this page, i need to make a link to the studentReports to open certificate.pdf

anyone have any idea how to make this happen.

thank you
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