FpSpreadsheet Sort limits? lazarus / 49-FPSpreadsheet ---------------------------------------------------------------------- straetch · 2026-04-06 16:00 I have a worksheet with 13076 rows and 12 columns. After a sort the worksheet only contains 11984 rows. The rows are in the expected sort order Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   sortParams := InitSortParams(true, 1);  // sorting along columns, 1 sorting key  sortParams.Keys[0].ColRowIndex := 0; // primary sorting key, ascending, case-insensitive  sortParams.Keys[0].Options := [ssoCaseInsensitive];  OutputWS.Sort(sortParams,0,0,OutputWS.GetLastOc cupiedRowIndex,OutputWS.GetLastOccupiedColIndex);  Are there limitations on the size of the worksheet for sorting? ---------------------------------------------------------------------- wp · 2026-04-06 17:51 Quote from: straetch on April 06, 2026, 06:00:38 pmI have a worksheet with 13076 rows and 12 columns. After a sort the worksheet only contains 11984 rows.  Are there limitations on the size of the worksheet for sorting? Nothing special (except for the size limitations of the output file formats, but your 13000 rows are still far away from the smallest rowcount of Excel 2.1, and xlsx allows even more than 1 million rows). Is your application 32bit, and you are running out of memory? In the attached project I am creating a spreadsheet with random strings in 50,000 rows and 50 columns (it will take some time...), and I am not seeing any loss of rows. ---------------------------------------------------------------------- straetch · 2026-04-08 07:39 Thank you for your response and the short demo. Sort is a solid function within the excellent FpSpreadsheet. The difference in number of rows: Sort eliminates empty rows. ---------------------------------------------------------------------- wp · 2026-04-08 07:53 Do you think there should be an option "Keep empty rows"? ---------------------------------------------------------------------- Zvoni · 2026-04-08 08:54 Quote from: straetch on April 08, 2026, 09:39:06 amThank you for your response and the short demo. Sort is a solid function within the excellent FpSpreadsheet. The difference in number of rows: Sort eliminates empty rows. *facepalm* sorting doesn't "eliminate" empty rows..... it sorts them where they belong: in ascending order they are sorted to the end and then you call GetLastOccupiedRowIndex Why should an Empty Row/Cell, which has been sorted to the end of the list, be considered in that function-call? Quote from: wp on April 08, 2026, 09:53:06 amDo you think there should be an option "Keep empty rows"? No. ---------------------------------------------------------------------- straetch · 2026-04-08 09:39 I see no need for an option "Keep empty rows" (meaning GetLastOccupiedRowIndex would include the empty rows?). The application programmer can take the current behavior into account. Proposal: just mention it in the documentation.