Hello!
I have a .Net procedure where i add StiText Components to data column band in dynamic way like this:
dataCol = new StiText();
dataCol.GetValue += new Stimulsoft.Report.Events.StiGetValueEventHandler(
(sender, e) => { e.Value = p.GetValue(mainDataSource).ToString(); });
dataBand.Components.Add(dataCol);
I would like to add StiText Components with a summary function to a data footer band with code. I tried something like this
footerCol = new StiText();
footerCol .GetValue += new Stimulsoft.Report.Events.StiGetValueEventHandler(
(sender, e) => { e.Value = "#%#{Sum(GroupHeader,fieldname)}"});
footBand.Components.Add(footerCol );
However, this is not enough, as the function Sum is not recognised and report displays the exact text of Value.
How can i add summary functions in runtime?
Add Summary Functions in runtime
Re: Add Summary Functions in runtime
Hello,
Please try to use the following code:
Thank you.
Please try to use the following code:
Code: Select all
var footerCol = new StiText();
footerCol.ClientRectangle = new Stimulsoft.Base.Drawing.RectangleD(0.2, 0, 8.4, 1);
footerCol.Text = new StiExpression("{Sum(DataCategories, Categories.CategoryID)}");
var footBand = report.GetComponentByName("FooterBand1") as StiFooterBand;
footBand.Components.Add(footerCol);
report.Compile();
Re: Add Summary Functions in runtime
Thank you for your response!
Unfortunately this didn't work, as i would like to add a column in runtime.
I suppose this is the answer why viewtopic.php?f=13&t=54071
Unfortunately this didn't work, as i would like to add a column in runtime.
I suppose this is the answer why viewtopic.php?f=13&t=54071
Re: Add Summary Functions in runtime
Hello.
Yes, if you do this at runtime, you should use the Totals class.
Thank you.
Yes, if you do this at runtime, you should use the Totals class.
Thank you.