Spread Windows Forms 9.0 Product Documentation
SetPrintPreview Method
Example 


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
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

FpSpread Class
FpSpread Members
PrintPreviewShowing Event
Preview Property

User-Task Documentation

Providing a Preview of the Printing

 

 


Copyright © GrapeCity, inc. All rights reserved.