mlreportgen.dom.CounterReset 类
命名空间: mlreportgen.dom
重置编号流计数器
描述
重置编号流计数器。
mlreportgen.dom.CounterReset 类是一个 handle 类。
创建对象
描述
创建一个空的计数器重置对象。counterResetObj = CounterReset
为每个指定的编号流创建一个计数器重置器。将此格式分配给 DOM 对象的样式会导致在将对象追加到文档时将相关的流计数器重置为其初始值。counterResetObj = CounterReset(streamNames)
输入参量
编号流名称,指定为字符向量或字符串标量。要指定多个流名称,请在流名称之间添加空格。
属性
目标标识符,指定为字符向量或字符串标量。DOM API 在创建文档元素对象时会生成一个会话唯一标识符。
属性:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
数据类型: char | string
编号流名称,指定为字符向量或字符串标量。要指定多个流名称,请在流名称之间添加空格。
标记,指定为字符向量或字符串标量。DOM API 在创建此对象的过程中生成一个会话唯一标记。生成的标记形式为 CLASS:ID,其中 CLASS 是对象类,ID 是对象的 Id 属性的值。使用此值来帮助确定在文档生成过程中出现的问题的位置。
属性:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
数据类型: char | string
示例
import mlreportgen.dom.*; doctype = 'html'; d = Document('test',doctype); p = Paragraph('Chapter '); p.Style = {CounterInc('chapter'),CounterReset('table'),... WhiteSpace('preserve') }; append(p,AutoNumber('chapter')); append(d,p); p = Paragraph('Table '); append(p,AutoNumber('chapter')); append(p,'.'); append(p,AutoNumber('table')); p.Style = {CounterInc('table'),WhiteSpace('preserve') }; append(d,p); p = Paragraph('Chapter '); p.Style = {CounterInc('chapter'),CounterReset('table'),... WhiteSpace('preserve')}; append(p,AutoNumber('chapter')); append(d,p); p = Paragraph('Table '); append(p,AutoNumber('chapter')); append(p,'.'); append(p, AutoNumber('table')); p.Style = {CounterInc('table'),WhiteSpace('preserve')}; append(d,p); close(d); rptview('test',doctype);
为章节以及章节内的图窗指定多个计数器流。
import mlreportgen.dom.* rpt = Document('MyReport','pdf'); chapterStyle = {WhiteSpace('pre'), ... CounterReset('table figure'), ... CounterInc('chapter') ... }; topicChapterStyle = {WhiteSpace('pre'), ... CounterReset('table figure'), ... CounterInc('chapter topic') ... }; figureStyle = {WhiteSpace('pre'), ... CounterInc('figure'),Italic(true)}; chapter = Heading(1,'Chapter: '); chapter.Style = chapterStyle; append(chapter,AutoNumber('chapter')); append(chapter,' Introduction to number streams.'); append(rpt, chapter); image = append(rpt,Image(which('b747.jpg'))); image.Width = '2in'; image.Height = '2in'; para = append(rpt, Paragraph('Figure ')); para.Style = figureStyle; append(para, AutoNumber('chapter')); append(para, '.'); append(para, AutoNumber('figure')); image = append(rpt,Image(which('ngc6543a.jpg'))); image.Width = '2in'; image.Height = '2in'; para = append(rpt,Paragraph('Figure ')); para.Style = figureStyle; append(para, AutoNumber('chapter')); append(para, '.'); append(para, AutoNumber('figure')); chapter = Heading(1, 'Chapter: '); chapter.Style = topicChapterStyle; append(chapter, AutoNumber('chapter')); append(chapter,' Topic: '); append(chapter,AutoNumber('topic')); append(chapter,' How to reset and increment streams.'); append(rpt,chapter); image = append(rpt,Image(which('b747.jpg'))); image.Width = '2in'; image.Height = '2in'; para = append(rpt,Paragraph('Figure ')); para.Style = figureStyle; append(para, AutoNumber('chapter')); append(para, '.'); append(para, AutoNumber('figure')); close(rpt); rptview(rpt.OutputPath);
版本历史记录
在 R2014b 中推出
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- 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)