Hi! I need to set the ComponentStyle, EvenStyle and OddStyle properties at runtime. I'm working on an ASP.NET project and I need to do it on my C# code.
I have tried with:
dataBand1.EvenStyle = "Data3";
dataBand1.OddStyle = "Data2";
(report.Pages["Page1"].GetComponents()["DataBand1"] as StiDataBand).EvenStyle = "";
(report.Pages["Page1"].GetComponents()["DataBand1"] as StiDataBand).OddStyle = "Odd";
StiText1.ComponentStyle = "Data3";
But I have no results.
I hope you can help me,
Best regards,
Seb . .
Change Styles at runtime
Change Styles at runtime
Hello,
First, you must add the desired style
and then only to assign it:
Thank you.
First, you must add the desired style
Code: Select all
Stimulsoft.Report.StiStyle StyleData1 = new Stimulsoft.Report.StiStyle();
StyleData1.AllowUseBorderFormatting = false;
StyleData1.AllowUseBorderSides = false;
StyleData1.AllowUseFont = false;
StyleData1.AllowUseTextBrush = false;
StyleData1.AllowUseTextOptions = false;
StyleData1.Name = "Odd";
StyleData1.StyleCode = Stimulsoft.Report.StiStyleCode.None;
StyleData1.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), false);
StyleData1.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.FromArgb(255, 240, 237, 232));
StyleData1.Font = new System.Drawing.Font("Arial", 9F);
StyleData1.Image = null;
StyleData1.TextBrush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Black);
report.Styles.Clear();
report.Styles.AddRange(new Stimulsoft.Report.StiBaseStyle[] {
StyleData1});
Code: Select all
dataBand2.EvenStyle = "Odd";
Change Styles at runtime
Aleksey, thanks a lot for your answer =)
If I want to add more than one Style, I have not use report.Styles.Clear(), am I right?
Best regards,
Seb . .
If I want to add more than one Style, I have not use report.Styles.Clear(), am I right?
Best regards,
Seb . .
Change Styles at runtime
Hello,
You can define several styles and then add them to the collection of styles.
Thank you.
You can define several styles and then add them to the collection of styles.
Thank you.