Add StiText Components With Summary Function in Runtime

Stimulsoft Reports.WEB discussion
Post Reply
jenny
Posts: 5
Joined: Tue Nov 22, 2016 1:26 pm

Add StiText Components With Summary Function in Runtime

Post by jenny »

Hello!
I have a .Net procedure where i add stiText components to data columns band and fill their values according to specific criteria like this:

dataCol = new StiText();
dataCol.Name = "Data_" + col.RptField;
dataCol.GetValue += new Stimulsoft.Report.Events.StiGetValueEventHandler( (sender, e) => { e.Value = p.GetValue(mainDataSource).ToString(); });
....
dataBand.Components.Add(dataCol);


How can I add StiText components with summary functions in the same way?
I tried to write GetValue like this:
footCol.GetValue += new Stimulsoft.Report.Events.StiGetValueEventHandler(
(sender, e) => { e.Value = "#%#{Sum(GroupHeader,fieldname)}"; e.StoreToPrinted = true;});

but it is not recognised as a function. Report displays the exact text (#%#{Sum(GroupHeader,fieldname)}")
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Add StiText Components With Summary Function in Runtime

Post by HighAley »

Hello.

Unfortunately, it's impossible to do this such way.
You could use Totals.Sum only.
The functions outside the Totals class are converted to several methods during compilation.

Thank you.
Post Reply