User Guide Cancel

spreadsheetGetPrintOrientation

 

Description

Retrieves the type of orientation, landscape or portrait, of a spreadsheet.

Returns

Landscape or portrait mode. 

History

  • ColdFusion (2025 release): Added the function.

Syntax

spreadsheetGetPrintOrientation(Object spreadsheet)
spreadsheetGetPrintOrientation(Object spreadsheet)
spreadsheetGetPrintOrientation(Object spreadsheet)

Parameters

Name

 

 

Required

 

 

Type

 

 

Description

 

 

spreadSheetObject

 

 

Yes

 

 

ExcelInfo 

 

 

The Excel spreadsheet object to which you must set the print orientation to landscape or portrait.

 

Example

<cfquery name="art" datasource="cfartgallery">
SELECT * FROM ART
</cfquery>
<cfscript>
theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "art-file.xls";
// create a spreadsheet object
theSheet=spreadsheetNew("SampleData")
// add rows from the table to the spreadsheet
spreadsheetAddRows(theSheet,art)
// set print orientation
try{
spreadsheetSetPrintOrientation(theSheet,"portrait","SampleData")
writeOutput("Print orientation set successfully" & "<br/>")
}
catch (any e){
writeOutput(e.message)
}
// get the print orientation
getOrientation=spreadsheetGetPrintOrientation(theSheet)
writeOutput("Print orientation is: " & getOrientation)
</cfscript>
<cfquery name="art" datasource="cfartgallery"> SELECT * FROM ART </cfquery> <cfscript> theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "art-file.xls"; // create a spreadsheet object theSheet=spreadsheetNew("SampleData") // add rows from the table to the spreadsheet spreadsheetAddRows(theSheet,art) // set print orientation try{ spreadsheetSetPrintOrientation(theSheet,"portrait","SampleData") writeOutput("Print orientation set successfully" & "<br/>") } catch (any e){ writeOutput(e.message) } // get the print orientation getOrientation=spreadsheetGetPrintOrientation(theSheet) writeOutput("Print orientation is: " & getOrientation) </cfscript>
<cfquery name="art" datasource="cfartgallery">
    SELECT * FROM ART
</cfquery>
<cfscript>
    theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "art-file.xls";
    // create a spreadsheet object
    theSheet=spreadsheetNew("SampleData")
    // add rows from the table to the spreadsheet
    spreadsheetAddRows(theSheet,art)
    // set print orientation
    try{
        spreadsheetSetPrintOrientation(theSheet,"portrait","SampleData")
        writeOutput("Print orientation set successfully" & "<br/>")
    }
    catch (any e){
        writeOutput(e.message)
    }
    // get the print orientation
    getOrientation=spreadsheetGetPrintOrientation(theSheet)
    writeOutput("Print orientation is: " & getOrientation)
</cfscript>

Get help faster and easier

New user?