Spread Windows Forms 13.0 Product Documentation
FarPoint.Win.Spread Assembly / FarPoint.Win.Spread Namespace / PrintInfo Class / UseMax Property
Example


In This Topic
    UseMax Property
    In This Topic
    Gets or sets whether to print only rows that contain data.
    Syntax
    'Declaration
     
    Public Property UseMax As Boolean
    'Usage
     
    Dim instance As PrintInfo
    Dim value As Boolean
     
    instance.UseMax = value
     
    value = instance.UseMax
    public bool UseMax {get; set;}

    Property Value

    Boolean: true to print only columns and rows up to the maximum; false to ignore the maximum limit
    Remarks

    Setting this property to true often saves time and paper. When this property is set to true, empty cells beyond the columns and rows containing data are not printed. When this property is set to false, what is printed is determined by the setting of the PrintType property.

    This property can override the PrintType property. For example, if you set the Spread component to print columns 0 through 10 and rows 0 through 100, but there is only data in columns 0 through 5 and rows 0 through 50 and the UseMax property is set to true, only columns 0 through 5 and rows 0 through 50 are printed.

    Example
    This example shows how to specify that only part of the sheet prints.
    // Typically, not all of these settings are used together but are included here for illustration purposes
    
    // Create the printer settings object
    FarPoint.Win.Spread.PrintInfo printset = new FarPoint.Win.Spread.PrintInfo(); 
    
    // Allow printing of only 20 columns and 20 rows of cells
    printset.ColStart = 1;
    printset.ColEnd = 20;
    printset.RowStart = 1;
    printset.RowEnd = 20;
    printset.PrintType = FarPoint.Win.Spread.PrintType.CellRange;
    
    // Allow printing of only five pages
    printset.PageStart = 1;
    printset.PageEnd = 5;
    
    // Allow printing of the cell notes together at the end
    printset.PrintNotes = FarPoint.Win.Spread.PrintNotes.AtEnd;
    
    // Allow printing of the shapes
    printset.PrintShapes = true;
    
    // Allow printing of only rows and columns up to the last ones with data 
    printset.UseMax = True;
    
    // Assign the printer settings to the sheet and print it
    fpSpread1.Sheets[0].PrintInfo = printset; 
    fpSpread1.PrintSheet(0);
    ' Typically, not all of these settings are used together but are included here for illustration purposes
    
    ' Create the printer settings object
    Dim printset As New FarPoint.Win.Spread.PrintInfo
    
    ' Allow printing of only 20 columns and 20 rows of cells
    printset.ColEnd = 20
    printset.ColStart = 1
    printset.RowStart = 1
    printset.RowEnd = 20
    printset.PrintType = FarPoint.Win.Spread.PrintType.CellRange
    
    ' Allow printing of only five pages
    printset.PageStart = 1
    printset.PageEnd = 5
    
    ' Allow printing of the cell notes together at the end
    printset.PrintNotes = FarPoint.Win.Spread.PrintNotes.AtEnd
    
    ' Allow printing of the shapes
    printset.PrintShapes = True
    
    ' Allow printing of only rows and columns up to the last ones with data 
    printset.UseMax = true
    
    ' Assign the printer settings to the sheet and print it
    FpSpread1.Sheets(0).PrintInfo = printset
    FpSpread1.PrintSheet(0)
    See Also