WinForms基于任务报表的帮助 > 打印及预览基于任务的帮助 > 设置文档信息 |
为设置文档信息,通过设计器或者代码输入Author, Comment, Company, CreationTime, Creator, Keywords, Manager, Operator, Producer, RevisionTime, Subject,以及Title 属性的值。
在设计器中
注意:有些属性具有内建的编辑器,帮助您设置属性,比如说:
单击Keywords属性紧挨的省略号 按钮,打开字符串集合编辑器,可以为文档输入多个关键字。 |
Creator属性的默认值是 ComponentOne Document Engine。
应当添加以下代码至Form_Load 事件。
为设置Author属性,请添加以下代码:
Visual Basic
Visual Basic |
拷贝代码
|
---|---|
Me.C1PrintDocument1.DocumentInfo.Author = "Jane Doe" |
C#
C# |
拷贝代码
|
---|---|
this.c1PrintDocument1.DocumentInfo.Author = "Jane Doe"; |
为设置Comment属性,请添加以下代码:
Visual Basic
Visual Basic |
拷贝代码
|
---|---|
Me.C1PrintDocument1.DocumentInfo.Comment = "This is a C1PrintDocument file." |
C#
C# |
拷贝代码
|
---|---|
this.c1PrintDocument1.DocumentInfo.Comment = "This is a C1PrintDocument file."; |
为设置Company属性,请添加以下代码:
Visual Basic
Visual Basic |
拷贝代码
|
---|---|
Me.C1PrintDocument1.DocumentInfo.Company = "ComponentOne" |
C#
C# |
拷贝代码
|
---|---|
this.c1PrintDocument1.DocumentInfo.Company = "ComponentOne"; |
为设置CreationTime属性,请添加以下代码:
Visual Basic
Visual Basic |
拷贝代码
|
---|---|
Me.C1PrintDocument1.DocumentInfo.CreationTime = "2/29/08" |
C#
C# |
拷贝代码
|
---|---|
this.c1PrintDocument1.DocumentInfo.CreationTime = "2/29/08"; |
为设置Creator属性,请添加以下代码。默认值是ComponentOneDocumentEngine。
Visual Basic
Visual Basic |
拷贝代码
|
---|---|
Me.C1PrintDocument1.DocumentInfo.Creator = "C1PrintPreview" |
C#
C# |
拷贝代码
|
---|---|
this.c1PrintDocument1.DocumentInfo.Creator = "C1PrintPreview"; |
为设置Keywords属性,请添加以下代码。Keywords应当由空格分隔。
Visual Basic
Visual Basic |
拷贝代码
|
---|---|
Me.C1PrintDocument1.DocumentInfo.Keywords = New String() {"C1PrintPreview ComponentOne C1PrintDocument"} |
C#
C# |
拷贝代码
|
---|---|
this.c1PrintDocument1.DocumentInfo.Keywords = new string() {"C1PrintPreview ComponentOne C1PrintDocument"}; |
为设置Manager属性,请添加以下代码:
Visual Basic
Visual Basic |
拷贝代码
|
---|---|
Me.C1PrintDocument1.DocumentInfo.Manager = "John Smith" |
C#
C# |
拷贝代码
|
---|---|
this.c1PrintDocument1.DocumentInfo.Manager = "John Smith"; |
为设置Operator属性,请添加以下代码:
Visual Basic
Visual Basic |
拷贝代码
|
---|---|
Me.C1PrintDocument1.DocumentInfo.Operator = "Joe Brown" |
C#
C# |
拷贝代码
|
---|---|
this.c1PrintDocument1.DocumentInfo.Operator = "Joe Brown"; |
为设置Producer属性,请添加以下代码:
Visual Basic
Visual Basic |
拷贝代码
|
---|---|
Me.C1PrintDocument1.DocumentInfo.Producer = "ComponentOne Preview for .NET" |
C#
C# |
拷贝代码
|
---|---|
this.c1PrintDocument1.DocumentInfo.Producer = "ComponentOne Preview for .NET"; |
为设置RevisionTime属性,请添加以下代码:
Visual Basic
Visual Basic |
拷贝代码
|
---|---|
Me.C1PrintDocument1.DocumentInfo.RevisionTime = "2/29/08" |
C#
C# |
拷贝代码
|
---|---|
this.c1PrintDocument1.DocumentInfo.RevisionTime = "2/29/08"; |
为设置Subject属性,请添加以下代码:
Visual Basic
Visual Basic |
拷贝代码
|
---|---|
Me.C1PrintDocument1.DocumentInfo.Subject = "Document Creation" |
C#
C# |
拷贝代码
|
---|---|
this.c1PrintDocument1.DocumentInfo.Subject = "Document Creation"; |
为设置Title属性,请添加以下代码:
Visual Basic
Visual Basic |
拷贝代码
|
---|---|
Me.C1PrintDocument1.DocumentInfo.Title = "Creating Documents with C1PrintPreview" |
C#
C# |
拷贝代码
|
---|---|
this.c1PrintDocument1.DocumentInfo.Title = "Creating Documents with C1PrintPreview"; |