[]
        
(Showing Draft Content)

Printing the Portion of the Sheet with Data

You may not want to print the entire sheet but only the portion of the sheet that has data. Use the UseMax method of the PrintInfo class to specify whether to print only rows and columns containing data or whether to print all the way to the end of the defined sheet, even if the rows and columns are empty.

If you want to print all of the columns (even if it does not have data in it) but only the rows with data, you would need to set UseMax to True to keep from printing rows without data. Then, you would need to programmatically put data in the last column and the last row with data, so the Spread prints all the columns. You could add a line of code similar to the following before calling the PrintSheet method.

fpSpread1.Sheets(0).Cells(fpSpread1.Sheets(0).GetLastNonEmptyRow(FarPoint.Win.Spread.NonEmptyItemFlag.Data), (fpSpread1.Sheets(0).ColumnCount - 1)).Value = ""
fpSpread1.Sheets[0].Cells[fpSpread1.Sheets[0].GetLastNonEmptyRow(FarPoint.Win.Spread.NonEmptyItemFlag.Data), fpSpread1.Sheets[0].ColumnCount - 1].Value = "";

For more information about methods involved with finding data, refer to Rows or Columns That Have Data.

See Also

Printing an Entire Sheet

Printing to PDF

Printing a Child View of a Hierarchical Display

Printing Particular Pages

Printing a Range of Cells on a Sheet

Printing an Area of the Sheet

Printing a Sheet with Cell Notes

Printing a Sheet with Shapes

Printing in Duplex Mode