• Atlas Can 23
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
I'm trying to export a Visualforce page as an Excel document.

I've looked at similar questions and the exported file is saved as a webpage embedded in excel which is prompted as unsupported/corrupt in mobile devices.

It was suggested to use html tags instead of visualforce ones to enforce proper format but this also didn't work. Below is the sample table code in the VF page.

Any thoughts? Thanks.
 
<apex:page id="Stock_Flexible2"
       standardController="Account"
       extensions="StockPDFController"
       sidebar="false"
       showHeader="false"
       contentType="application/application/vnd.ms-excel#Flexlist.xls"
       applyBodyTag="false"
       applyHtmlTag="false"
       cache="true"
       standardStylesheets="false"    
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
</head>
<div>
            <table style="width:100%">

            <h1> Sample Table </h1>

            <tr>
                <td>a</td>
                <td>b No</td>
                <td>c</td>
            </tr>

                <apex:repeat value="{!flexibleStocks}" var="flex">

                    <tr>
                        <td width="%10"> {!flex.Order_Serial__c}  </td>
                    </tr>

                    <tr>
                        <td width="10%">  {!flex.Order_No__c} </td>
                    </tr>

                    <tr>
                        <td width="10%"> {!flex.Queue__c} </td>
                    </tr>
                </apex:repeat>
            </table>
</div>