Spread Windows Forms 9.0 Product Documentation
SmartPrintRules Property
Example 


Gets or sets the collection of rules to optimize the printing.
Syntax
'Declaration
 
Public Property SmartPrintRules As SmartPrintRulesCollection
'Usage
 
Dim instance As PrintInfo
Dim value As SmartPrintRulesCollection
 
instance.SmartPrintRules = value
 
value = instance.SmartPrintRules
public SmartPrintRulesCollection SmartPrintRules {get; set;}

Property Value

SmartPrintRulesCollection object containing the collection of optimum printing rules
Remarks

The SmartPrintRulesCollection provides a set of rules that contains the following objects:

Together, these rules dictate how Spread tries to fit the sheet onto printed pages. You can change the properties for these objects by setting the objects' properties.

By default, these optimum printing rules provide the following behavior:

For more information about optimum printing, refer to Optimizing Printing.

Example
This example shows how to define the settings for optimizing the printing.
// 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);
' 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)
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10

See Also

Reference

PrintInfo Class
PrintInfo Members
BestFitColumnRule Class
LandscapeRule Class
ScaleRule Class
SmartPrintRuleCollection Class
SmartPrintRule Class

User-Task Documentation

Optimizing the Printing

 

 


Copyright © GrapeCity, inc. All rights reserved.