File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -232,13 +232,21 @@ private static int FindAndMapHeaderRow(
232232 x => ! string . IsNullOrWhiteSpace ( x . NormalizedName ) )
233233 . Select ( x => x . NormalizedName ? . ToLowerInvariant ( ) ) !
234234 ) ;
235-
236- //find header row
237- var headerRow = usedArea
238- . Rows ( x => x . Cells ( )
239- . Any ( c => headerNames . Contains ( c . Value . ToString ( ) . ToLowerInvariant ( ) ) ) )
240- . FirstOrDefault ( ) ? . WorksheetRow ( ) ;
241235
236+ IXLRow ? headerRow ;
237+
238+ if ( rule . Row is not null && rule . Row > 0 )
239+ {
240+ headerRow = usedArea . Row ( rule . Row . Value ) . WorksheetRow ( ) ;
241+ }
242+ else
243+ {
244+ headerRow = usedArea
245+ . Rows ( x => x . Cells ( )
246+ . Any ( c => headerNames . Contains ( c . Value . ToString ( ) . ToLowerInvariant ( ) ) ) )
247+ . FirstOrDefault ( ) ? . WorksheetRow ( ) ;
248+ }
249+
242250 var headerRowId = headerRow ! . RowNumber ( ) ;
243251
244252 var propertiesByColumnName = instance . Properties . PropertyMappings . ToDictionary ( x => x . NormalizedName ) ;
You can’t perform that action at this time.
0 commit comments