function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Need help on showing visualforce page as excel.


I need help on showing visualforce page as excel I tried it using contenttype="application/ But when I opened it, it will download as excel file automatically. I need view instead of download page. Please someone help me on this. 
Pavan DavePavan Dave
You may try this in your VF page:

<a target="_blank" href="" onclick="return windowpop(this.href, 545, 433)"> Preview File </a>
Ken KoellnerKen Koellner
Won't that pull a File that's stored in a File sObject?  Doesn't the question ask to return the VF page?

I use--
<apex:page controller="xxx" contenttype="application/x-excel#myFileName.xls" showheader="false">

		<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
Page contents go here.  I usually one simple HTML table with <table><tr><td> tags generated with apex repeats.