MindFusion.Wpf Pack Programmer's Guide
Report.QueryText Event
See Also
 





Raised during the printing or previewing to allow clients to customize particular texts displayed in the report.

Namespace: MindFusion.Scheduling.Reporting
Assembly: MindFusion.Scheduling.Wpf.Reporting

 Syntax

C#  Copy Code

public event EventHandler<ReportQueryTextEventArgs> QueryText

Visual Basic  Copy Code

Public Event QueryText As EventHandler(Of ReportQueryTextEventArgs)

 Event Data

QueryText event handlers receive an argument of type ReportQueryTextEventArgs.

 Remarks

The QueryText event is raised for individual values displayed in the report. This is very convenient when you need to format some common types, such as DateTime.

 Example

The following example demonstrates how to format all DateTime objects in a report with a custom format using the QueryText event:

C#  Copy Code
void OnQueryText(object sender, ReportQueryTextEventArgs e)
{
    if (e.Value is DateTime)
        e.Representation = ((DateTime)e.Value).ToString("MMM dd, dddd");
}
Visual Basic  Copy Code

Sub OnQueryText(ByVal sender As Object, ByVal e As ReportQueryTextEventArgs)

    If (TypeOf e.Value Is DateTime) Then
        e.Representation = (CType(e.Value, DateTime)).ToString("MMM dd, dddd")
    End If

End Sub

 See Also

Report Members
Report Class
MindFusion.Scheduling.Reporting Namespace