Introduction to Infragistics Reporting

In the new NetAdvantage vol.2011.2 you could enjoy the first RTM of amazing Infragistics Reporting.

NetAdvantage Reporting is a tool that allows developers to create modern, innovative, visually appealing reports by providing an easy-to-use design experience in Visual Studio. It is possible to create easily reports for Silverlight and WPF without any code. Coding is only optional if you want to change something programmatically.

Some of the most important features of the Infragistics Reporting are:

  • Built entirely in XAML-capable platforms, both the designer and engine
  • Client-side or server-side rendering for Silverlight and WPF
  • Full Visual Studio integration
  • Integrated charting
  • Rich data connectivity to supporting SQL Database, Entity Framework, RIA Services, OData and any other data source through our ObjectDataSource.
  • Exporting to industry-standard formats like PDF MS Excel and XPS.
  • The design surface offers innovative tooling and intuitive interfaces

Infragistics Reporting Modules

Reporting contains several main parts:

  • Report Designer
  • Report Data Explorer
  • Report Service
  • Controls
  • Expression Assistant

Report Designer

Anatomy of the Report Designer

The Report Designer is the work environment of NetAdvantage Reporting, the place where you design and layout your reports.

Intro_Reporting_Schema01 

The Report Designer is a Reporting System integrated by the following components:

  1. Alignment Configuration Toolbar – This toolbar is used for resizing and aligning the items placed on the Design Surface. For details, refer to The Alignment Configuration Toolbar.
  2. Designer Surface – The largest area of the Report Designer, divided into several sections. It is the actual work area in which you design your report. For details, refer to Knowing the Designer Surface and Report Sections.
  3. Report Data Explorer Window – This component is used to create, modify, and display data sources and parameters. For details, refer to The Report Data Explorer.

 

Report Data Explorer

The Report Data Explorer is part of the NetAdvantage Reporting work environment. This Report Designer component displays, in a treeview-like form, the available data sources (with their corresponding data fields) and the parameters’ definitions. You are allowed to create, modify, and display data sources and parameters. The menu at the top of the Report Data Explorer facilitates all required operations with data sources and parameters.

Intro_Reporting_Schema02

Report Service

The Report Service is a Windows Communication Foundation (WCF) service that allows the remote execution of NetAdvantage Reporting reports. It is typically used in scenarios in which reports are rendered in Silverlight or WPF clients, and connecting directly to the database is not an option. Reports are always processed on the server and the only information that the client receives is the final result.

 

Controls

A control represents a specific report component that has particular features and functionalities for displaying content, and can be inserted in any report at design-time. NetAdvantage Reporting comes with Table, Chart, Label, Image and Horizontal Line controls.

 

Expression Assistant

The Expression Assistant dialog is the tool you use to build the expressions needed for your report. This dialog has several distinct areas; the purpose of each of them is explained briefly below.

In the NetAdvantage Reporting tool, expressions are created in the Expression Assistant dialog. The Expression Assistant allows you to create custom expressions easily, providing a set of predefined and categorized elements to be used when building the expression.

Visual Elements of the Expression Assistant dialog

Intro_Reporting_Schema03

  1. Expression area – The expression you are building is displayed in the text field of this area.
  2. Operators area – In this area you can select operators to add to the expression.
  3. Fields, Variables and Parameters area – Select database fields, global variables, and parameters to add your expression.
  4. Functions area – All functions that you can add to the expression are available here.

 

Report Rendering

 

  • Server-Side Rendering. In this case, the Viewer retrieves a report from a Reporting Service (ReportService.svc). This schema separates the report’s user interface handled by the Viewer (the client side) from the actual report and rendering engine that run on the server.  Server-side rendering requires a running Report Service. The code handling this looks as shown below.
   1: <ig:XamReportViewer HorizontalAlignment="Right" Margin="0,78,0,0" Name="xamReportViewer1" VerticalAlignment="Top">

   2:     <ig:XamReportViewer.RenderSettings>

   3:         <ig:ServerRenderSettings DefinitionUri="ReportLibrary.MyReport.igr, ReportLibrary" ServiceEndpointUri="/ReportService.svc" /> 

   4:     </ig:XamReportViewer.RenderSettings> 

   5: </ig:XamReportViewer>

  • Client-Side Rendering  NetAdvantage Reporting supports also client-side rendering in Silverlight, which works without involving the Report Service. This second scenario requires that the data needed for the report is already located in the client (i.e., in XML files, through RIA Services, or any other web service call).   With client-side rendering the report is fully rendered by the client without any server participation. The implementation of client-side rendering settings uses the ClientRenderSetting tag as shown below.
   1: <ig:XamReportViewer HorizontalAlignment="Right" Margin="0,78,0,0" Name="xamReportViewer1" VerticalAlignment="Top"> 

   2:     <ig:XamReportViewer.RenderSettings> 

   3:         <ig:ClientRenderSettings DefinitionUri="ReportLibrary.MyReport.igr, ReportLibrary" />

   4:     </ig:XamReportViewer.RenderSettings> 

   5: </ig:XamReportViewer>

 

How to start with Infragistics Reporting.

In this article you could learn how to start with NetAdvantage Reporting. Sample application is Silverlight application , that create fully functional reports from Northwind sample database without code!

Requirements:

 

Steps to create sample report

  • Create Silverlight Application

Intro_Reporting_Pic01

  • Add Infragistics Report

