aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Documents
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2020-08-12 14:06:48 +0300
committerAvi Levkovich <avi@twine-s.com>2020-08-12 14:06:48 +0300
commit31d4e06c66496a6604e4a878a0258874eeee7a9a (patch)
treeeba2b4d9d3458166308fc45ae2ea2c944b192b02 /Software/Visual_Studio/Tango.Documents
parente2c527adfc31e1a0f0b9585178a9535159a45593 (diff)
downloadTango-31d4e06c66496a6604e4a878a0258874eeee7a9a.tar.gz
Tango-31d4e06c66496a6604e4a878a0258874eeee7a9a.zip
merge
Diffstat (limited to 'Software/Visual_Studio/Tango.Documents')
-rw-r--r--Software/Visual_Studio/Tango.Documents/ExcelWriter.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Documents/ExcelWriter.cs b/Software/Visual_Studio/Tango.Documents/ExcelWriter.cs
index 2f1e4c29f..c344786e0 100644
--- a/Software/Visual_Studio/Tango.Documents/ExcelWriter.cs
+++ b/Software/Visual_Studio/Tango.Documents/ExcelWriter.cs
@@ -197,6 +197,27 @@ namespace Tango.Documents
return s;
}
+ /// <summary>
+ /// In case a sheet has a table with unknown rows update the size of the table . For example newRef="A1:B328" where 328 is count of rows table included header.
+ /// </summary>
+ /// <param name="sheetName">Name of the sheet.</param>
+ /// <param name="newRef">The new reference.</param>
+ public void UpdateTableSize( string sheetName, string newRef)
+ {
+ WorksheetPart work_sheet_part = GetWorkSheetPart(sheetName);
+ if (work_sheet_part.TableDefinitionParts != null)
+ {
+ TableDefinitionPart tableDefinitionPart = work_sheet_part.TableDefinitionParts.FirstOrDefault();
+ if (tableDefinitionPart == null)
+ return;
+ Table excelTable = tableDefinitionPart.Table;
+ if(excelTable != null)
+ {
+ excelTable.Reference = newRef;
+ }
+ }
+ }
+
public void Dispose()
{
_document.Save();