Excel template done in HTML for export: how to make it Landscape?

Amegi18

New Member
Joined
Mar 18, 2013
Messages
9
Hi, I am tasked to export a data table done in visualforce (using apex), into an excel file.

I can already export the data into an excel file. The display is also ok when exported to excel.
My problem is that, I do not know how to code in HTML, in such a way that the exported excel file will
automatically be in landscape format.

I have an idea from other forums but it doesn't work.
Please help ... m(_ _)m

Here is a part of the code handling the page orientation (but it does not work):

Code:
<apex:page standardController="NDOC_LIST__c" extensions="NDOC_LIST_Ext" contentType="application/vnd.ms-excel#DocStat.xls" recordSetVar="ndocs" sidebar="false">
<style type="text/css">
@page
  { 
    mso-header-data:"DOCUMENT STATUS LIST";
    margin:.91in .39in .55in .39in;
    mso-header-margin:.79in;
    mso-footer-margin:.39in;
[B]    mso-page-orientation:landscape;[/B]
  }
...
* the code is so far purely apex and html only..
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,214,951
Messages
6,122,442
Members
449,083
Latest member
Ava19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top