FarPoint.Win.Spread
BestFitRows Property
See Also  Example
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > PrintInfo Class : BestFitRows Property


Gets or sets whether row heights are adjusted to fit the tallest string height for printing.

Syntax

Visual Basic (Declaration) 
Public Property BestFitRows As Boolean
Visual Basic (Usage)Copy Code
Dim instance As PrintInfo
Dim value As Boolean
 
instance.BestFitRows = value
 
value = instance.BestFitRows
C# 
public bool BestFitRows {get; set;}

Return Value

Boolean: true to automatically adjust row heights; false otherwise

Example

This example shows how to define the settings for optimizing the printing.
C#Copy Code
// Typically you would use one type of optimization; they are all shown here for illustration only

// Define the printer settings for optimization
FarPoint.Win.Spread.PrintInfo printset = new FarPoint.Win.Spread.PrintInfo();
FarPoint.Win.Spread.SmartPrintRulesCollection prules =
new FarPoint.Win.Spread.SmartPrintRulesCollection();

// ... use best fit of columns and rows
printset.BestFitCols = true;
printset.BestFitRows = true;

// ... or check by page size
printset.SmartPrintPagesTall = 1;
printset.SmartPrintPagesWide = 1;

// ... or use the rules defined
prules.Add(new FarPoint.Win.Spread.BestFitColumnRule(FarPoint.Win.Spread.ResetOption.None));
prules.Add(
new FarPoint.Win.Spread.LandscapeRule(FarPoint.Win.Spread.ResetOption.Current));
prules.Add(
new FarPoint.Win.Spread.ScaleRule(FarPoint.Win.Spread.ResetOption.None, 1, 0.6, 0.1));
printset.SmartPrintRules = prules;
printset.UseSmartPrint = true;

// Assign the printer settings to the sheet and print it
fpSpread1.Sheets[0].PrintInfo = printset;
fpSpread1.PrintSheet(0);
Visual BasicCopy Code
' Typically you would use one type of optimization; they are all shown here for illustration only

' Define the printer settings for optimization
Dim printset As New FarPoint.Win.Spread.PrintInfo()
Dim prules As New FarPoint.Win.Spread.SmartPrintRulesCollection

' ... use best fit of columns and rows
printset.BestFitCols = True
printset.BestFitRows = True

' ... or check by page size
printset.SmartPrintPagesTall = 1
printset.SmartPrintPagesWide = 1

' ... or use the rules defined
prules.Add(New FarPoint.Win.Spread.BestFitColumnRule(FarPoint.Win.Spread.ResetOption.None))
prules.Add(New FarPoint.Win.Spread.LandscapeRule(FarPoint.Win.Spread.ResetOption.Current))
prules.Add(New FarPoint.Win.Spread.ScaleRule(FarPoint.Win.Spread.ResetOption.None, 1, 0.6, 0.1))
printset.SmartPrintRules = prules
printset.UseSmartPrint = True

' Assign the printer settings to the sheet and print it
FpSpread1.Sheets(0).PrintInfo = printset
FpSpread1.PrintSheet(0)

Remarks

This property sets the height of rows. To size the columns to the widest column width, use the BestFitCols property.

See Also