You can customize the printing by setting the properties of a PrintInfo object and setting the PrintInfo property of a sheet to that object. The PrintInfo object has the settings for customizing the printing of a sheet.
The PrintInfo object provides the following properties for customizing the printing:
Property | Description |
---|---|
AbortMessage | Gets or sets the message to display for the abort dialog. See Displaying an Abort Message for the User. |
BestFitCols | Gets or sets whether column widths are adjusted to fit the longest string width for printing. See Optimizing the Printing Using Size. |
BestFitRows | Gets or sets whether row heights are adjusted to fit the tallest string height for printing. See Optimizing the Printing Using Size. |
Centering | Gets or sets whether to center the print out. See Customizing the Printed Page Layout. |
Colors | Gets or sets the list of colors that can be used in a custom header or footer text. See Customizing the Printed Page Header or Footer. |
ColStart and ColEnd | Used for printing a portion of the sheet. See Printing a Range of Cells on a Sheet. |
FirstPageNumber | Gets or sets the page number to print on the first page. See Customizing the Printed Page Layout. |
Footer | Used for providing footers on printed pages. See Customizing the Printed Page Header or Footer. |
Header | Used for providing headers on printed pages. See Customizing the Printed Page Header or Footer. |
Images | Gets or sets the list of images that can be used in a custom headers or footers. See Customizing the Printed Page Header or Footer. |
JobName | Gets or sets the name of the print job. See Customizing the Print Job Settings. |
Margin | Gets or sets the margins for printing. See Customizing the Printed Page Layout. |
Opacity | Gets or sets the opacity used when printing this sheet; this is used to print a watermark first and then the sheet contents. See Customizing the Printed Page Layout. |
Orientation | Gets or sets the page orientation used for printing. See Customizing the Print Job Settings. |
PageStart and PageEnd | Used for printing a page range. See Printing Particular Pages. |
PageOrder | Gets or sets the order in which pages print. See Customizing the Print Job Settings. |
PaperSize | Gets or sets the paper size to use. See Customizing the Print Job Settings. |
PaperSource | Gets or sets the paper source to use. See Customizing the Print Job Settings. |
Preview | Used to provide print preview. See Providing a Preview of the Printing. |
Printer | Gets or sets the name of the printer to use for printing. See Customizing the Print Job Settings. |
PrintNotes | Gets or sets whether to print the cell notes. See Printing a Sheet with Cell Notes. |
PrintShapes | Gets or sets whether to print floating objects. See Printing a Sheet with Shapes. |
PrintType | Gets or sets what is to be printed. See Printing Particular Pages. |
RepeatColStart and RepeatColEnd | Gets or sets whether to print the same set of columns on each page. See Customizing the Printed Page Header or Footer. |
RepeatRowStart and RepeatRowEnd | Gets or sets whether to print the same set of rows on each page. See Customizing the Printed Page Header or Footer. |
RowStart and RowEnd | Used for printing a portion of the sheet. See Printing a Range of Cells on a Sheet. |
ShowBorder | Gets or sets whether to print a border around the sheet. See Customizing the Printed Page Layout. |
ShowColor | Gets or sets whether to print the colors as they appear on the screen. See Customizing the Printed Page Layout. |
ShowColumnHeader and ShowRowHeader | Gets or sets whether to print the column headers and row headers. See Customizing the Printed Page Layout. |
ShowGrid | Gets or sets whether to print the sheet grid lines. See Customizing the Printed Page Layout. |
ShowPrintDialog | Gets or sets whether to display a print dialog before printing. See Displaying a Print Dialog for the User. |
ShowShadows | Gets or sets whether to print the header shadows. See Customizing the Printed Page Layout. |
SmartPrintPagesTall | Gets or sets how many pages tall to print. See Optimizing the Printing Using Rules. |
SmartPrintPagesWide | Gets or sets how many pages wide to print. See Optimizing the Printing Using Rules. |
SmartPrintRules | Used for setting up the rules for optimizing the printing. See Optimizing the Printing Using Rules. |
UseMax | Gets or sets whether to print only rows containing data. See Printing an Area of the Sheet. |
UseSmartPrint | Used for turning on the rules for optimizing the printing. See Optimizing the Printing Using Rules. |
ZoomFactor | Gets or sets the zoom factor used for printing this sheet. See Customizing the Printed Page Layout. |
Using the Properties Window
- At design time, in the Properties window, select the Spread component.
- Select the Sheets property.
- Click the button to display the SheetView Collection Editor.
- In the Members list, select the sheet for which to set the print options.
- In the properties list, double-click the PrintInfo property to display the settings for the PrintInfo class.
- Set the properties listed above as needed to set your print options.
- Click OK to close the editor.
Using a Shortcut
- Create and set properties for a PrintInfo object.
- Set the Sheet shortcut object PrintInfo property to the PrintInfo object you just created.
Example
This example code creates a PrintInfo object, sets properties to specify to not print grid lines or row headers, and to print only cells with data in them.
C# | Copy Code |
---|---|
// Create PrintInfo object and set properties. FarPoint.Win.Spread.PrintInfo printset = new FarPoint.Win.Spread.PrintInfo(); printset.ShowGrid = false; printset.ShowRowHeader = FarPoint.Win.Spread.PrintHeader.Hide; printset.UseMax = true; // Set the PrintInfo property for the first sheet. fpSpread1.Sheets[0].PrintInfo = printset; // Print the sheet. fpSpread1.PrintSheet(0); |
VB | Copy Code |
---|---|
' Create PrintInfo object and set properties. Dim printset As New FarPoint.Win.Spread.PrintInfo() printset.ShowGrid = False printset.ShowRowHeader = FarPoint.Win.Spread.PrintHeader.Hide printset.UseMax = True ' Set the PrintInfo property for the first sheet. FpSpread1.Sheets(0).PrintInfo = printset ' Print the sheet. FpSpread1.PrintSheet(0) |
Using Code
- Create and set properties for a PrintInfo object.
- Set the SheetView object PrintInfo property to the PrintInfo object you just created.
Example
This example code creates a PrintInfo object, sets properties to specify to not print grid lines or row headers, and to print only cells with data in them.
C# | Copy Code |
---|---|
// Create PrintInfo object and set properties. FarPoint.Win.Spread.PrintInfo printset = new FarPoint.Win.Spread.PrintInfo(); printset.ShowGrid = false; printset.ShowRowHeader = FarPoint.Win.Spread.PrintHeader.Hide; printset.UseMax = true; // Create SheetView object and assign it to the first sheet. FarPoint.Win.Spread.SheetView SheetToPrint = new FarPoint.Win.Spread.SheetView(); SheetToPrint.PrintInfo = printset; fpSpread1.Sheets[0] = SheetToPrint; // Print the sheet. fpSpread1.PrintSheet(0); |
VB | Copy Code |
---|---|
' Create PrintInfo object and set properties. Dim printset As New FarPoint.Win.Spread.PrintInfo() printset.ShowGrid = False printset.ShowRowHeader = FarPoint.Win.Spread.PrintHeader.Hide printset.UseMax = True ' Create SheetView object and assign it to the first sheet. Dim SheetToPrint As New FarPoint.Win.Spread.SheetView() SheetToPrint.PrintInfo = printset FpSpread1.Sheets(0) = SheetToPrint ' Print the sheet. FpSpread1.PrintSheet(0) |
Using the Spread Designer
- Select the sheet tab for the sheet for which you want to set print settings.
- Select the Page Layout option.
- Select the PrintTitles icon, choose General.
The Sheet Print dialog appears.
- Set the print options using the General, Output, Header/Footer, SmartPrint, Pagination, and Margins tab options.
- Click OK to close the Sheet Print Options dialog.
- From the File menu choose Apply and Exit to apply your changes to the component and exit Spread Designer.