spreadsheetSetPrintOrientation

説明

シートの印刷方向を横向きまたは縦向きに設定します。デフォルトでは、現在アクティブなシートに適用されます。

戻り値

なし 

履歴

  • ColdFusion(2025 リリース):関数が追加されました。

シンタックス

spreadsheetSetPrintOrientation(spreadSheetObject, orientation, sheetName)

パラメーター

名前

 

 

必須

 

 

Type

 

 

説明

 

 

spreadSheetObject

 

 

はい

 

 

ExcelInfo 

 

 

印刷方向を横向きまたは縦向きに設定する必要のある Excel スプレッドシートオブジェクトです。

 

orientation

 

 

はい

 

 

文字列 

 

 

次のいずれかを指定します。

  • landscape
  • portrait

sheetName

 

 

いいえ

 

 

文字列

 

 

印刷方向を設定する必要があるシートです。 sheetName を指定しない場合、関数は最初のパラメーターに渡された値に関連するブック内のデフォルトのシートを選択します。

 

<cfquery name=&quot;art&quot; datasource=&quot;cfartgallery&quot;>
    SELECT * FROM ART
</cfquery>
<cfscript>
    theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & &quot;art-file.xls&quot;;
    // スプレッドシートオブジェクトを作成します
    theSheet=spreadsheetNew(&quot;SampleData&quot;)
    // テーブルからスプレッドシートに行を追加します
    spreadsheetAddRows(theSheet,art)
    // 印刷方向を設定します
    try{
        spreadsheetSetPrintOrientation(theSheet,&quot;portrait&quot;,&quot;SampleData&quot;)
        writeOutput(&quot;Print orientation set successfully&quot; & &quot;<br/>&quot;)
    }
    catch (any e){
        writeOutput(e.message)
    }
    // 印刷方向を取得します
    getOrientation=spreadsheetGetPrintOrientation(theSheet)
    writeOutput(&quot;Print orientation is: &quot; & getOrientation)
</cfscript>

ヘルプをすばやく簡単に入手

新規ユーザーの場合