Raised during the printing or previewing to allow clients to customize the style of elements displayed in the report.
Namespace: MindFusion.Scheduling.Reporting
Assembly: MindFusion.Scheduling.Wpf.Reporting
C# Copy Code |
---|
public event EventHandler<ReportQueryStyleEventArgs> QueryStyle |
Visual Basic Copy Code |
---|
Public Event QueryStyle As EventHandler(Of ReportQueryStyleEventArgs) |
QueryStyle event handlers receive an argument of type ReportQueryStyleEventArgs.
The style of the cells displayed in the report is controlled from several properties. The ContentStyle and AlternativeContentStyle properties of the associated ReportOptions object provide general styling of the contents. The ContentStyle and AlternativeContentStyle properties of the individual ReportColumn objects provide more specific styling for the cells associated with a particular column.
You can use this event to specify even more detailed styling - for individual cells that meet certain criteria. For example, you can specify different background for cells which display specific value.
The following example demonstrates how to specify red background for all items which end in the past:
C# Copy Code |
---|
void OnQueryStyle(object sender, ReportQueryStyleEventArgs e) { if (e.Item.EndTime < DateTime.Now) { ReportStyle customStyle = new ReportStyle(); customStyle.Background = Brushes.Red; e.Style = customStyle; } } |
Visual Basic Copy Code |
---|
Sub OnQueryStyle(ByVal sender As Object, ByVal e As ReportQueryStyleEventArgs) |