MindFusion.Reporting for Silverlight Programmer's Guide
CustomReportItem Class
Remarks See Also
 





Represents a custom report item, which provides its own DataTemplate for visualization.

Namespace: MindFusion.Reporting.Silverlight
Assembly: MindFusion.Reporting.Silverlight

 Syntax

C#  Copy Code

public class CustomReportItem : ReportItem

Visual Basic  Copy Code

Public Class CustomReportItem
    Inherits ReportItem

 Remarks

The CustomReportItem can be used to embed arbitrary Silverlight elements in a report. The visual tree of the item is specified through a DataTemplate assigned to its Template property. The data content of the item is specified through its Value property. During rendering the CustomReportItem internally creates a Silverlight ContentControl and assigns Value and Template to its Content and ContentTemplate properties respectively.

 Example

CustomReportItem which displays a Silverlight TextBlock with a Border around it. The width of the border is proportional to an IntField property of the associated DataContext.

XAML  Copy Code

<r:CustomReportItem Size="100%,20">
  <r:CustomReportItem.Template>
    <DataTemplate>
      <Border Name="border"
        Width="{r:Expression '[CDbl(IntField*10)]'}"
        Background="Red"
        BorderBrush="Black"
        BorderThickness="1"
        VerticalAlignment="Center"
        HorizontalAlignment="Left"
        Height="15">
        <TextBlock Text="{r:Expression '[CStr(IntField)]'}" />
      </Border>
    </DataTemplate>
  </r:CustomReportItem.Template>
</r:CustomReportItem>

In the above example the item is considered part of a report named report and the namespace r is defined as follows:

XAML  Copy Code

xmlns:r="http://mindfusion.eu/reporting/wpf"

 Inheritance Hierarchy

System.Object
    System.Windows.DependencyObject
        System.Windows.UIElement
            System.Windows.FrameworkElement
                MindFusion.Reporting.Silverlight.ReportItem
                    MindFusion.Reporting.Silverlight.CustomReportItem

 See Also

CustomReportItem Members
MindFusion.Reporting.Silverlight Namespace