GrapeCity MultiRow Windows Forms Documentation
Printable Property (ColumnFooterSection)
Example 


Gets or sets a value that indicates whether this ColumnFooterSection is printable.
Syntax
<SRDescriptionAttribute("Indicates whether the ColumnFooterSection is printable.")>
<SRCategoryAttribute("Behavior")>
<BrowsableAttribute(True)>
<EditorBrowsableAttribute()>
Public Overrides Property Printable As Boolean
Dim instance As ColumnFooterSection
Dim value As Boolean
 
instance.Printable = value
 
value = instance.Printable
[SRDescription("Indicates whether the ColumnFooterSection is printable.")]
[SRCategory("Behavior")]
[Browsable(true)]
[EditorBrowsable()]
public override bool Printable {get; set;}

Property Value

true if printable; otherwise, false. The default is true.
Example
The following code example shows how to make a section that can be printed or not printed. For example, you can add two column headers to the template. One is used at run time. The visible property for that section should be true and the printable property should be false. Another can be used for printing since it may have page number information. That section's visible property value should be false and printable should be true. This code example is part of a larger example provided for the Section class.
void setPrintableButton_Click(object sender, EventArgs e)
        {
            Template template = Template.Default;

            Section displayHeaderSection = template.ColumnHeaders[0];

            ColumnHeaderSection printHeaderSection = new ColumnHeaderSection();

            printHeaderSection.Height = 40;

            // Initialize and add a PrintInfoCell into printHeaderSection.
            PrintInfoCell printInfoCell = new PrintInfoCell();

            printInfoCell.FormatString = "{PageNumber} of {PageCount}";

            printInfoCell.Size = new Size(template.Width, printHeaderSection.Height);

            printHeaderSection.Cells.Add(printInfoCell);

            template.ColumnHeaders.Add(printHeaderSection);

            // The section used for screen displayn.
            displayHeaderSection.Printable = false;
            displayHeaderSection.Visible = true;

            // The section used to display when printing.
            printHeaderSection.Visible = false;
            printHeaderSection.Printable = true;

            // Reload template
            this.gcMultiRow1.Template = template;
            this.gcMultiRow1.RowCount = 100;

            // Print column header in every page.
            this.gcMultiRow1.PrintSettings.PrintHeader = PrintHeader.AllPages;

            try
            {
                this.gcMultiRow1.PrintPreview();
            }
            catch(Exception ex)
            {
                // Can't find printer.
                MessageBox.Show(ex.Message);
            }
        }
Private Sub setPrintableButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles setPrintableButton.Click
        Dim template1 As Template = Template.Default

        Dim displayHeaderSection As Section = template1.ColumnHeaders(0)

        Dim printHeaderSection As New ColumnHeaderSection()

        printHeaderSection.Height = 40

        ' Initialize and add a PrintInfoCell into printHeaderSection.
        Dim printInfoCell As New PrintInfoCell()

        printInfoCell.FormatString = "{PageNumber} of {PageCount}"

        printInfoCell.Size = New Size(template1.Width, printHeaderSection.Height)

        printHeaderSection.Cells.Add(printInfoCell)

        template1.ColumnHeaders.Add(printHeaderSection)

        ' The section uses for screen display.
        displayHeaderSection.Printable = False
        displayHeaderSection.Visible = True

        ' The section used to display when printing.
        printHeaderSection.Visible = False
        printHeaderSection.Printable = True

        ' Reload template
        Me.gcMultiRow1.Template = template1
        Me.gcMultiRow1.RowCount = 100

        ' Print column header in every page.
        Me.gcMultiRow1.PrintSettings.PrintHeader = PrintHeader.AllPages

        Try
            Me.gcMultiRow1.PrintPreview()
        Catch ex As Exception
            ' Can't find printer.
            MessageBox.Show(ex.Message)
        End Try
    End Sub
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

ColumnFooterSection Class
ColumnFooterSection Members

 

 


Copyright © GrapeCity, inc. All rights reserved.