You need to sign in to do that
Don't have an account?
Surender reddy Salukuti
visual force page 1
Hi every one,
actually i wrote visual force page
<apex:page standardController="account" contentType="Application/vnd.ms-excel">
<apex:form>
<apex:pageblock title="account">
<apex:pageBlockTable value="{!account.contacts}" var="contacts">
<apex:column value="{!contact.name}"/>
<apex:column value="{!contact.phone}"/>
</apex:pageBlockTable>
</apex:pageblock>
</apex:form>
</apex:page>
actually my intention is i want to know how to use contentType in vf page and how it display .
i wrote above program previed this program i am ot geeting error
but it s not showing any out put.
please let me know if any one knows about it
Thank you
surender reddy
actually i wrote visual force page
<apex:page standardController="account" contentType="Application/vnd.ms-excel">
<apex:form>
<apex:pageblock title="account">
<apex:pageBlockTable value="{!account.contacts}" var="contacts">
<apex:column value="{!contact.name}"/>
<apex:column value="{!contact.phone}"/>
</apex:pageBlockTable>
</apex:pageblock>
</apex:form>
</apex:page>
actually my intention is i want to know how to use contentType in vf page and how it display .
i wrote above program previed this program i am ot geeting error
but it s not showing any out put.
please let me know if any one knows about it
Thank you
surender reddy
<apex:page standardController="account" contentType="application/vnd.ms-excel#SalesForceExport.xls">
<apex:form>
<apex:pageblock title="account">
<apex:pageBlockTable value="{!account.contacts}" var="contacts">
<apex:column value="{!contacts.name}"/>
<apex:column value="{!contacts.phone}"/>
</apex:pageBlockTable>
</apex:pageblock>
</apex:form>
</apex:page>
Try this,
<apex:page standardController="account" contentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
<apex:form>
<apex:pageblock title="account">
<apex:pageBlockTable value="{!account.contacts}" var="contacts">
<apex:column value="{!contacts.name}"/>
<apex:column value="{!contacts.phone}"/>
</apex:pageBlockTable>
</apex:pageblock>
</apex:form>
</apex:page>
Please try the code. I hope you got the Idea from the above code: I hope you find the above solution helpful. If it does, please mark as Best
Answer to help others too.
Thanks,
Ajay Dubedi