Spread Windows Forms 6.0 Product Documentation
CopyFrom Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > PrintInfo Class : CopyFrom Method


o
PrintInfo object from which to copy properties

Glossary Item Box

Copies the properties of the specified PrintInfo object to the current PrintInfo object.

Syntax

Visual Basic (Declaration) 
Public Overridable Sub CopyFrom( _
   ByVal o As Object _
) 
Visual Basic (Usage)Copy Code
Dim instance As PrintInfo
Dim o As Object
 
instance.CopyFrom(o)
C# 
public virtual void CopyFrom( 
   object o
)

Parameters

o
PrintInfo object from which to copy properties

Example

C#Copy Code
FarPoint.Win.Spread.PrintInfo pi = new
FarPoint.Win.Spread.PrintInfo();
FarPoint.Win.Spread.PrintMargin pm = new
FarPoint.Win.Spread.PrintMargin();
FarPoint.Win.Spread.SmartPrintRulesCollection rules = new
FarPoint.Win.Spread.SmartPrintRulesCollection();
rules.Add(new FarPoint.Win.Spread.ScaleRule(FarPoint.Win.Spread.ResetOption.None, 1, 2, 0.5));
rules.Add(new FarPoint.Win.Spread.BestFitColumnRule(FarPoint.Win.Spread.ResetOption.None));
pm.Left = 10;
pm.Right = 10;
pm.Top = 20;
pm.Bottom = 40;
pi.AbortMessage = "Do you want to cancel printing??";
pi.BestFitCols = true;
pi.BestFitRows = true;
pi.ColEnd = 20;
pi.ColStart = 1;
pi.FirstPageNumber = 1;
pi.Footer = "This is Page /p/nof /pc Pages";
pi.Header = "Print Job For /nFPT Inc.";
pi.JobName = "New Print Job";
pi.Margin = pm;
pi.Orientation = FarPoint.Win.Spread.PrintOrientation.Portrait;
pi.PageEnd = 5;
pi.PageOrder = FarPoint.Win.Spread.PrintPageOrder.Auto;
pi.PageStart = 1;
pi.Preview = false;
pi.Printer = "HP6L";
pi.PrintType = FarPoint.Win.Spread.PrintType.CellRange;
pi.RowEnd = 20;
pi.RowStart = 1;
pi.ShowBorder = false;
pi.ShowColor = false;
pi.ShowColumnHeader = FarPoint.Win.Spread.PrintHeader.Hide;
pi.ShowGrid = true;
pi.ShowPrintDialog = true;
pi.ShowRowHeader = FarPoint.Win.Spread.PrintHeader.Hide;
pi.ShowShadows = false;
pi.SmartPrintRules = rules;
pi.UseMax = False;
pi.UseSmartPrint = true;
pi.ZoomFactor = 2;
FarPoint.Win.Spread.PrintInfo clone = new
FarPoint.Win.Spread.PrintInfo(pi);
obj o = new object;
o = pi;
clone.CopyFrom(o);
fpSpread1.ActiveSheet.PrintInfo = clone;
Visual BasicCopy Code
Dim pi As New FarPoint.Win.Spread.PrintInfo
Dim pm As New FarPoint.Win.Spread.PrintMargin
Dim rules As New FarPoint.Win.Spread.SmartPrintRulesCollection
rules.Add(New FarPoint.Win.Spread.ScaleRule(FarPoint.Win.Spread.ResetOption.None, 1, 2, 0.5))
rules.Add(New FarPoint.Win.Spread.BestFitColumnRule(FarPoint.Win.Spread.ResetOption.None))
pm.Left = 10
pm.Right = 10
pm.Top = 20
pm.Bottom = 40
pi.AbortMessage = "Do you want to cancel printing??"
pi.BestFitCols = True
pi.BestFitRows = True
pi.ColEnd = 20
pi.ColStart = 1
pi.FirstPageNumber = 1
pi.Footer = "This is Page /p/nof /pc Pages"
pi.Header = "Print Job For /nFPT Inc."
pi.JobName = "New Print Job"
pi.Margin = pm
pi.Orientation = FarPoint.Win.Spread.PrintOrientation.Portrait
pi.PageEnd = 5
pi.PageOrder = FarPoint.Win.Spread.PrintPageOrder.Auto
pi.PageStart = 1
pi.Preview = False
pi.Printer = "HP6L"
pi.PrintType = FarPoint.Win.Spread.PrintType.CellRange
pi.RowEnd = 20
pi.RowStart = 1
pi.ShowBorder = False
pi.ShowColor = False
pi.ShowColumnHeader = FarPoint.Win.Spread.PrintHeader.Hide
pi.ShowGrid = True
pi.ShowPrintDialog = True
pi.ShowRowHeader = FarPoint.Win.Spread.PrintHeader.Hide
pi.ShowShadows = False
pi.SmartPrintRules = rules
pi.UseMax = False
pi.UseSmartPrint = True
pi.ZoomFactor = 2
Dim clone As New FarPoint.Win.Spread.PrintInfo
Dim o As New Object
o = pi
clone.CopyFrom(o)
FpSpread1.ActiveSheet.PrintInfo = clone

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

PrintInfo Class
PrintInfo Members

User-Task Documentation

Printing

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.