Spread Windows Forms 6.0 Product Documentation
Printing the Portion of the Sheet with Data
Support Options
Spread Windows Forms 6.0 Product Documentation > Developer's Guide > Managing Printing > Specifying What to Print > Printing the Portion of the Sheet with Data

Glossary Item Box

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 ends 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 have UseMax set to True to keep from printing rows of data that has no data. Then, you would need to programmatically put some 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.

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 Finding Rows or Columns That Have Data.

Return to the list for Specifying What to Print.

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.