waleskim / linqtoexcel

Automatically exported from code.google.com/p/linqtoexcel
0 stars 0 forks source link

Localized Excel files -default sheet names #9

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, I'm working with Hungarian Excel files, which does not name worksheets as 
'Sheet1', 'Sheet2'... but uses 'Munka1', 'Munka2'... as the automatic ID.

I'm getting imports from English and Hungarian builds as well, so 'Sheet1' 
and 'Munka1' gets mixed. I'm always asking the people to rename the sheets to  
'ProjectX', but they keep forget it.
(I'm attaching a Hungarian-native Excel)

Is there any workaround to get the first (native-independent) sheet?

Thanks,

b.

Original issue reported on code.google.com by kardosba...@gmail.com on 2 Nov 2009 at 2:32

Attachments:

GoogleCodeExporter commented 9 years ago
If a worksheet name is not specified, then 'Sheet1' is used for the name. 
Unfortunately there is not a workaround to get the first (native-independent) 
worksheet. It will be up to your application to determine the worksheet name 
and 
manually set it. The example below shows how to manually set the worksheet name 
to 'Munka1'

var repo = new ExcelQueryFactory("excelFileName");
var companies = from c in repo.Worksheet<Company>("Munka1")
                select c;

Original comment by paulyo...@gmail.com on 3 Nov 2009 at 7:11