BeforePrint event not firing
-
- Posts: 4
- Joined: Wed Sep 09, 2009 8:27 pm
- Location: Western Australia
BeforePrint event not firing
I have the following code :
StiText dataText = new StiText(new RectangleD((count * size), 0, size, 0.5));
dataText.HorAlignment = colInfo.alignment;
dataText.Text = "{" + tableName + "." + col.ColumnName + "}";
dataText.Name = dataBand.Name + "_DataText_" + dataBand.Components.Count;
dataText.GrowToHeight = true;
dataText.BeforePrint += new EventHandler(highlightRowCallback);
void highlightRowCallback(object sender, EventArgs e) {
throw new NotImplementedException();
}
I output the report to file and previewer. Report looks fine - rows and columns contain correct data - but the event never fires. Can you please help understand why this is the case?
I'm using Report.WPF 2009.1
Thanks.
BeforePrint event not firing
Hello Mike,
Report can have two states - compiled and not compiled. You need use different ways to sign event handler in this states. If you report is compiled you can use following code:
If your report is not compiled (default state of report) you should use following code:
Before compilation all events of reports exist only as strings.
Thank you.
Report can have two states - compiled and not compiled. You need use different ways to sign event handler in this states. If you report is compiled you can use following code:
Code: Select all
StiText text = report.GetComponentByName("Text1") as StiText;
text.BeforePrint += new EventHandler(highlightRowCallback);
Code: Select all
dataText.BeforePrintEvent.Value = "code of this event";
Thank you.