Example #1
0
 /// <summary>
 /// Creates a new instance of <see cref="ExcelSheetReaderBase"/>.
 /// </summary>
 /// <param name="worksheetPart">The worksheet for which to create a dictionary</param>
 /// <param name="workbookPart">Thw workbook part of the workbook that contains this worksheet</param>
 /// <param name="column">"String indicating the column that contains keywords</param>
 protected ExcelSheetReaderBase(WorksheetPart worksheetPart, WorkbookPart workbookPart, string column)
 {
     this.workbookPart  = workbookPart;
     worksheet          = worksheetPart.Worksheet;
     MaxRow             = ExcelReaderHelper.GetMaxRow(worksheetPart);
     keywordsDictionary = ExcelReaderHelper.ReadKeywordsDictionary(worksheetPart, workbookPart, column, MaxRow);
 }
Example #2
0
 /// <summary>
 /// Gets the string value of a cell in the specified column at the specified row
 /// </summary>
 /// <param name="columnReference">The column reference.</param>
 /// <param name="rowId">The row id to get the cell value from.</param>
 /// <returns>The cell value as <see cref="string"/>.</returns>
 protected string GetCellValueAsString(string columnReference, int rowId)
 {
     return(ExcelReaderHelper.GetCellValueAsString(worksheet, columnReference + rowId, workbookPart));
 }
Example #3
0
 /// <summary>
 /// Gets the row number given a specific keyword (Column A)
 /// </summary>
 /// <param name="keyword">The keyword to get te row number for.</param>
 /// <returns>The row number that belongs to the key; or -1 when
 /// the key does not exist.</returns>
 protected int GetRowId(string keyword)
 {
     return(ExcelReaderHelper.GetRowId(keyword, keywordsDictionary));
 }