Is it possible to highlight max value in each column of cross-tab report?
So, only cell with Max value must be highlight in whole column.
BTW, I do need to calc totals for cross-tab, but not as "Sum" of each value in a column, but as "Max" value.
Unfortunately, I don't see built-in functionality for such a requirement.
I coped with it by this link
http://support.stimulsoft.com/index.php ... -cross-tab
But it seems to me, it would be better, if this functionality is built-in
Cross-tab - highligthing max value
Re: Cross-tab - highligthing max value
Hello,
Please checkthe sample report in teh attachment.
http://forumru.stimulsoft.com/viewtopic.php?f=8&t=3619
Thanky ou.
Please checkthe sample report in teh attachment.
http://forumru.stimulsoft.com/viewtopic.php?f=8&t=3619
Thanky ou.
- Attachments
-
- StandardCrossTabPercentByColumn.mrt
- (29.93 KiB) Downloaded 381 times
Re: Cross-tab - highligthing max value
Thank you for for suggestion, resulting code looks like:
Also you have to change report processing to double pass.
I don't see the way to accomplish this in 1-pass
Code: Select all
using System.Collections.Generic;
private Dictionary<int, decimal> _maximums = new Dictionary<int, decimal>();
private void AddValue(int row, decimal valueToAdd) {
if (_maximums.ContainsKey(row)) {
var existingValue = _maximums[row];
if (existingValue < valueToAdd) {
_maximums[row] = valueToAdd;
}
} else {
_maximums.Add(row, valueToAdd);
}
}
bool IsMaxValue(int colNum, decimal val)
{
if (_maximums.ContainsKey(colNum))
{
return val == _maximums[colNum];
}
return false;
}
public void CrossTab1_Sum1_ProcessCell(object sender, Stimulsoft.Report.CrossTab.StiProcessCellEventArgs e)
{
if (IsFirstPass)
{
AddValue(e.Column, e.Value);
}
else
{
if (IsMaxValue(e.Column, e.Value))
{
Stimulsoft.Report.Components.StiConditionHelper.ApplyFont(sender,
new System.Drawing.Font("Arial", 8.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 204),
Stimulsoft.Report.Components .StiConditionPermissions.All);
}
}
}
I don't see the way to accomplish this in 1-pass
Re: Cross-tab - highligthing max value
Hello,
Thank you for the information.
Let us know if you need any additional help.
Thank you.
Thank you for the information.
Let us know if you need any additional help.
Thank you.