In the Web project add new item->Infragistics->Reporting->Infragistics Report

Intro_Reporting_Pic03a

Report will propose you to create a Report service (server-side rendering is a default).

Intro_Reporting_Pic04

Report will add assembly references in your Web project.

When you select NorthWindReport.igr in the Visual Studio you will see the Report Designer with Designer Surface

  • Data source configuration

Click over the Add a Report Data Source… message on the Designer Surface

Intro_Reporting_Pic05a

Data Source Configuration Wizard appears.

Intro_Reporting_Pic05b

Select database

Intro_Reporting_Pic05c

Select tables and/or views (in this case “Customer and Suppliers by City” view)

Intro_Reporting_Pic05e

Modify the query expression to filter only customers (without suppliers) :

   1: SELECT [City]

   2:       ,[CompanyName]

   3:       ,[ContactName] FROM dbo.[Customer and Suppliers by City]  Where Relationship='Customers' 

Intro_Reporting_Pic05f

  • Report Design

Drag NorthwindDataSource from Report Data Explorer to Designer Surface.

Intro_Reporting_Pic06

Intro_Reporting_Pic06a

Open NetAdvantage Reporting Controls from Toolbox and add report title and image for the report fron page.

Intro_Reporting_Pic06c

Click on the “Preview” tab to preview the report in design mode.

Intro_Reporting_Pic06d

Intro_Reporting_Pic06e

  • Add a Report Viewer in the Silverlight client

Add a XamReportViewer control in the MainPage.xaml from the Silverlight client application.

Click over the XamReportViewer  control in Visual Studio 2010 designer to choose the Report Serice (Server-Side Rendering is a default render approach).

Intro_Reporting_Pic07a

ServerRenderSetting section will be added automatically in your XAML.

   1: <ig:XamReportViewer  HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="20" Name="xamReportViewer1">

   2:     <ig:XamReportViewer.RenderSettings>

   3:         <ig:ServerRenderSettings DefinitionUri="/ReportingDemo.Web;component/NorthWindReport.igr" ServiceEndpointUri="http://localhost:2934/NorthWindReportService.svc" />

   4:     </ig:XamReportViewer.RenderSettings>

   5: </ig:XamReportViewer>

 

Run the application to review the report

Intro_Reporting_Pic08

Intro_Reporting_Pic08a 

  • Group Data in Infragistics Report

It is enough just to drag the filed that will group the data from  Report Data Explorer to group area on Designer Surface.

Intro_Reporting_Pic09

  • Expression Assistant

Use an Expression Assistant to add page numbers in your report.

Intro_Reporting_Pic09a

Run the report to review grouping and page numbers.

Intro_Reporting_Pic09b

  • Add Parameters to Report

Edit data source

Intro_Reporting_Pic10

Change the query:

   1: SELECT [City]

   2:       ,[CompanyName]

   3:       ,[ContactName] FROM dbo.[Customer and Suppliers by City]  Where Relationship='Customers' And City=@City

 

In the next step for parameter “City” select action “Add Static Value List Parameter…”

In the “Add Static Value List Parameter” form set required parameter settings (name, type, default value).

Intro_Reporting_Pic10a

Drag parameter to page header area on the Designer Surface. Add additional label to represent the current filter in the report.

Intro_Reporting_Pic10b

Run the application and add the required parameter. Enjoy the completed report.

Intro_Reporting_Pic10c

 

Intro_Reporting_Pic10d

  • Export an Infragistics Report

Select “Export” option from the application toolbar, choose “PDF” format  and select a file name to save the report.

Intro_Reporting_Pic11

Enjoy the exported report.

Intro_Reporting_Pic11a

Intro_Reporting_Pic11b

Demo application you could download here:

The outstanding new NetAdvantage Reporting Vol.11.2 offers also many other features like client side rendering, printing, multi level report support, sorting, enhanced formatting etc. Expect next blogs from Infragistics  about these features. Follow news from Infragistics in http://infragistics.com/ and twitter: @infragistics for more information about new Infragistics products.

Advertisements

About Mihail Mateev

am a Microsoft Regional Director currently living in Sofia, Bulgaria. My interests range from technology to entrepreneurship. I am also interested in programming, web development, and education. Technical Consultant, Community enthusiast, PASS Regional Mentor for Central Eastern Europe, chapter lead, Microsoft MVP – Microsoft Azure. Organizer of SQLSaturday, Azure Bootcamp, IoT and JavaScript conferences. My experience is in various areas related to Microsoft technologies, including Windows Platform, ASP.Net MVC, MS SQL Server and Microsoft Azure. I have a PhD in cloud computing and am a university lecturer on Smart Homes and Smart Energy IoT Solutions
This entry was posted in Uncategorized. Bookmark the permalink.

4 Responses to Introduction to Infragistics Reporting

  1. How to Reports in a LightSwitch Applications

  2. mikeamm says:

    I created a post “Integrating Infragistics Reporting in Visual Studio LightSwitch Applications” about how to use Infragistics Reporting in LightSwitch Applications

  3. Ravindra says:

    Is Infragistics support for the normal windows application, not to the WPF. is it possible to implement the reports by using Winforms. ?

  4. mikeamm says:

    Yes, we could use it in Windows Forms: You could use the same approach as in ASP.Net with Report exporter. Only the report viewer is a XAML control. If you want to display report exactly in XAML report viewer you could wrap it in WinForms control

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s