Spread Windows Forms 11.0 Product Documentation
SetPrintPreview Method
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > FpSpread Class : SetPrintPreview Method
Print preview dialog
Sets the print preview dialog.
Syntax
'Declaration
 
Public Overridable Sub SetPrintPreview( _
   ByVal dialog As PrintPreviewDialog _
) 
'Usage
 
Dim instance As FpSpread
Dim dialog As PrintPreviewDialog
 
instance.SetPrintPreview(dialog)
public virtual void SetPrintPreview( 
   PrintPreviewDialog dialog
)

Parameters

dialog
Print preview dialog
Example
This example uses the SetPrintPreview method.
private void Form1_Load(object sender, EventArgs e)
{
fpSpread1.Sheets.Count = 3;
fpSpread1.Sheets[0].RowCount = 10;
fpSpread1.Sheets[0].ColumnCount = 10;
fpSpread1.Sheets[1].RowCount = 10;
fpSpread1.Sheets[1].ColumnCount = 10;
fpSpread1.Sheets[2].RowCount = 10;
fpSpread1.Sheets[2].ColumnCount = 10;
fpSpread1.Sheets[0].SetClip(0, 0, 3, 3, "Sunday\tMonday\tTuesday\r\nWednesday\tThursday\tFriday\r\nSaturday\tSunday\tMonday");
fpSpread1.Sheets[1].SetClip(0, 0, 3, 3, "January\tFebruary\tMarch\r\nApril\tMay\tJune\r\nJuly\tAugust\tSeptember");
fpSpread1.Sheets[2].SetClip(0, 0, 3, 3, "2012\t2013\t2014\r\n2015\t2016\t2017\r\n2018\t2019\t2020");
}
         
private void button1_Click(object sender, EventArgs e)
{
PrintPreviewDialog pi = new PrintPreviewDialog();
pi.BackColor = Color.Cyan;
pi.ForeColor = Color.Red;
pi.Text = "My preview dialog";  
fpSpread1.SetPrintPreview(pi);
fpSpread1.ActiveSheet.PrintInfo.Preview = true;
fpSpread1.ActiveSheet.PrintInfo.ZoomFactor = 0.75f;
fpSpread1.PrintSheet(fpSpread1.ActiveSheet);
}
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
fpSpread1.Sheets.Count = 3
fpSpread1.Sheets(0).RowCount = 10
fpSpread1.Sheets(0).ColumnCount = 10
fpSpread1.Sheets(1).RowCount = 10
fpSpread1.Sheets(1).ColumnCount = 10
fpSpread1.Sheets(2).RowCount = 10
fpSpread1.Sheets(2).ColumnCount = 10
fpSpread1.Sheets(0).SetClip(0, 0, 3, 3, "Sunday" + vbTab + "Monday" + vbTab + "Tuesday" + vbCrLf + "Wednesday" + vbTab + "Thursday" + vbTab + "Friday" + vbCrLf + "Saturday" + vbTab + "Sunday" + vbTab + "Monday")
fpSpread1.Sheets(1).SetClip(0, 0, 3, 3, "January" + vbTab + "February" + vbTab + "March" + vbCrLf + "April" + vbTab + "May" + vbTab + "June" + vbCrLf + "July" + vbTab + "August" + vbTab + "September")
fpSpread1.Sheets(2).SetClip(0, 0, 3, 3, "2012" + vbTab + "2013" + vbTab + "2014" + vbCrLf + "2015" + vbTab + "2016" + vbTab + "2017" + vbCrLf + "2018" + vbTab + "2019" + vbTab + "2020")
End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim pi As New PrintPreviewDialog()
pi.BackColor = Color.Cyan
pi.ForeColor = Color.Red
pi.Text = "My preview dialog"
fpSpread1.SetPrintPreview(pi)
fpSpread1.ActiveSheet.PrintInfo.Preview = True
fpSpread1.ActiveSheet.PrintInfo.ZoomFactor = 0.75F
fpSpread1.PrintSheet(FpSpread1.ActiveSheet)
End Sub
See Also

Reference

FpSpread Class
FpSpread Members
PrintPreviewShowing Event
Preview Property

User-Task Documentation

Providing a Preview of the Printing