0

I use spreadsheetgear.

  1. I want to check how many HPageBreaks in my worksheet.
  2. I want to check the row content PageBreak.

How could I do that. I have tried the following code but something went wrong

SpreadsheetGear.IWorkbook wb = wbvMain.ActiveWorkbook;
IWorksheet wsPo4Printing = wb.Worksheets["Testing"];
pageCount = wsPo4Printing.HPageBreaks.Count;

The pageCount always return 0 even I have many data on this worksheet.

Thanks,

LVD

Duyet Le
  • 1
  • 1

1 Answers1

0

I assume you are looking for a pageCount based on natural or Automatic page breaks. The IWorksheet.HPageBreaks/VPageBreaks collections only take into account Manual page breaks--not Automatic--and so would return 0 if no Manual page breaks were present in the worksheet.

SpreadsheetGear 2012 does not support determining where Automatic page breaks will occur. Automatic breaks are not determined until you begin printing, then they are discarded after the print job completes, so there's really no way for SpreadsheetGear to give you this information, unfortunately.

Tim Andersen
  • 3,014
  • 1
  • 15
  • 11