Cross-Tab total condition

Stimulsoft Reports.NET discussion
Post Reply
mmayasmine
Posts: 8
Joined: Wed Sep 11, 2019 9:44 am

Cross-Tab total condition

Post by mmayasmine »

Hello,
I'm using the crosstab component like this attached in file Cross-Tab1.png
For the green cells I set the condition like attached in file Cross-Tab2.png
But i don’t kown how to do the same condition for the red cells wich are vertical and horizontal totals (i have to do this condition for the « S » totals only)
Thanks
Attachments
cross-tab
cross-tab
Cross-Tab2.png (54.83 KiB) Viewed 2172 times
condition
condition
Cross-Tab1.png (131.62 KiB) Viewed 2172 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Cross-Tab total condition

Post by HighAley »

Hello.

Please, select the Totals and set the Conditions there.
Totals.png
Totals.png (6.05 KiB) Viewed 2170 times
Thank you.
mmayasmine
Posts: 8
Joined: Wed Sep 11, 2019 9:44 am

Re: Cross-Tab total condition

Post by mmayasmine »

Hello,

when i set the conditions for the Total as you show me, it is applayed for all lines (E,Q,S) while I need it to be applayed only for the S Line
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: Cross-Tab total condition

Post by Lech Kulikowski »

Hello,

Unfortunately, there are no other ways.

You can try to use code in events:
https://stimulsoft.zendesk.com/hc/en-us ... -cross-tab

or use Cross-Data instead of Cross-Table.

Thank you.
mmayasmine
Posts: 8
Joined: Wed Sep 11, 2019 9:44 am

Re: Cross-Tab total condition

Post by mmayasmine »

Thank you

the issue is resolved by using the proccess cell event on Totals and the code below

if (e.Cell.SummaryIndex==2)
{
decimal value = 0;
if (e.Value is decimal)
{
value = ((decimal)(e.Value));
}

if ((value > 0))
{
((Stimulsoft.Report.Components.IStiBrush)(sender)).Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.LightGreen);
}
if ((value < 0))
{
((Stimulsoft.Report.Components.IStiBrush)(sender)).Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.MistyRose);
}
}
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: Cross-Tab total condition

Post by Lech Kulikowski »

Hello,

Thank you for the provided solution.
Post Reply