包裹:mlreportgen.Report
超类:mlreportgen.Report。Reporter
Title page reporter
使用一个对象mlreportgen.report.titlepage
class to add a title page to a report.
这mlreportgen.report.titlepage
class is a处理
class.
兼容 |
真的
|
tp = mlreportgen.report.TitlePage()
creates a title page reporter that uses the default title page template.
sets properties using name-value pairs. You can specify multiple name-value pair arguments in any order. Enclose each property name in single or double quotes.tp
= mlreportgen.report.TitlePage(名称,价值
)
Title
-标题页标题标题页标题,,,,specified as one of these values:
字符串标量或字符向量
DOM对象
1-by-norn-1串字符串或DOM对象数组
1-by-norn-by-1 cell array of strings, character vectors, or DOM objects
A Reporter created by thegetTitleReporter
此标题页的方法
Example:tp.Title = "My Report";
GetAccess |
public
|
放Access |
public
|
字幕
-报告字幕报告字幕,,,,specified as one of these values:
字符串标量或字符向量
DOM对象
1-by-norn-1串字符串或DOM对象数组
1-by-norn-by-1 cell array of strings, character vectors, or DOM objects
由getSubtitleReporter
此标题页的方法
Example:tp.subtitle =“第i部分”;
GetAccess |
public
|
放Access |
public
|
图片
-Title page image在标题页中插入的图像,指定为以下值之一:
字符串标量或字符向量that specifies the file system path of the image
mlreportgen.report.figure
reporter
DOM对象
1-by-norn-by-1 cell array of image paths, snapshot makers, or DOM objects
由getImageReporter
此标题页的方法
图片s formats with these file extensions are supported:
。bmp
– Bitmap
.gif
- 图形互换格式
.jpg
- JPEG
。png
- 便携式网络图形
.emf
– Enhanced metafile (supported only in。docx
在Windows上输出)
。svg
- 可伸缩矢量图形
.tif
– Tag Image File
Example:tp.Image = "reports/imagedir/titleimage.jpg";
GetAccess |
public
|
放Access |
public
|
作者
-报告作者报告作者,,,,specified as one of these values:
字符串标量或字符向量
DOM对象
1-by-norn-1串字符串或DOM对象数组
1-by-norn-by-1 cell array of strings, character vectors, or DOM objects
由getAuthorReporter
此标题页的方法
If the environment variable user name is not found, the default value is empty.
Example:标题页("Author","John Smith")
GetAccess |
public
|
放Access |
public
|
出版商
-Report publisher报告发布者,指定为以下值之一:
字符串标量或字符向量
DOM对象
1-by-norn-1串字符串或DOM对象数组
1-by-norn-by-1 cell array of strings, character vectors, or DOM objects
由getPublisherReporter
此标题页的方法
Example:tp.publisher =“史密斯公司”;
GetAccess |
public
|
放Access |
public
|
PubDate
-Report publication dateReport publication date, specified as one of these values:
字符串标量或字符向量
DOM对象
1-by-norn-1串字符串或DOM对象数组
1-by-norn-by-1 cell array of strings, character vectors, DOM objects
由GetPubDatereporter
此标题页的方法
Example:tp.pubdate =“ 2017年4月23日”;
GetAccess |
public
|
放Access |
public
|
布局
-Page layout for title pagemlreportgen.Report。ReporterLayout
目的Page layout for the title page, specified as anmlreportgen.Report。ReporterLayout
目的。使用ReporterLayout
目的to override the default page layout properties, such as page orientation.
GetAccess |
public
|
放Access |
Restricts access
|
TemplateSrc
-Source of template for this reporter[]
(default) |character vector|string scalar|reporter or report|DOM document or document part该记者的模板来源,以以下方式指定:
Character vector or string scalar that specifies the path of the file that contains the template for this reporter
记者或报告将其模板用于此记者或其模板库包含此记者的模板
DOM文档或文档部分的模板用于此报告者或其模板库包含此报告者的模板
指定的模板必须相同类型作为the report to which this reporter is appended. For example, for a微软®Word报告,TemplateSrc
must be a Word reporter template. If theTemplateSrc
property is empty, this reporter uses the default reporter template for the output type of the report.
GetAccess |
public
|
放Access |
public
|
TemplateName
-此记者的模板名称name of the template for this reporter, specified as a character vector or string scalar. The template for this reporter must be in the template library of the template specified by theTemplateSrc
此记者的财产。
GetAccess |
public
|
放Access |
public
|
LinkTarget
-Hyperlink target for this reporter[]
(default) |character vector|string scalar|mlreportgen.dom.LinkTarget
目的Hyperlink target for this reporter, specified as a character vector or string scalar that specifies the link target ID, or anmlreportgen.dom.LinkTarget
目的。字符向量或字符串标量值转换为LinkTarget
目的。这link target immediately precedes the content of this reporter in the output report.
GetAccess |
public
|
放Access |
public
|
方法 | Purpose |
---|---|
mlreportgen.report.titlepage。createTemplate |
Create title page template |
mlreportgen.report.titlepage。customizeReporter |
Create custom title page reported class |
mlreportgen.report.titlepage。getClassFolder |
Get title page class definition file location |
getAuthorReporter |
获取标题页作者记者 |
getImageReporter |
获取标题页图像记者 |
getPublisherReporter |
Get title page publisher reporter |
getSubtitleReporter |
获取标题页字幕记者 |
getTitleReporter |
Get title page title reporter |
GetPubDatereporter |
获取标题页出版日期记者 |
getimpl |
获取记者的实施 |
copy |
创建记者对象的副本,并制作属性值的深副本,以引用记者,reporterlayout或dom对象 |
创建使用默认格式的标题页。将标题页添加到报告中并查看报告。
importmlreportgen.Report。*rpt = Report(“输出”,,,,"pdf");tp = TitlePage(); tp.Title =“飞机测试”;tp.subtitle ="Monthly Data";tp.Image = which("b747.jpg");tp.author =“约翰·史密斯”;tp.Publisher ="MathWorks";tp.pubdate = date();添加(RPT,TP);关闭(RPT);RPTView(RPT);
Create a title page that uses the default title format, but changes the title color to red. Specify theTitle
属性作为DOM文本
对象并将其颜色设置为红色。
importmlreportgen.Report。*importmlreportgen.dom.*rpt = Report(“输出”,,,,"pdf");tp = titlepage;tp.Title = Text(“飞机测试”);tp.Title.Color ="red";添加(RPT,TP);关闭(RPT);RPTView(RPT);
创建一个覆盖标题属性格式化的标题页。将标题字体更改为24点Arial,标题文本颜色为白色,并使用蓝色背景。您未指定的任何样式使用mlreportgen.dom.Paragraph
class defaults.
importmlreportgen.Report。*importmlreportgen.dom.*rpt = Report(“输出”,,,,"pdf");tp = TitlePage(); title = Paragraph(“飞机测试”);title.Style = {halign("left"),FontFamily(“ Arial”),。。。FontSize("24pt"),Color(“白色的”),。。。背景颜色("blue"),。。。OuterMargin(“ 0in”,,,,“ 0in”,,,,“ .5in”,,,,“ 1英寸”),。。。HAlign("center")}; tp.Title = title; tp.Subtitle ="Monthly Data";tp.Image = which("b747.jpg");tp.author =“约翰·史密斯”;tp.Publisher ="MathWorks";tp.pubdate = date();添加(RPT,TP);关闭(RPT);RPTView(RPT);
这template for a标题页
对象确定页面方向,页面边距,页面大小和其他页面布局属性。您可以使用默认模板的自定义版本自定义和覆盖标题页布局。您还可以通过自定义这些元素模板来自定义单个标题元素。这标题页
reporter supports two approaches to overriding title page element templates.
To use a custom标题页
模板:
Create a copy of the default title page template.
Edit the title page element templates as desired in the copy of the template. The names of the templates have the formtitle -pagename
wherenAME
是模板库中模板的名称。例如,标题模板的名称是titlepagetitle
。
放the标题页
TemplateSrc
property of the object to the path of the custom template.
This approach takes advantage of the fact that the标题页
对象使用专门的记者(称为孔记者)将元素模板应用于元素。因此,您可以使用标题页
methods for getting the reporter to apply a template to a particular element. For example, thegetTitleReporter
方法返回的porter used for applying thetitlepagetitle
模板与报告标题的内容。
Copy the title page element templates that you want to customize into a different template library. For example, you can copy the template library of the report or the template library of a DOM document part object. These template libraries are often libraries that you created to store customized versions of templates.
For each title page element to be customized, get its element reporter. For example, for the title, use thegetTitleReporter
method.
放theTemplateSrc
元素记者的属性到包含元素模板的自定义版本的模板库的源。
放Content
元素记者属性属于元素内容。
将标题页对象元素属性设置为“元素报告”对象。
importmlreportgen.Report。*importmlreportgen.dom.*rpt = Report(“我的报告”,,,,"pdf",,,,"MyCustomPDFTemplate");tp = titlepage;titlereporter = getTitLereporter(tp);titlereporter.templatesrc = rpt;titlereporter.content ="My Report";tp.title = titlereporter;
您单击了与此MATLAB命令相对应的链接:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
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:。
Select网站您还可以从以下列表中选择一个网站:
选择中国网站(中文或英语)以获得最佳场地性能。其他Mathworks乡村网站未针对您所在的访问进行优化。