Alternate row style

Stimulsoft Reports.WEB discussion
Post Reply
victorinable
Posts: 152
Joined: Mon Aug 03, 2015 9:28 am

Alternate row style

Post by victorinable »

Hi,

I've made a report whic uses a Cross-tab directly on page, as a Summary of a list. I would like to know how can I apply alternate design to each row. I mean, [row1-->white, row2-->blue, row3-->white, row4-->blue...].

Thanks for any hint.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Alternate row style

Post by HighAley »

Hello.

You could use conditions to highlight the necessary row. But it's possible to check values of Columns and Rows like in next expression:

Code: Select all

(sender as StiCrossSummary).CrossColumnValue == "4"
(sender as StiCrossSummary).CrossRowValue == "ANTON"
You could add as many Conditions as you need.

Thank you.
victorinable
Posts: 152
Joined: Mon Aug 03, 2015 9:28 am

Re: Alternate row style

Post by victorinable »

Hi Aleksey,

Thanks for the reply, it seems it's alm,ost what I want. Can I do something like:

Code: Select all


i=(sender as StiCrossSummary).LineNumber

if(i %2==0) {
(sender as StiCrossSummary).row(i).color = #b0b0b0 
}else{
(sender as StiCrossSummary).row(i).color = #000000)
}



Thanks in advance
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Alternate row style

Post by HighAley »

Hello, Victor.

If you just need to change background of odd and even lines of the Cross-tab, you can to set the background of the Summary to one color and change it in ProcessCell event. Here is a sample code:

Code: Select all

if (e.Row % 2 == 0)
{
    (sender as StiCrossSummary).Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Red);
};
Thank you.
Post Reply