Thanks for the great library!
Thanks for the great library!
I am also seeing this issue. I can't upload the spreadsheet that I have because it contains company secrets, but if I use the Invoice xls that moorhs uploaded, I see the same thing.
Any news on this one.
I don't have time to debug this at the moment, so you can either wait until I do have time, or attempt to figure it out yourselves.
Good luck!
Sorry, I tried to reply directly to the email but Codeplex email often doesn't work in my experience.
Anyway, what row is missing? first? last? some other row?
Does the sheet have column headers?
Nice one
Sorry for the delay. Always when file is saved with open office in .xls the first row is missing. Saving the file to .xls with Excel 2007 or higher does no problems. One strange thing: when setting the IsFirstRowAsColumnNames = true, and open a xls saved with Open office I get the column names from the first row.
Thanks,
Boris
It looks like there is some issue with XlsBiffSST in the ReadStrings method. Using the attached spreadsheet, one of the strings ends up looking like this:
"˦\0\0\0Block B,4/F., Winful Industrial Building, 15-17 Tai Yip Street, Kwun Tong, Kowloon, Hong "
This means that the next string that is parsed ends up looking like this (truncated), which is actually several strings:
"\0\f\0\07\0\0\0\0\0\0\0\0\09\0\0\0\0Commercial Invoice for Naartjie Clothing ZA One (PTY) Ltd\0\f\0\07\0\0\0\0\0\0\0\0\0\b\0\0\0\0SUPPLIER\0\f\0\07\0\0\0\0\0\0\0\0\0\0\0\0\0TARGET EASE INTERNATIONAL LTD\0\f\0\07\0\0\0\0\0\0\0\0\0 \0\0\0\0Logwin Air & Ocean Hong Kong Ltd\0\f\0\07\0\0\0\0\0\0\0\0\02\0\f\0\0\0\0Address:Block B,4/F., Winful Industrial Building, \b\04\0\0\f\0\07\0\0\0\0\0\0\0\0\0o\0\f\0\0\0\0Address: Rm 1101,11/F., MTL Warehouse Bldg, Phase 1,Berth One, Container Port Road, Kwal Chung, N.T. Hong Kong\a\04\0\0\f\0\07\0\0\0\0\0\0\0\0\03\0\0\0\015-17 Tai Yip Street, Kwun Tong, Kowloon, Hong Kong\0\f\0\07\0\0\0\0\0\0\0\0\0\0\0\0\0GROUP\0\f\0\07\0\0\0\0\0\0\0\0\0\r\0\0\0\0CHILDREN WEAR\0\f\0\07\0\0\0\0\0\0\0\0\0\0\f\0\0\0\0Telephone: (852)27979785\t\04\0\0\f\0\07\0\0\0\0\0\0\0\0\0\0\f\0\0\0\0Telephone: (852) 27963783\t\04\0\0\f\0\07\0\0\0\0\0\0\0\0\0 \0\0\0\0FINAL DESTINATION - SOUTH AFRICA\0\f\0\07\0\0\0\0\0\0\0\0\0#\0\0\0\0Naartjie Clothing ZA One (PTY) Ltd.\0\f\0\07\0\0\0\0\0\0\0\0\0U\0\f\0\0\0\0Address: Pals Building, 95 Durham Avenue, Salt River, Cape Town, RSA, South Africa.\a\04\0\0\f\0\07\0\0\0\0\0\0\0\0\0\0\0\0\0Gender\0\f\0\07\0\0\0\0\0\0\0\0\0\0\0\0\0Age\0\f\0\07\0\0\0\0\0\0\0\0\0\0\0\0\0TICKET REPORT \0\f\0\07\0\0\0\0\0\0\0\0\0\0\0\0\0DESCRIPTION/ FABRIC CONTENT\0\f\0\07\0\0\0\0\0\0\0\0\0\0\0\0\0NAARTJIE P.O.# / STYLE #\0\f\0\07\0\0\0\0\0\0\0\0\0\0\0\0\0DETAIL DESCRIPTION\0\f\0\07\0\0\0\0\0\0\0\0\0\0\0\0\0WEIGHT PER UNIT (KG)\0\f\0\07\0\0\0\0\0\0\0\0\0\0\0\0\0TOTAL NET WEIGHT (KG)\0\f\0\07\0\0\0\0\0\0\0\0\0\0\0\0\0TOTAL GROSS WEIGHT (KG)\0\f\0\07\0\0\0\0\0\0\0\0\0\n\0\0\0\0TOTAL CTNS\0\f\0\07\0\0\0\0\0\0\0\0\0\0\0\0\0GIRLS\0\f\0\07\0\0\0\0\0\0\0\0\0\0\0\0\0KID\0\f\0\07\0\0\0\0\0\0\0\0\0\0\0\0\0PAIR\0\f\0\07\0\0\0\0\0\0\0\0\0^\0\f\0\0\0\0Address: Block A,Black River Park North 2 Fir Street,Observatory 7925,Cape Town, South Africa.\a\04\0\0\f\0\07\0\0\0\0\0\0\0\0\0\v\0\0\0\0TOTAL DOZEN\0\f\0\07\0\0\0\0\0\0\0\0\0\0\0\0\0TOTAL:\0\f\0\07\0\0\0\0\0\0\0\0\0\0\0\0\01) \0\f\0\07\0\0\0\0\0\0\0\0\0\0\0\0\0COUNTRY OF ORIGIN : \0\f\0\07\0\0\0\0\0\0\0\0\0\r\0\0\0\0MADE IN CHINA\0\f\0\07\0\0\0\0\0\0\0\0\0\0\0\0\0BANK DETAILS: \0\f\0\07\0\0\0\0\0\0\0\0\0\0\0\0\0WING HANG BANK LTD.\0\f\0\07\0\0\0\0\0\0\0\0\0a\0\0\0\0CASTLE PEAK ROAD BRANCH, SHOP NO. 2, 253-259 CASTLE PEAK ROAD, CHEUNG SHA WAN, KOWLOON, HONG KONG\0\f\0\07\0\0\0\0\0\0\0\0\0K\0\0\0\0ACCOUNT NAME: TARGET EASE INTERNATIONAL LIMITED, ACCOUNT NO. 821-353858-001\0\f\0\07\0\0\0\0\0\0\0\0\0\0\0\0\0MFY NAME & ADDRESS: \0\f\0\07\0\0\0\0\0\0\0\0\0\0\0\0\0GAOPENG SHOES FACTORY \0\f\0\07\0\0\0\0\0\0\0\0\0\0\0\0\04) \0\f\0\07\0\0\0\0\0\0\0\0\0C\0\0\0\0101 LOBAO TOWN,WAN CHUN RD,SHANSHUI,FOSHAN,GUANGDONG PROVINCE,CHINA\0\f\0\07\0\0\0\0\0\0\0\0\0\n\0\0\0\0MID CODE: \0\f\0\07\0\0\0\0\0\0\0\0\0\0\0\0\0CNGAOPEN101FOS\0\f\0\07\0\0\0\0\0\0\0\0\0\0\0\0\05) \0\f\0\07\0\0\0\0\0\0\0\0\0\r\0\0\0\0POSTAL CODE :\0\f\0\07\0\0\0\0\0\0\0\0\0\f\0\0\0\0TE-132-SA/13\0\f\0\07\0\0\0\0\0\0\0\0\0\0\0TAKKIES MESH KGÎ\0\0Canvas Mary Jane Mesh Bow woven canvas takkie with velcro for fastening over the feet, with rubber soles. Mesh bow and trim under bind trim, with eyelits on outside of takkie. Embroidery outside showing.\r\0\0\0\0GIRLS TAKKIES\0\f\08\07\0\0\0\0\0\0\0\0\0\0\0\0\0N/A\0\f\08\07\0\0\0\0\0\0\0\0\0\0\0\0\0GKA3130SPT14SA\0\f\08\07\0\0\0\0\0\0\0\0\0`\0\0\0\0TOTAL INVOICE VALUE: U.S. DOLLARS TEN THOUSAND SEVEN HUNDRED NINETY ONE AND CENTS SIXTY ONLY.***\0\f\0\07\0\0\0\0\0\0\0\0\0\0\0STORE NAME & NO\0\0BOX NO\0\0WEIGHT\0\0ALU\0\0Style\v\0\0Description\0\0Size\0\0Colour\t\0\0P6691S188\0\0Size 6\f\0\0PINK. MUFFIN\t\0\0P6691S189\0\0Size 7\t\0\0P6691S190\0\0Size 8\t\0\0P6691S191\0\0Size 9\t\0\0P6691S192\a\0\0Size 10\t\0\0P6691S193\a\0\0Size 11\t\0\0P6691S194\a\0\0Size 12\t\0\0P6691S195\a\0\0Size 13\t\0\0P6691S196\0\0Size 1\t\0\0P6691S197\0\0Size 2\n\0\0\0\0WATERFRONT\0\f\08\07\0\0\0\0\0\0\0\0\0\a\0\0\0\0EWS 130\0\f\08\07\0\0\0\0\0\0\0\0\0\b\0\0\0\08.37 KGS\0\f\08\07\0\0\0\0\0\0\0\0\0\0\0\0\0GKA3130SPT14SA\0\f\08\07\0\0\0\0\0\0\0\0\0\a\0\0\0\0EWS 131\0\f\08\07\0\0\0\0\0\0\0\0\0\a\0\0\0\0EWS 132\0\f\08\07\0\0\0\0\0\0\0\0\0\a\0\0\0\0EWS 133\0\f\08\07\0\0\0\0\0\0\0\0\0\t\0\0\0\0PAVILLION\0\f\08\07\0\0\0\0\0\0\0\0\0\a\0\0\0\0EWS 134\0\f\08\07\0\0\0\0\0\0\0\0\0\a\0\0\0\0EWS 135\0\f\08\07\0\0\0\0\0\0\0\0\0\a\0\0\0\0SANDTON\0\f\08\07\0\0\0\0\0\0\0\0\0\a\0\0\0\0EWS 136\0\f\08\07\0\0\0\0\0\0\0\0\0\a\0\0\0\0EWS 137\0\f\08\07\0\0\0\0\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0\0\0\0\0\0\0\a\0\0\0\0EWT 189\0\f\08\07\0\0\0\0\0\0\0\0\0%\0\0Naartjie Kids - STORE NUMBER LISTING\n\0\0STORE NAME\0\0NUMBER\t\0\0ATTERBURY\0\008\v\0\0BEDFORDVIEW\0\024\n\0\0BLUE ROUTE\0\026\n\0\0CANAL WALK\0\010\t\0\0CAVENDISH\0\005\n\0\0CLEARWATER\0\021\0\0CRESTA\0\012\b\0\0EASTGATE\0\004\v\0\0EPSOM DOWNS\0\009\0\0GARDEN ROUTE MALL\0\023\a\0\0GATEWAY\0\013\b\0\0HOUT BAY\0\006\0\0ILANGA\0\022\0\0IRENE\0\020\b\0\0LA LUCIA\0\019\0\0MALL OF THE NORTH\0\025\0\0MENLYN\0\011\v\0\0MORNINGSIDE\0\018\t\0\0NICHOLWAY\0\028\0\0ONLINE / WEBSTORE\0\027\t\0\0PAVILLION\0\002\a\0\0SANDTON\0\003\r\0\0SOMERSET MALL\0\015\v\0\0TYGERVALLEY\0\017\0\0V&A
I suppose that this file was created with Excel 2007 (saved as Excel Workbook). I have the same problem. When i Opened this file in 2010 and saved it, everything passed. Any new on this one?
This particular file fails in ICSharpCode.SharpZipLib with this error
"Size mismatch between central header(587) and local header(0)" so I'm not sure whether it is a problem with the file itself or SharpZipLib. I don't have time to do any further investigation right now, but if you wanted to raise it with developers in the zip library that would be much appreciated.
Yes I've got the same problem it was zip library ICSharpCode.SharpZiplib. I will move this one there if it is OK with Maxplod...?
Thanks jerome raffalli. I got this bug when saving the file with open office.
There is indeed a bug that drops the first row of Open Office .xls files when column names are NOT read from the first row.
The problem is in the method readWholeWorkSheetNoIndex() in ExcelBinaryReader.cs, where
"justAddedColumns = true;" is in the wrong spot. It needs to be moved from right after "triggerCreateColumns = false;" to right after the first for loop since it is only relevant if the first row consist of column names. The method with the fix is shown below.
private void readWholeWorkSheetNoIndex(bool triggerCreateColumns, DataTable table)
{
while (Read())
{
if (m_depth == m_maxRow) break;
bool justAddedColumns = false;
//DataTable columns
if (triggerCreateColumns)
{
if (_isFirstRowAsColumnNames || (_isFirstRowAsColumnNames && m_maxRow == 1))
{
for (int i = 0; i < m_maxCol; i++)
{
if (m_cellsValues[i] != null && m_cellsValues[i].ToString().Length > 0)
Helpers.AddColumnHandleDuplicate(table, m_cellsValues[i].ToString());
else
Helpers.AddColumnHandleDuplicate(table, string.Concat(COLUMN, i));
}
justAddedColumns = true;
}
else
{
for (int i = 0; i < m_maxCol; i++)
{
table.Columns.Add(null, typeof(Object));
}
}
triggerCreateColumns = false;
table.BeginLoadData();
}
if (!justAddedColumns && m_depth > 0 && !(_isFirstRowAsColumnNames && m_maxRow == 1))
{
table.Rows.Add(m_cellsValues);
}
}
if (m_depth > 0 && !(_isFirstRowAsColumnNames && m_maxRow == 1))
{
table.Rows.Add(m_cellsValues);
}
}
Thanks, this was also detected earlyer in this issue
https://exceldatareader.codeplex.com/workitem/1264
Thanks to everyone
DataRow data = result.Tables[0].Rows[i];
System.Diagnostics.Debug.Write(data.Table.Rows[i]["Amortization"]);
Then access a Table within that row and rows within that table. I have tried string val = data[1].ToString();
and that works. string nval = data["Title"].ToString();
Also worksFor some reason I can not create pull request for this project.
Please introduce double-check logic like this:
https://gist.github.com/tripolitov/99ea3431437080cf8c63
```
public static ILog Log(string objectName)
{
ILog result = null;
if (_dictionary.ContainsKey(objectName))
result = _dictionary[objectName];
if (result == null)
{
lock (_sync)
{
if (_dictionary.ContainsKey(objectName))
{
result = _dictionary[objectName];
}
else
{
result = Excel.Log.Log.GetLoggerFor(objectName);
_dictionary.Add(objectName, result);
}
result = _dictionary[objectName];
}
}
return result;
}
```