temp commit - hepl method
This commit is contained in:
parent
2023ea5221
commit
203c2498ac
@ -277,6 +277,7 @@ namespace Results.Output.Printers.OnePerMeter
|
||||
VertLines = TableLines.All
|
||||
};
|
||||
table = Table.Create_TestsAreRows(wm, (pageNr == 1) ? testItems : testItems2, style);
|
||||
table.CheckLastTableRowIfPossibleMerge(true, true);
|
||||
break;
|
||||
|
||||
case TableForm.Columns:
|
||||
|
||||
@ -309,6 +309,65 @@ namespace Results.Output
|
||||
return table;
|
||||
}
|
||||
|
||||
public void CheckLastTableRowIfPossibleMerge(bool mergeNegative, bool mergePositive)
|
||||
{
|
||||
|
||||
bool hasNegativeAll = true;
|
||||
bool hasPositiveAll = true;
|
||||
bool hasMixed = false;
|
||||
string lastRowText = null;
|
||||
|
||||
for (int rowIx = 0; rowIx < RowsCount; rowIx++)
|
||||
{
|
||||
string text = Cells[rowIx][ColumnsCount - 1].Text;
|
||||
if (mergeNegative)
|
||||
{
|
||||
if (text != "-")
|
||||
{
|
||||
hasNegativeAll = false;
|
||||
}
|
||||
|
||||
if (text != "+")
|
||||
{
|
||||
hasPositiveAll = false;
|
||||
}
|
||||
|
||||
if (!hasMixed)
|
||||
{
|
||||
if (lastRowText == null)
|
||||
{
|
||||
lastRowText = text;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lastRowText != text)
|
||||
{
|
||||
hasMixed = true;
|
||||
}
|
||||
|
||||
lastRowText = text;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (hasMixed)
|
||||
{
|
||||
//merge as negative
|
||||
} else if (hasPositiveAll)
|
||||
{
|
||||
//merge as positive
|
||||
}
|
||||
else if (hasNegativeAll)
|
||||
{
|
||||
//merge as negative
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a table where tests are in columns.
|
||||
/// Left column contains item (or row) captions.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user