Color on alternating data rows
Posted: Fri Dec 22, 2006 11:44 pm
I'm trying to create a report that looks like your "Simple List" report in the Demo sample. I can't get it to alternate the row color.
I've added this code to my report:
Stimulsoft.Report.StiStyle Odd = new Stimulsoft.Report.StiStyle();
Odd.Name = "Odd";
Odd.Border = new Stimulsoft.Base.Drawing.StiBorder(Stimulsoft.Base.Drawing.StiBorderSides.None,
System.Drawing.Color.Black, 1, Stimulsoft.Base.Drawing.StiPenStyle.Solid,
false, 4, new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Black));
Odd.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(defReportStyle.RowDataBackgroundColor);
Odd.Font = new System.Drawing.Font(defReportStyle.RowDataFontName, defReportStyle.RowDataFontSize);
Odd.TextBrush = new Stimulsoft.Base.Drawing.StiSolidBrush(defReportStyle.RowDataTextColor);
Odd.TextOptions = new Stimulsoft.Base.Drawing.StiTextOptions(false, false, false, 0F,
System.Drawing.Text.HotkeyPrefix.None, System.Drawing.StringTrimming.None);
m_report.Styles.AddRange(new Stimulsoft.Report.StiStyle[] { Odd });
dataBand.OddStyle = "Odd";
All of my data rows have the color. What am I doing wrong?
Help is much appreciated.
I've added this code to my report:
Stimulsoft.Report.StiStyle Odd = new Stimulsoft.Report.StiStyle();
Odd.Name = "Odd";
Odd.Border = new Stimulsoft.Base.Drawing.StiBorder(Stimulsoft.Base.Drawing.StiBorderSides.None,
System.Drawing.Color.Black, 1, Stimulsoft.Base.Drawing.StiPenStyle.Solid,
false, 4, new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Black));
Odd.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(defReportStyle.RowDataBackgroundColor);
Odd.Font = new System.Drawing.Font(defReportStyle.RowDataFontName, defReportStyle.RowDataFontSize);
Odd.TextBrush = new Stimulsoft.Base.Drawing.StiSolidBrush(defReportStyle.RowDataTextColor);
Odd.TextOptions = new Stimulsoft.Base.Drawing.StiTextOptions(false, false, false, 0F,
System.Drawing.Text.HotkeyPrefix.None, System.Drawing.StringTrimming.None);
m_report.Styles.AddRange(new Stimulsoft.Report.StiStyle[] { Odd });
dataBand.OddStyle = "Odd";
All of my data rows have the color. What am I doing wrong?
Help is much appreciated.