MindFusion.Wpf Pack Programmer's Guide
Report.FromFile Method
See Also
 





Initializes a new instance of the Report class from the specified Xaml file.

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

 Syntax

C#  Copy Code

public static Report FromFile (
    string filePath,
    string key
)

Visual Basic  Copy Code

Public Shared Function FromFile( _
    filePath As String, _
    key As String _
) As Report

 Parameters

filePath

Path to a Xaml file containing report definition.

key

Key value of a report in resource dictionary.

 Return Value

A Report instance.

 Remarks

The Xaml file could contain a ResourceDictionary with multiple report definitions. In that case, FromFile returns the one whose x:Key is set to the key argument value. Do not set Name properties when loading reports from an external file, or WPF's XamlLoader will throw an exception. Instead, you can set InternalName attribute if needed, which internally sets same Name value of WPF elements:

Xaml  Copy Code

<ResourceDictionary>
  ...
  <r:Report x:Key="report1">
    ...
    <r:DataRange r:InternalName="OrdersRange">

If you need to define just one report in the Xaml file, you can keep it as the root element. In that case, the key argument is ignored, and you can freely set Name attributes:

Xaml  Copy Code

<r:Report ...
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:r="http://mindfusion.eu/reporting/wpf">

    ...
    <r:DataRange Name="OrdersRange">

 See Also

Report Members
Report Class
MindFusion.Reporting.Wpf Namespace
FromStream Method
FromDictionary Method