7

I am trying to generate a excel sheet from a VF page. i am using

contenttype="application/x-excel#filename.xls"

on the page tag. These work perfectly fine. I just need a way to have the filenames dynamically generated or a simple adding of todays datetime to the end of the filename.

Tried adding contenttype="application/x-excel#filename" +"{!todays}"+".xls"

and it didnt allow Any thoughts?

1 Answer 1

8

This will do the trick!

contenttype="application/x-excel#filename{!TODAY()}.xls"

Results in ...

enter image description here

You are able to use bindings and/or formula functions in attribute values, even those on the apex:page tag!

3
  • 1
    Nice! Fasted Q&A in the world! :) Commented Jun 13, 2013 at 10:18
  • i love this site :)
    – Prady
    Commented Jun 13, 2013 at 10:24
  • 2
    Same! Please be sure to mark the answer as resolved. ;-) Commented Jun 13, 2013 at 10:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .