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
Amegi18Amegi18 

How to export excel with landscape orientation

Hi, I am trying to export a data table done in visualforce, into an excel file.

I can already export the data into an excel file. 
My problem is that, I can't make it to be automatically in landscape orientation.

I have tried this (though the set-to-landscape part doesn't work): 

<apex:page standardController=...>

<head>
  <style type="text/css">
    @page {
        mso-page-orientation: landscape;
        size: landscape;
    }
  </style>
</head>

<table width="1840">
.....
</table>

</apex:page>

 


Please help ... Thanks in advance ... m(_ _)m 

 

umesh atryumesh atry
you can use landascape using Notepad++.
please follow these steps:
1. open excel file into notepad++
2. select all recrods.
3. choose line opertaion from edit option.
4. select join line
Now you records will be into one line.
hope this will be help ful to you.
Sumitkumar_ShingaviSumitkumar_Shingavi
Add Styles in HEAD tag like below
<head>
	<style>
		@page {
			size:landscape;
		}
	</style>
</head>
It should work!

PS: if this answers your question then hit Like and mark it as solution!