c# Programming, removing rows and sorting problems

Java, C++, C#, Delphi... - Using the UNO bridges
Post Reply
stobi_de
Posts: 1
Joined: Thu Jan 22, 2015 10:31 am

c# Programming, removing rows and sorting problems

Post by stobi_de »

Hello,
I do not know, how to delete rows or sort a sheet using c#.
I have access to the cells, but something is missing (maybe only in my head :D )

I tried this
XSpreadsheet oSheet;
XCellRange oCellRange;
oCellRange = oSheet.getCellRangeByPosition(0, i, 255, 1);
oCellRange.Delete () - this or similar is not existing !!

Thanks

frank
Libre Office 4.3 and Win 7 / 64
User avatar
karolus
Volunteer
Posts: 1160
Joined: Sat Jul 02, 2011 9:47 am

Re: c# Programming, removing rows and sorting problems

Post by karolus »

Hallo

The quality of answers depends on quality of the question, not on quantity....

Karolus
AOO4, Libreoffice 6.1 on Rasbian OS (on ARM)
Libreoffice 7.4 on Debian 12 (Bookworm) (on RaspberryPI4)
Libreoffice 7.6 flatpak on Debian 12 (Bookworm) (on RaspberryPI4)
User avatar
RoryOF
Moderator
Posts: 34616
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: c# Programming, removing rows and sorting problems

Post by RoryOF »

This topic may help
viewtopic.php?f=9&t=2562
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
MTP
Volunteer
Posts: 1620
Joined: Mon Sep 10, 2012 7:31 pm
Location: Midwest USA

Re: c# Programming, removing rows and sorting problems

Post by MTP »

If you want to actually remove the rows (and not just clear the contents), you need to obtain the Rows object from the Spreadsheet object, then

Code: Select all

oRows.removeByIndex(i,j)
Where i = The index of the first row to be removed
j = number of rows to remove
OpenOffice 4.1.1 on Windows 10, HSQLDB 1.8 split database
Post Reply