Я экспортирую из ColdFusion 9 в Excel, и я хочу установить ориентацию страницы и масштабирование, чтобы экспортированный документ excel соответствовал странице и печатал пейзаж. Как это сделать?Экспорт из ColdFusion в Excel, как изменить настройку страницы?
Редактировать с помощью решения:
Спасибо за помощь. Настройка ориентации страницы работала так, как рекламировалась.
Я использовал следующий хак, чтобы он соответствовал ширине страницы.
Эта страница содержит документацию по различным настройкам, которые можно:
http://msdn.microsoft.com/en-us/library/Aa155477%28office.10%29.aspx
<cfheader name="Content-disposition" value="attachment;filename=export.xls">
<cfcontent type="application/application/vnd.ms-excel">
<!---
mso-page-orientation:landscape causes the exported excel spreadsheet to be printed landscape.
Setting Scale=45 causes the printout to fit to page width for me.
Per the documentation, I should be able to set
<x:Print><x:FitWidth>1</x:FitWidth><x:FitHeight>32767</x:FitHeight><x:ValidPrinterInfo/></x:Print>
but it doesn't want to work.
The width and height appear correctly in the Page Setup dialog, but the 'Adjust to' scale size
radio button remains selected instead of the 'Fit to' one page wide by 32767 tall radio button.
--->
<HTML xmlns:x="urn:schemas-microsoft-com:office:excel">
<HEAD>
<STYLE>
<!--table
@page {mso-page-orientation:landscape;}
-->
</STYLE>
<!--[if gte mso 9]><xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:WorksheetOptions>
<x:Print>
<x:ValidPrinterInfo/>
<x:Scale>45</x:Scale>
</x:Print>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
</x:ExcelWorkbook>
</xml><![endif]-->
</HEAD>
<BODY>
<cfoutput>
<cfloop from = "1" to = "#arrayLen(reportItems)#" index = "i">
<table cellpadding="1" cellspacing="1" bgcolor="dcdcdc" width="100%" border="1">
... table contents ...
</table>
</cfloop>
</cfoutput>
</BODY>
</HTML>
Не могли бы вы предоставить образец кода, показывающий, что у вас есть до сих пор? – Micah