Infragistics (R) NetAdvantage(R) Reporting
How to Reference Reports
Send Feedback

Glossary Item Box

Topic Overview

Purpose

This topic demonstrates how to configure and specify a report URI in different scenarios. A Uniform Resource Identifier (URI) allows you to uniquely identify a resource (reports in this case), within varied locations such as a referenced assembly, a specific location in your application or web url.

In this topic

This topic contains the following sections:


Configuration Overview

Report Lookup Mechanism

The report Uri can be either:

  • A Pack Uri (when the resource is included in your application).
  • An HTTP absolute Uri.
  • A file system Uri or a relative Uri.

The following table provides an overview of the supported Uris.

Pack Uri

HTTP Uri

File System

Relative

Client-Side WPF

X

X

X

X *

Client-Side SL

X

X **

Server-Side

X

X ***


* Relative to the Application executable location

** The report is looked up as a Resource or Content in the XAP file according to the defined path. If the report is not found, the engine will try to download the report from the server’s ClientBin folder.

*** Relative to the Web Application Root

When using Pack Syntax to reference a report, if the URI includes the string ";component", the report is looked up in the referenced assembly (searching for it as a Resource). Otherwise, the report is searched as Content.

  • Client-side WPF: the report is looked up locally, relative to the application’s executable file location (this is why Copy To Output Directory has to be set to Always).
  • Client-side SL: the report is looked up relative to the XAP (this is why Copy to Output Directory has to be set to Always).
  • Server-side: the report is looked up in the specified location, relative to server’s root.

If the report is not found, a Report not found message will be returned.

Embedding Reports inside the Application

There are different ways of embedding reports in your application depending on the value of its Build Action property. For reports (*.igr), the available values are: Resource, Content or None.

The table below shows the different configurations to reference a report design in different platforms and scenarios based on its Build Action property. The possible configurations are further elaborated upon in the text blocks following the table.

Report Build Action

Configuration details

Configuration properties

Resource (default)

Applies to WPF and SL client-side scenarios; WPF, SL and HTML Server-side Scenarios

definitionUri

Content

Applies to WPF and SL client-side scenarios WPF, SL and HTML Server-side Scenarios

definitionUri

Copy To Output Directory

None

Applies to WPF and SL client and server-side scenarios.

None



Resource Build Action

Overview

When a report is created, its Build Action property is set to Resource. In this case, files are compiled into either an executable or library assembly.

Property settings

 

The table below maps the desired configurations to the property settings that manage them.

In order to use:

Use this property:

And set it to:

Client-Side Rendering

definitionUri

Resource File Pack URI of the Report relative to the containing project.

Server-Side Rendering

definitionUri

Resource File Pack URI of the Report relative to the containing project.

Uri to Report Service


The relative path should specify the assembly’s name followed by ;component and the report design path as shown in the examples.

Code Examples

Client-Side Rendering Example

The code below demonstrates how to configure client-side rendering using the xamReportViewer. For Silverlight client-side rendering scenarios, the report is looked up in the assemblies located in the .XAP file.

Property

Setting

definitionUri

/MyAssembly;component/Report.igr


In XML:

<ig:XamReportViewer Name="xamReportViewer1">
            <!--This is the syntax to run a client-side rendered report-->
            <ig:XamReportViewer.RenderSettings>
                <ig:ClientRenderSettings DefinitionUri="/MyAssembly;component/Report1.igr" />
            </ig:XamReportViewer.RenderSettings>
</ig:XamReportViewer>
Server-Side Rendering Example

The code below demonstrates how to configure server-side rendering using the xamReportViewer.

Property

Setting

definitionUri

/MyAssembly;component/Report1.igr

http://localhost:30242/ReportService.svc/soapAddress


In XML:

<ig:XamReportViewer Name="xamReportViewer1">
            <!--This is the syntax to run a server-side rendered report-->
            <ig:XamReportViewer.RenderSettings>
                <ig:ServerRenderSettings DefinitionUri="/MyAssembly;component/Report1.igr" ServiceEndpointUri="http://localhost:30242/ReportService.svc/soapAddress" />
            </ig:XamReportViewer.RenderSettings>
        </ig:XamReportViewer>

Content Build Action

Overview

When a report’s Build Action property is set to Content, the file is included in the content output group. This setting is used for stand-alone files that have an explicit association with an executable assembly. For the case of report designs, you should also set the Copy To Output Directory property to Always to make sure designs are updated every time the solution is built.

Property settings

 

The table below maps the desired configuration to the property settings that manage them.

In order to use:

Use this property:

And set it to:

Client-Side Rendering

definitionUri

Content File Pack URI of the Report relative to the containing project

Server-Side Rendering

definitionUri

Content File Pack URI of the Report relative to the containing project Uri to Report Service


In this case, the assembly’s name is not necessary for specifying the definitionUri.

Code Examples

Client-Side Rendering Example

The code below demonstrates how to configure client-side rendering using the xamReportViewer. For Silverlight client-side rendering scenarios, the report is looked up in the .XAP file.

Property

Setting

definitionUri

/MyFolder/Report1.igr


In XML:

<ig:XamReportViewer Name="xamReportViewer1">
            <!--This is the syntax to run a client-side rendered report-->
            <ig:XamReportViewer.RenderSettings>
                <ig:ClientRenderSettings DefinitionUri="/MyFolder/Report1.igr" />
            </ig:XamReportViewer.RenderSettings>
</ig:XamReportViewer>
Server-Side Rendering Example

The code below demonstrates how to configure server-side rendering using the xamReportViewer.

Property

Setting

definitionUri

/MyFolder/Report1.igr

http://localhost:30242/ReportService.svc/soapAddress


In XML:

<ig:XamReportViewer Name="xamReportViewer1">
            <!--This is the syntax to run a server-side rendered report-->
            <ig:XamReportViewer.RenderSettings>
                <ig:ServerRenderSettings DefinitionUri="/MyFolder/Report1.igr" ServiceEndpointUri="http://localhost:30242/ReportService.svc/soapAddress" />
            </ig:XamReportViewer.RenderSettings>
        </ig:XamReportViewer>

Related Content

Topics

The following topics provide additional information related to this topic.

Topic

Purpose

This topic describes the main built-in features provided by the XAML Report Viewer for displaying and handling reports.

This topic introduces the basics for using the XAML Report Viewer control.

How to Customize Report Uri Resolution This topic shows you how to customize how a defined Uri resolves itself


©2012. All Rights Reserved.