Ervan
Ervan

Reputation: 21

Make hyperlink content clickable in Excel after an export from Drupal7

i am using the Drupal 7 "Views Data Export" module, and i want to make Hyperlink content clickable in Excel after export from a View.

Upvotes: 0

Views: 2160

Answers (2)

Ervan
Ervan

Reputation: 21

I finally create a drupal 7 export module:

  1. The sql request

  2. Construct the result as a html table (Excel accept html datas)

    <table> <tr> <th>Title_A</th> <th>Title_B</th> </tr> <tr> <td>Content_A</td> <td>Content_B</td> </tr> </table>

  3. Add headers to create a ".xls" file with the html table

    header("Content-type: application/vnd.ms-excel"); header("Content-Disposition: attachment; filename=file.xls");

  4. For the clickable links make a html "href"

    <td><a href='Content_URL'>Content_Link_Name</a></td>

Upvotes: 0

Zolotyx
Zolotyx

Reputation: 36

Try to change your url field in views_data_export views page using rewrite output and paste there something like =HYPERLINK("[your_field]"; "[your_text]")

Upvotes: 1

Related Questions