Fix filling filtered table
This commit is contained in:
parent
f570dd9a2d
commit
8c134644ba
@ -38,6 +38,8 @@ namespace RhSolutions.Services
|
|||||||
$"Целевой файл {_application.ActiveWorkbook.Name} не является прайс-листом.");
|
$"Целевой файл {_application.ActiveWorkbook.Name} не является прайс-листом.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ShowFilteredData();
|
||||||
|
|
||||||
_amountCell = _worksheet.Cells.Find(_headers["Amount"]);
|
_amountCell = _worksheet.Cells.Find(_headers["Amount"]);
|
||||||
_skuCell = _worksheet.Cells.Find(_headers["Sku"]);
|
_skuCell = _worksheet.Cells.Find(_headers["Sku"]);
|
||||||
_programLineCell = _worksheet.Cells.Find(_headers["ProductLine"]);
|
_programLineCell = _worksheet.Cells.Find(_headers["ProductLine"]);
|
||||||
@ -186,6 +188,8 @@ namespace RhSolutions.Services
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void FilterByAmount()
|
private void FilterByAmount()
|
||||||
|
{
|
||||||
|
if (_worksheet.AutoFilterMode)
|
||||||
{
|
{
|
||||||
AutoFilter filter = _worksheet.AutoFilter;
|
AutoFilter filter = _worksheet.AutoFilter;
|
||||||
int startColumn = filter.Range.Column;
|
int startColumn = filter.Range.Column;
|
||||||
@ -193,6 +197,16 @@ namespace RhSolutions.Services
|
|||||||
filter.Range.AutoFilter(_amountCell.Column - startColumn + 1, "<>0", XlAutoFilterOperator.xlAnd, "<>");
|
filter.Range.AutoFilter(_amountCell.Column - startColumn + 1, "<>0", XlAutoFilterOperator.xlAnd, "<>");
|
||||||
_worksheet.Range["A1"].Activate();
|
_worksheet.Range["A1"].Activate();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ShowFilteredData()
|
||||||
|
{
|
||||||
|
if (_worksheet.AutoFilterMode)
|
||||||
|
{
|
||||||
|
AutoFilter filter = _worksheet.AutoFilter;
|
||||||
|
filter.ShowAllData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private int? GetPositionRow(Range range, ProductSku sku, string productLine, bool justArticle = false)
|
private int? GetPositionRow(Range range, ProductSku sku, string productLine, bool justArticle = false)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user