You can customize the Print Preview settings to show the Print Preview Dialog like Excel by using the EnhancePreview property of the PrintInfo class.
The following image shows the printing options that appear on your screen after setting the EnhancePreview property to true.
Set the EnhancePreview property of the PrintInfo class to true in order to customize the print preview setting to show the Print Preview Dialog like excel.
This example shows how to set the EnhancePreview property.
C# |
Copy Code
|
---|---|
//Code to show print preview dialog like excel fpSpread1.ActiveSheet.Cells[1, 1].Value = "1,1"; fpSpread1.ActiveSheet.Cells[10, 10].Value = "10,10"; fpSpread1.ActiveSheet.PrintInfo.EnhancePreview = true; fpSpread1.PrintSheet(fpSpread1.ActiveSheet); |
VB |
Copy Code
|
---|---|
'Code to show print preview dialog like excel fpSpread1.ActiveSheet.Cells(1, 1).Value = "1,1" fpSpread1.ActiveSheet.Cells(10, 10).Value = "10,10" fpSpread1.ActiveSheet.PrintInfo.EnhancePreview = True fpSpread1.PrintSheet(fpSpread1.ActiveSheet) |