mlreportgen.report.ReporterLayout クラス
名前空間: mlreportgen.report
レポーター用レイアウト
説明
mlreportgen.report.ReporterLayout
クラスのオブジェクトを使用して、レポート セクションのページ レイアウト オプション (タイトル ページ、目次、図のリスト、テーブルのリスト、表題のリスト、章など) を指定します。ページ レイアウト オプションには、透かし、先頭ページの番号付け、ページ番号形式、ページのサイズと向き、余白が含まれます。
メモ
レポート セクションのレポーターを作成すると、このクラスのインスタンスが作成され、レポーターの Layout
プロパティに割り当てられます。自分でこのオブジェクトを作成することはしません。
mlreportgen.report.ReporterLayout
クラスは handle
クラスです。
プロパティ
Watermark
— 透かしイメージ
[]
(既定値) | 文字ベクトル | string スカラー
レポート セクション ページの透かしイメージ。[]
として指定するか、イメージ パス名を含む文字ベクトルまたは string スカラーとして指定します。透かしは、レポート セクションのすべてのページに表示されます。Watermark
プロパティが []
の場合、セクションの透かしはレポートの透かしと同じになります。レポート セクションおよびレポートのレイアウト オブジェクトの Watermark
プロパティが []
の場合、透かしは表示されません。
有効なイメージの種類は次のとおりです。
.bmp
.jpg
.pdf
(PDF 出力タイプのみ).png
.svg
.tiff
FirstPageNumber
— セクションの先頭ページで使用する番号
[]
(既定値) | 整数
レポート セクションの先頭ページで使用する番号。整数または []
として指定します。このプロパティの値が -1
または []
の場合、番号は前のセクションから継続されます。先頭ページ番号を指定するには、正の整数を入力します。
メモ
既定では、最初の章の先頭ページの番号は 1 です。
PageNumberFormat
— ページの番号付けのタイプ
[]
(既定値) | 文字ベクトル | string スカラー
Word レポートまたは PDF レポートのレポート セクションに使用するページの番号付けのタイプ。文字ベクトルまたは string スカラーとして指定します。有効なページ番号形式のリストについては、mlreportgen.dom.PageNumber
の Format
プロパティを参照してください。
Landscape
— セクションのページの方向
[]
(既定値) | true
| false
レポート セクションのページの方向。true
または false
として指定します。縦向きを横向きに変更するにはこのプロパティを true
に、横向きを縦向きに変更するには false
に設定します。値が []
の場合、セクションのレイアウトで指定されたページ サイズによって方向が決定されます。
PageSize
— ページのサイズ
[]
(既定値) | mlreportgen.dom.PageSize
オブジェクト
レポート セクションのページのサイズ。mlreportgen.dom.PageSize
オブジェクトとして指定します。
PageMargins
— ページ余白、ヘッダー、フッター、およびとじしろのサイズ
[]
(既定値) | mlreportgen.dom.PageMargins
オブジェクト
レポート セクションのページ余白、ヘッダー、フッター、およびとじしろのサイズ。mlreportgen.dom.PageMargins
オブジェクトとして指定します。
PageBorder
— ページ境界線
[]
(既定値) | mlreportgen.dom.PageBorder
オブジェクト
ページ境界線。mlreportgen.dom.PageBorder
オブジェクトとして指定します。
例
章の先頭ページ番号とページ方向の設定
レポートに 3 つの章を追加します。最初の章は、先頭ページ番号に既定値の 1 を使用し、既定の縦向きのページ方向を使用します。2 番目の章では、先頭ページ番号を 1 にリセットし、横向きのページ方向を使用します。3 番目の章ではページ番号と方向が設定されていないため、前の章から引き続き既定の先頭ページ番号と、既定の縦向きのページ方向が使用されます。
import mlreportgen.report.* rpt = Report('newreport');
タイトル ページを追加します。
tp = TitlePage(); tp.Title = 'New Report'; tp.Author = 'MathWorks'; add(rpt,tp)
既定の番号付けの開始を 1 とし、既定のページ方向を縦に設定して、最初の章を追加します。
ch1 = Chapter(); ch1.Title = 'First Chapter'; sec = Section('First Section of Chapter 1'); txt = ['This is the first section of chapter 1. ',... 'The first page number for this ',... 'chapter is 1, which is the default. ',... 'The page orientation is also the default.']; append(sec,txt); append(ch1,sec); append(rpt,ch1);
番号付けを 1 にリセットし、ページ方向を横に設定して、2 番目の章を追加します。
ch2 = Chapter(); ch2.Title = '2nd chapter'; ch2.Layout.FirstPageNumber = 1; ch2.Layout.Landscape = true; sec = Section('First Section of Chapter 2'); txt = ['This is the first section of chapter 2. ',... 'The first page number is set to 1 and the ',... 'page orientation is set to landscape.']; append(sec,txt); append(ch2,sec); append(rpt,ch2);
開始ページ番号やページ方向はいずれも設定せずに、3 番目の章を追加します。これにより、この章は、前のページから続く既定のページ番号付けおよび既定の縦向きのページ方向に戻ります。
ch3 = Chapter(); ch3.Title = '3rd chapter'; sec = Section('First Section of Chapter 3'); txt = ['This is the first section of chapter 3. ',... 'Neither first page number nor page ',... 'orientation is set for this chapter. ',... 'The first page number uses the default, ',... 'which continues from the previous page. ',... 'The page orientation also uses the default, ',... 'which is portrait.']; append(sec,txt); append(ch3,sec); append(rpt,ch3);
レポートを閉じて表示します。
close(rpt); rptview(rpt)
バージョン履歴
R2017b で導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)