Main Content

タイトル ページの作成

mlreportgen.report.TitlePage クラスを使用して、タイトル ページをレポートに追加することができます。DOM オブジェクトを使用してタイトル ページを作成してレポートに追加するよりも、このクラスを使用する方がはるかに簡単で効率的です。このクラスには次の事前定義されたホールと書式設定があります。

  • タイトル

  • サブタイトル

  • イメージ

  • 作成者

  • 発行者

  • 発行日

タイトル ページに含めない項目は除外することができます。また、TitlePage テンプレートを編集してさらに項目を追加することができます。

この例では、既定の書式設定を使用するタイトル ページを作成するコードを示します。

次のコマンドを実行して、この例で使用されているサポート ファイルにアクセスします。

openExample('rptgen/MatlabReportGeneratorSupportFilesExample');
import mlreportgen.report.*
rpt = Report('output','pdf');

tp = TitlePage();
tp.Title = 'Aircraft Tests';
tp.Subtitle = 'Monthly Data';
tp.Image = which('b747.jpg');
tp.Author = 'John Smith';
tp.Publisher = 'MathWorks';
tp.PubDate = date();

add(rpt,tp);
close(rpt);
rptview(rpt);

The report title page has the title, Aircraft Tests, subtitle, Monthly Data, an image of a Boeing 747, author, John Smith, publisher, MathWorks, and the date.

詳細な情報と例については、mlreportgen.report.TitlePageを参照してください。