Hello,

I'm working on a project where I need to export the results of a query to an Excel csv file. That part works fine, but one thing I would like to do is embed a hyperlink in the first column that goes to another report on the server for more detail.

I've tried using HTML, but all I get is the actual anchor tag code, not an embedded link. Ideally, I'm looking for something like this:

<a href="http://www.google.com">Google</a>

Is there a way to format this string so that it appears as a clickable link in Excel? Is this even possible?

    Probably not via the CSV route. I think you'd have to directly create a .xls file. I believe there are some functions/classes out there that may be able to do that, but I have no specific recommendations. (PEAR has the Spreadsheet_Excel_Writer package, for example, though I don't know if it supports creating links like you want or not.)

      Thanks. I was thinking about directly exporting to a .xls anyway. I'll give it a shot and see what happens.

        Write a Reply...