Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.
Thu May 15, 2014 3:33 pm
I have a spreadsheet which has the data starting on row one. When I open the file it has the column names with the first row. Is there a way to tell it that the spreadsheet has its data starting on row 1 and it should have all the columns as column 1, column 2 ....
-
uwsgibbons
-
- Posts: 3
- Joined: Thu May 15, 2014 2:45 pm
Fri May 16, 2014 2:29 am
Hello,
Thanks for you inquiry.
Sorry that we don't quite understand your meaning. And there is a way to get the first row the data starts and the column for your reference.
- Code: Select all
Workbook book = new Workbook();
book.LoadFromFile("test.xlsx");
Worksheet sheet = book.Worksheets[0];
int i = sheet.FirstRow;
int j = sheet.FirstColumn;
int k = sheet.Columns.Length;
Please feel free to contact us if you have any problems.
Sincerely,
Gary
E-iceblue support team
-
Gary.zhang
-
- Posts: 1380
- Joined: Thu Apr 04, 2013 1:30 am
Wed May 21, 2014 2:32 pm
The issue I was having was that the column names of the spreadsheet wind up being the first row of the spreadsheet. When I exported to a data table the function errored out as it called the column names as the first row in the spreadsheet which caused duplicate column names which data tables don't like.
To get around this I just inserted a blank row so when I export it to a data table I will have standard column names.
-
uwsgibbons
-
- Posts: 3
- Joined: Thu May 15, 2014 2:45 pm
Thu May 22, 2014 1:47 am
Hello,
Thanks for your response.
Please proide us your document and codes for testing on our side, it would be helpful to reproduce the issue and work out the solution for you ASAP.
Thanks in advance,
Gary
E-iceblue support team
-
Gary.zhang
-
- Posts: 1380
- Joined: Thu Apr 04, 2013 1:30 am