StiGroupHeader.Rendering event called twice
Posted: Wed Mar 21, 2007 3:26 am
Hi,
When my report starts a new page it appears that Rendering event is being called twice. This cause a big problem for me as I'm using it preform calculations. It is difficult for me to give a full repo of this since my code builds up the report controls dyncamically, but I do something like:
I see in the out.txt that items appear on the first row of a new page in the report appear twice as many others. What could becausing this? Is there a fix/work round for this.
Thanks,
Rob
When my report starts a new page it appears that Rendering event is being called twice. This cause a big problem for me as I'm using it preform calculations. It is difficult for me to give a full repo of this since my code builds up the report controls dyncamically, but I do something like:
Code: Select all
public override void Sum(Reports_Description_expression arg0) {
StiSumDoubleFunctionService sum = new StiSumDoubleFunctionService();
variables.Enqueue(sum);
StiGroupHeaderBand groupHeaderBand = band as StiGroupHeaderBand;
if (groupHeaderBand != null) {
groupHeaderBand.BeginRender += delegate(object sender, System.EventArgs e) {
sum.Init();
};
groupHeaderBand.Rendering += delegate(object sender, System.EventArgs e) {
double result = Evaluate_expression.Execute(arg0, variables, text, connection, band);
File.AppendAllText("out.txt", string.Format("{0} - {1}\r\n", connection["id"], result));
sum.CalcItem(result);
};
}
}
Thanks,
Rob