Reports for WinForms | ComponentOne
In This Topic
    Setting Document Information
    In This Topic

    To set the document information, enter values in the Author, Comment, Company, CreationTime, Creator, Keywords, Manager, Operator, Producer, RevisionTime, Subject, and Title properties either in the designer or in code.

    In the Designer

    1. In the C1PrintDocument Properties window, locate the DocumentInfo property and expand the property node.
          
    2. Enter values and press ENTER when finished to set the property.
      Note: Some properties have built-in editors to help you set the property, such as:

      Clicking the ellipsis button next to the Keywords property opens the String Collection Editor, where you can enter keywords for the document.

      Clicking the drop-down arrow next to the CreationTime or RevisionTime properties allows you to choose a date.

      The default value for the Creator property is ComponentOne Document Engine.

    In Code

    The following code should be added to the Form_Load event.

    To set the Author property, add the following code:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Me.C1PrintDocument1.DocumentInfo.Author = "Jane Doe"
    

    To write code in C#

    C#
    Copy Code
    this.c1PrintDocument1.DocumentInfo.Author = "Jane Doe";
    

    To set the Comment property, add the following code:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Me.C1PrintDocument1.DocumentInfo.Comment = "This is a C1PrintDocument file."
    

    To write code in C#

    C#
    Copy Code
    this.c1PrintDocument1.DocumentInfo.Comment = "This is a C1PrintDocument file.";
    

    To set the Company property, add the following code:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Me.C1PrintDocument1.DocumentInfo.Company = "ComponentOne"
    

    To write code in C#

    C#
    Copy Code
    this.c1PrintDocument1.DocumentInfo.Company = "ComponentOne";
    

    To set the CreationTime property, add the following code:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Me.C1PrintDocument1.DocumentInfo.CreationTime = "2/29/08"
    

    To write code in C#

    C#
    Copy Code
    this.c1PrintDocument1.DocumentInfo.CreationTime = "2/29/08";
    

    To set the Creator property, add the following code. The default value is ComponentOne Document Engine.

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Me.C1PrintDocument1.DocumentInfo.Creator = "C1PrintPreview"
    

    To write code in C#

    C#
    Copy Code
    this.c1PrintDocument1.DocumentInfo.Creator = "C1PrintPreview";
    

    To set the Keywords property, add the following code. Keywords should be separated with a space.

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Me.C1PrintDocument1.DocumentInfo.Keywords = New String() {"C1PrintPreview ComponentOne C1PrintDocument"}
    

    To write code in C#

    C#
    Copy Code
    this.c1PrintDocument1.DocumentInfo.Keywords = new string() {"C1PrintPreview ComponentOne C1PrintDocument"};
    

    To set the property, add the following code:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Me.C1PrintDocument1.DocumentInfo.Manager = "John Smith"
    

    To write code in C#

    C#
    Copy Code
    this.c1PrintDocument1.DocumentInfo.Manager = "John Smith";
    

    To set the Operator property, add the following code:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Me.C1PrintDocument1.DocumentInfo.Operator = "Joe Brown"
    

    To write code in C#

    C#
    Copy Code
    this.c1PrintDocument1.DocumentInfo.Operator = "Joe Brown";
    

    To set the Producer property, add the following code:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Me.C1PrintDocument1.DocumentInfo.Producer = "ComponentOne Preview for .NET"
    

    To write code in C#

    C#
    Copy Code
    this.c1PrintDocument1.DocumentInfo.Producer = "ComponentOne Preview for .NET";
    

    To set the RevisionTime property, add the following code:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Me.C1PrintDocument1.DocumentInfo.RevisionTime = "2/29/08"
    

    To write code in C#

    C#
    Copy Code
    this.c1PrintDocument1.DocumentInfo.RevisionTime = "2/29/08";
    

    To set the Subject property, add the following code:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Me.C1PrintDocument1.DocumentInfo.Subject = "Document Creation"
    

    To write code in C#

    C#
    Copy Code
    this.c1PrintDocument1.DocumentInfo.Subject = "Document Creation";
    

    To set the Title property, add the following code:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Me.C1PrintDocument1.DocumentInfo.Title = "Creating Documents with C1PrintPreview"
    

    To write code in C#

    C#
    Copy Code
    this.c1PrintDocument1.DocumentInfo.Title = "Creating Documents with C1PrintPreview";