Create field in runtime
Posted: Wed Oct 31, 2012 10:41 am
I have a report of address, where I use a DataBand, need to add new fields to the same only at runtime, for this I use the following code:
Stimulsoft.Report.Components.StiText campoDado = new Stimulsoft.Report.Components.StiText();
campoDado.Name = "textRuntime"
campoDado.Text = "{" + "Endereco.NovoCampo" + "}";
var pageHeader = ((Stimulsoft.Report.Components.StiPageHeaderBand)stiReportAgencia.GetComponentByName("PageHeaderBandDados"));
pageHeader.Components.AddRange(new Stimulsoft.Report.Components.StiComponent[] { campoDado });
this firing an exception: Invalid expression..
Stimulsoft.Report.Components.StiText campoDado = new Stimulsoft.Report.Components.StiText();
campoDado.Name = "textRuntime"
campoDado.Text = "{" + "Endereco.NovoCampo" + "}";
var pageHeader = ((Stimulsoft.Report.Components.StiPageHeaderBand)stiReportAgencia.GetComponentByName("PageHeaderBandDados"));
pageHeader.Components.AddRange(new Stimulsoft.Report.Components.StiComponent[] { campoDado });
this firing an exception: Invalid expression..