Active Reports 9
Active Reports 9
Table of Contents
Table of Contents 1-14
ActiveReports 9 15
Requirements 26-27
Install ActiveReports 27-28
Installed Files 28-30
Side-by-Side Installation 30-31
GrapeCity Copyright Notice 31-32
End User License Agreement 32
.NET Framework Client and Full Profile Versions 32-33
Redistributable Files 33-34
Bullet 136-138
Chart 141-149
Container 157-158
FormattedText 158-161
Image 161-163
Line 163
List 163-166
Map 166-175
Matrix 175-180
OverflowPlaceHolder(Page Report) 180-181
Shape 181-183
Sparkline 183-186
Subreport(RDL) 186-187
Table 187-192
TableOfContents 192-194
TextBox 194-198
Data Sources and Datasets 198
Report Data Source Dialog 198-200
DataSet Dialog 200-202
Shared Data Source (RDSX) 202-203
Expressions 203-204
Common Values 204-205
Common Functions 205-210
Layers 210-218
Working with Layers 218-222
View, Export or Print Layers 222-223
Tracing Layers 223-227
Using Script 227-228
Report Dialog 228-230
FixedPage Dialog 231-233
Grouping Data (Page Layout) 233-235
Themes 236-237
RichTextBox 268-271
Shape (Section Report) 271-272
Picture 272-273
Line (Section Report) 273-274
PageBreak 274
Barcode (Section Report) 274-286
Markers 332-333
Label Symbols 333-339
Constant Lines and Stripes 339-341
Chart Axes and Walls 341
Standard Axes 341-343
Custom Axes 344-345
Gridlines and Tick Marks 345-346
ReportInfo 346-347
CrossSection Controls 347-349
Section Report Structure 349-351
Section Report Events 351-354
Annotations 426-427
Text Justification 427-428
Multiline in Report Controls 428
Line Spacing and Character Spacing 428-429
Samples 599
HTML5 Viewer Sample 599-601
Page Reports And RDL Reports 601
API 602
Create Report 602-603
Custom Resource Locator 603-604
Data 643
Bound Data 643-644
IList Binding 644-646
LINQ 646-647
Unbound Data 647-648
XML 648-649
Layout 649-650
Walkthroughs 680
Page Report/RDL Report Walkthroughs 680-681
Data 681
Master Detail Reports 681-684
Reports with Parameterized Queries 684-688
Reports with Stored Procedures 688-690
Map 734
Reports with Map 734-738
Export 738
Custom Web Exporting 738-743
Preview 743
Drilldown Reports 743-744
Drill-Through Reports 744-750
Parameterized Reports 750-753
Reports with Bookmarks 753-757
Reports with TableOfContents 757-762
Advanced 762
Data 802-803
Basic Data Bound Reports 803-804
Basic XML-Based Reports (RPX) 804-808
Run Time Data Sources 808-811
Layout 811
Export 858
Custom Web Exporting (Std Edition) 858-862
Custom HTML Outputter (Std Edition) 862-868
Script 868-869
Script for Simple Reports 869-875
Script for Subreports 875-883
Parameters 883
Using Parameters in SubReports 883-887
Parameters for Charts 887-892
Web 892
Document Web Service 892
Professional 894-895
Creating a Basic End User Report Designer (Pro Edition) 895-900
Web 911
In This Documentation
ActiveReports User Guide
The User Guide has many getting started topics and how-to topics with code samples to copy and paste.
In This Documentation
Welcome to ActiveReports 9
This section provides basic information on installing and using the product, as well as support, licensing, and
what's new.
License Your ActiveReports
This topic walks you through how to license your machine and how to add licensing to any projects created during
your evaluation.
Upgrading Reports
This topic provides information about upgrading reports from ActiveReports 6 and Data Dynamics Reports, and
about converting MS Access Reports and Crystal Reports with the Import Wizard.
Getting Started
This section provides an overview of the interface and where to find everything you need to get started designing
reports.
Concepts
This section provides information on what you can do with ActiveReports.
How To
This section provides step-by-step instructions for many features.
Samples and Walkthroughs
This section provides a description of the samples available with ActiveReports and step-by-step walkthroughs
explaining key features.
Troubleshooting
This section provides troubleshooting symptoms, causes, and solutions to commonly encountered issues.
Welcome to ActiveReports 9
Learn to use and install ActiveReports 9.
This section contains information about
What's New
Learn about the new features in ActiveReports.
ActiveReports Editions
Find out which features can be used with Standard and Professional Edition licenses.
Installation
View requirements for installation of ActiveReports, learn what files are installed and how to verify your
installation, and find installation troubleshooting tips.
GrapeCity Copyright Notice
Explains GrapeCity copyright information.
End User License Agreement
Understand the terms of the ActiveReports License Agreement and Limited Warranty.
What's New
We have made a number of changes and added new features since the last version of ActiveReports. Following are some of
the major highlights of this release.
Learn More | Working with Save and Open Reports from Server
Layers
The new Layers feature in ActiveReports 9 provides you with the ability to add a named group of controls to your report.
Lock or unlock, add or remove, show or hide these group of controls based on your requirement and also determine which
Layers to view, print or export. Layers makes it easy to design complex reports with complex layouts. This feature is
particularly useful when you want to trace the layout of a pre-printed form or modify a template report without changing
the existing report layout. Layers also make designing complex layouts easy by allowing you to modify one aspect of the
report such as static labels or bound data without modifying the entire report layout.
Learn More | Working with Layers | View, Export or Print Layers| Tracing Layers
TableofContents Control
TableofContents (ToC) is a new control used to display an organized hierarchy of report heading levels and labels along with
their page numbers in the body of a report. With this control, you can easily embed a contents structure within your report
and then render and print it. This control is available in both Page and RDL Reports.
RDL Reports
Continuous Page Layout (CPL) reports have now been renamed to Report Definition Language (RDL) reports. RDL reports
are available as a report template in your Visual Studio project and are also available as a separate item that can be added
in Visual Studio. You also get a separate RDL report template in the Stand-alone designer now.
Shape | CrossSectionBox
ActiveReports Editions
ActiveReports 9 is an enhancement of the popular ActiveReports engine and report viewers, plus the powerful Data
Dynamics Reports designer.
Available in two editions, Standard and Professional, ActiveReports 9 delivers outstanding reporting capabilities.
Drop down the sections below to see the features packed into each edition.
Standard Edition Features
The Standard Edition provides a report designer that is fully integrated with the Visual Studio IDE, a report viewer
for Windows Forms, and export filters for generating reports in various file formats. The report designer even
includes a barcode control with all of the most popular barcode styles, and its own chart control.
Designer
Full integration with the .NET environment
Familiar user interfaces
Choice of section or page or RDL report types
C# and VB.NET support with code-based section reports
Script support with XML-based section reports
Expression support with page reports and RDL reports
The ability to compile reports into the application for speed and security or to keep them separate for
ease of updating
Designer hosting of .NET and user controls
Report Controls
Interactive Features
Document map (table of contents)
Bookmark links, hyperlinks, and drill through links
Parameters
Drill-down (page report/RDL reports)
Copy, pan, and zoom
Jump to previous, next, first, or last group or search result
Reporting Engine
Managed code
Binding to ADO.NET, XML, iList, and custom data sources
Master reports, themes, and styles
All of the features of previous versions of ActiveReports and Data Dynamics Reports
HTML5 Viewer
A Javascript component
Preview reports hosted on ActiveReports 9 Server or ActiveReports 9 Web Service
Provides multiple UI options
Ability to create a customized viewer
Touch mode support in Mobile UI
WPF Viewer
Managed C# code
Table of contents and bookmarks
Thumbnail view
Parameters
Annotations
Configurable scroll bar jump buttons (like those found in Microsoft® Word®)
Bookmark links, hyperlinks and drillthrough links
Interactive sorting
Export Filters
Import Filters
Access® Reports
Crystal Reports
Stand-Alone Applications
The Report Viewer application contains all the functionality of the ReportPreview control. It can be
opened from the shortcut provided in the Start menu.
The WPF Viewer application contains all the functionality of the WPF Viewer control.
Professional Edition Features
The Professional Edition includes all of the features of the Standard Edition and supports the following additional
features:
Stand-Alone Applications
The Report Designer application contains all the functionality of the integrated Report Designer. It can
be opened from the shortcut provided in the Start menu.
ASP.NET Integration
The Web server control provides convenience for running and exporting reports in ASP.NET.
HTTP Handler extensions allow report files (RPX or RDLX) or compiled assemblies containing reports to
be dropped on the server and hyperlinked.
WebViewer Control
The WebViewer control allows quick viewing of ActiveReports on the web as well as printing capability
with the AcrobatReader ViewerType enumeration.
Flash ViewerType enumeration supports multiple browsers and offers customization and localization
options.
HTTP Handlers
The RPX and RDLX HTTPHandler allows the developer to hyperlink ActiveReports on a web page to
return HTML format or PDF format reports for viewing and/or printing.
The Compiled Report HTTPHandler allows the developer to hyperlink ActiveReports compiled in an
assembly on a web page to return HTML format or PDF format reports for viewing and/or printing.
Map Control
The Map data region shows your business data against a geographical background.
Create different types of map, depending on the type of information you want to communicate in your
report.
Font Linking
Font linking helps you resolve the situation when fonts on a deployment machine do not have the glyphs
that were used in a development environment.
By linking fonts, you can resolve the problem with a different PDF output on deployment and
development machines that may occur due to the missing glyphs.
Font Fallback
If missing glyphs are not found in linked fonts, the PDF export filter looks for the glyphs in fonts
declared in the FontFallback property.
A default font is used if you do not declare one, or you can declare an empty string for this property to
leave out missing glyphs from the exported file.
PDF Export
PDF/A support in PDF Export.
Word Export
Export your reports in .docx format, a format that opens in Microsoft Word application.
Script and In section reports, you can add C# or VB code to events behind your ✓ ✓
Code code-based reports, or add script to events in the script editor in XML-
based reports.
In page reports/RDL reports, you can use regular expressions in any
property, plus you can add VB.NET methods to the code tab, and call
them in your expressions.
Report File You can save and load page reports/RDL reports in RDLX (extended ✓ ✓
Formats RDL) format.
You can save and load section reports in RPX (report XML) format, and
you can compile section reports in CS or VB code formats.
Report The BarCode control supports all of the following styles: ✓ ✓
Controls
ANSI 3 of 9 ANSI Code 2 of 5 Interleaved
Extended 3 of 2 of 5
9
Code 25 Matrix Code 39 Extended Code 128 A
Code 39
Code 128 B Code 128 C Code 128 Auto Code 93
Extended Code 93 MSI PostNet Codabar
EAN-8 EAN-13 UPC-A UPC-E0
UPC-E1 RoMail UCC/EAN-128 QRCode
RM4SCC
Code 49 Japanese Pdf417 EAN-128
Postal FNC1
RSS-14 RSS-14 RSS-14 MicroPdf417
Truncated Stacked
RSS-14 Stacked RSS RSS Expanded
Omnidirectional Expanded Stacked
Styles You can control page settings, printer settings, global settings such ✓ ✓
and Report as grid display, grid size, and whether to show a verification dialog
Settings when deleting controls. You can specify row count or column count in
grids, ruler units, and how many pages to display in previews.
External You can reuse report designer styles by saving and loading style ✓ ✓
Style information in external files.
Sheets
Others The designer also offers snaplines, report preview, designer zoom, ✓ ✓
various formatting settings, control and text alignment settings, Z
order settings, unbound fields, and parameters support.
Input and Output
Data Supported data includes: ADO.NET data provider, ADO.NET data class ✓ ✓
(DataSet, DataTable, DataReader, DataView), Oracle data, XML data,
and unbound data
Printing You can control the page size, orientation, and margins, as well as ✓ ✓
specifying bound (double page spread), collating, duplex printing, and
paper feed trays.
*1: Japanese fonts can only be output as embedded fonts. *2: Cannot handle output of multiple language fonts in
a single control. Please refer to Multi-Language PDF for details.
Installation
This section helps you understand the installation process.
In this section:
Requirements
Learn about the hardware and software required to run ActiveReports.
Install ActiveReports
Find out how to install the ActiveReports Setup.
Installed Files
Find out what files are installed with ActiveReports and where to locate them.
Side-by-Side Installation
Learn about working with ActiveReports 9 and ActiveReports 8 on a single machine.
Requirements
To install and use ActiveReports 9, you need the following hardware and software.
Software requirements
For Web deployment: IIS 7.0, 7.5, 8.0, 8.5 and ASP.NET (version to match the .NET Framework
version)
Flash Player: Adobe Flash Player 11, 12 and 13
Browser: Microsoft Internet Explorer 9 or higher, Mozilla Firefox 20 or higher, Google Chrome 30 or
higher and Mobile Safari (iOS 6 and higher)
Note: Microsoft Silverlight 4 Tools is required for the application development with the
ActiveReports Silverlight Viewer.
Install ActiveReports
Follow the steps below to install GrapeCity ActiveReports on your machine.
Note: Your machine setup may require you to be logged in as an Administrator to install new software. If
this is the case and you do not have Administrator privileges, consult your system administrator.
3. On the End-User License Agreement screen that appears, go through the terms in the License
Agreement, select the check-box to accept them and click Next to continue with installation.
4. On the Installation Options screen that appears, optionally select GrapeCity ActiveReports Samples
to install them with the product and click Next to continue with installation.
Note: These samples help you in understanding different usage scenarios that the product offers.
5. On the Licensing Options screen that appears, choose out of the three licensing options and click Install.
Evaluation
6. Once the installation finishes, a screen notifying the completion of installation appears. Click Finish to close
the window and complete the installation process.
Installed Files
You can verify your package installation by following the steps below:
1. Open Visual Studio.
2. From the Visual Studio Help menu, select About Microsoft Visual Studio and verify that ActiveReports 9 appears in
the installed products list.
When you install ActiveReports and use all of the default settings, files are installed in the following folders:
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\GrapeCity
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\GrapeCity\ActiveReports 9
C:\Users\YourUserName\Documents\GrapeCity Samples\ActiveReports 9
Folder Description
Data (folder) Includes sample data files.
HTML5 Viewer (folder) Includes HTML5 Viewer sample.
Page Reports And RDL Reports (folder) Includes Page Report samples.
Professional (folder) Includes Professional edition samples.
Reports Gallery (folder) Includes ReportsGallery sample.
Section Reports (folder) Includes Section Report samples.
Standard Edition Web (folder) Includes Standard Edition Web sample.
WPF Viewer (folder) Includes WPF Viewer sample.
Side-by-Side Installation
Once ActiveReports 9 is installed on your system, it becomes the primary report designer. This means that when
Visual Studio opens one of our proprietary file types, RPX or RDLX, it uses the ActiveReports 9 version of the
following Visual Studio integrated features:
Integrated report designer
Report menu
ActiveReports toolbar
Report Explorer
Toolbox tabs
In ActiveReports 9, ReportDesigner.Switcher tool allows you to change packages which are registered in Visual
Studio. You can change between ActiveReports 8 and ActiveReports 9 for the RPX designer and the RDLX designer.
Tip: You can still access some of the integrated features even if they are hidden.
Right-click in the Visual Studio toolbar area to select which toolbars to show.
The Visual Studio View menu, under Other Windows, lets you select Report Explorer versions.
Toolbox tabs are still visible for other versions, but ones that do not work with the current
designer are disabled.
In order to work with ActiveReports 8 RPX reports, you must run the Switcher tool and change the Primary RPX
designer to ActiveReports 8. If you don't, the reports open in the ActiveReports 9 designer, and the toolbar does
not work.
File Description
GrapeCity.ActiveReports.v9.dll Run-time engine assembly file.
GrapeCity.ActiveReports.Chart.v9.dll Chart control assembly file.
GrapeCity.ActiveReports.Document.v9.dll Document assembly file.
GrapeCity.ActiveReports.Interop.v9.dll Native functions assembly file.
GrapeCity.ActiveReports.Export.Pdf.v9.dll PDF Export assembly file.
GrapeCity.ActiveReports.Export.Word.v9.dll RTF Export assembly file.
GrapeCity.ActiveReports.Export.Xml.v9.dll Text Export assembly file.
GrapeCity.ActiveReports.Export.Image.v9.dll TIFF Export assembly file.
GrapeCity.ActiveReports.Viewer.Win.v9.dll Viewer assembly file.
GrapeCity.ActiveReports.Export.Excel.v9.dll Microsoft® Excel® Export assembly file.
GrapeCity.ActiveReports.Extensibility.v9.dll Extensibility assembly file.
GrapeCity.ActiveReports.Export.Document.v9.dll Document assembly file.
GrapeCity.ActiveReports.Export.Image.Unsafe.v9.dll Image Export assembly file. (Unsafe version)
GrapeCity.ActiveReports.Diagnostics.v9.dll ActiveReports Diagnostics assembly file.
GrapeCity.ActiveReports.Export.Rdf.v9.dll RDF Export assembly file.
DocumentFormat.OpenXml.dll OpenXML assembly file.
GrapeCity.ActiveReports.Export.Xaml.v9.dll XAML Export assembly file.
GrapeCity.ActiveReports.Viewer.Wpf.v9.dll WPF Viewer assembly file.
Note: Does not support .NET Framework 3.5 Full
Profile.
The following assemblies are not compliant with .NET Framework 3.5 Client Profile and .NET Framework 4.0 Client
Profile:
File Description
The End User Report Designer, the WebViewer control, the HTML Export filter, and the WPF Viewer require
the full profile.
Redistributable Files
ActiveReports is developed and published by GrapeCity, Inc. You may use it to develop applications in
conjunction with Microsoft Visual Studio or any other programming environment that enables the user to use and
integrate the control(s). You may also distribute, free of royalties, the following Redistributable Files with any such
application you develop to the extent that they are used separately on a single CPU on the client/workstation side
of the network:
DocumentFormat.OpenXml.dll
GrapeCity.ActiveReports.Calendar.v9.dll
GrapeCity.ActiveReports.Chart.v9.dll
GrapeCity.ActiveReports.Dashboard.v9.dll
GrapeCity.ActiveReports.Design.Win.v9.dll
GrapeCity.ActiveReports.Diagnostics.v9.dll
GrapeCity.ActiveReports.Document.v9.dll
GrapeCity.ActiveReports.Export.Document.v9.dll
GrapeCity.ActiveReports.Export.Html.v9.dll
GrapeCity.ActiveReports.Export.Excel.v9.dll
GrapeCity.ActiveReports.Export.Image.Unsafe.v9.dll
GrapeCity.ActiveReports.Export.Image.v9.dll
GrapeCity.ActiveReports.Export.Pdf.v9.dll
GrapeCity.ActiveReports.Export.Rdf.v9.dll
GrapeCity.ActiveReports.Export.Word.v9.dll
GrapeCity.ActiveReports.Export.Xaml.v9.dll
GrapeCity.ActiveReports.Export.Xml.v9.dll
GrapeCity.ActiveReports.Extensibility.v9.dll
GrapeCity.ActiveReports.Imports.Access.v9.dll
GrapeCity.ActiveReports.Imports.Crystal.v9.dll
GrapeCity.ActiveReports.Interop.v9.dll
GrapeCity.ActiveReports.OracleClient.v9.dll
GrapeCity.ActiveReports.Serializer.v9.dll
GrapeCity.ActiveReports.v9.dll
GrapeCity.ActiveReports.Viewer.Silverlight.v9.dll
GrapeCity.ActiveReports.Viewer.Win.v9.dll
GrapeCity.ActiveReports.Viewer.Wpf.v9.dll
GrapeCity.ActiveReports.VisualStudio.v9.dll
GrapeCity.ActiveReports.Web.Design.v9.dll
GrapeCity.ActiveReports.Web.v9.dll
GrapeCity.ActiveReports.Interop64.v9.dll
Grapecity.ActiveReports.Flash.v9.swf
Grapecity.ActiveReports.Flash.v9.Resources.swf
Note: See Installed Files for the location of the files listed above.
License Types
ActiveReports provides three licensing options to choose from.
See ActiveReports Editions to understand the difference between Standard and Professional Editions.
ActiveReports offers different key types with varying functionality in the way the product works.
3. On the Activate [Active Reports 9] screen that appears, click the Next button.
4. In the Enter a Product Key screen that appears next, enter the following information:
User Name: Enter your name here.
Organization: Enter your company name here.
Email: Enter your e-mail address here.
Product Key: Enter the product key exactly as you received it from GrapeCity, including any
capital letters. When you enter the product key, a green check mark appears next to this field to
indicate a valid key.
5. Click the Next and then the Finish button to complete the licensing process.
To license ActiveReports on a machine without Internet Connection
1. At the time of installation, on the last screen a check box that states Run license manager appears.
Select this checkbox and click the Close button to complete the installation.
2. In the GrapeCity License Manager window that appears, under the Action field, click Activate.
3. On the Activate [Active Reports 9] screen that appears, click the Next button.
4. In the Enter a Product Key screen that appears next, enter the following information:
User Name: Enter your name here.
Organization: Enter your company name here.
Email: Enter your e-mail address here.
Product Key: Enter the product key exactly as you received it from GrapeCity, including any
capital letters. When you enter the product key, a green check mark appears next to this field to
indicate a valid key.
12. Click the Next and then the Finish button to complete the licensing process.
To activate license for ActiveReports in multiple machines
A single developer license key for ActiveReports can only be used on three machines. If all the license activations
have been used and you wish to license a fourth machine, you will need to deactivate the license from any of the
three machines where the license is currently activated. After you have deactivated the license from the machine,
you can use the same license key to activate ActiveReports on another machine. For more information, see How
To: Deactivate an ActiveReports license.
Note: ActiveReports license should be deactivated before formatting a machine to avoid loss of activation.
You can contact our support team for such scenarios.
3. The web application is now licensed, no evaluation banners appear when you run it. You can distribute the
Web application to unlicensed machines and no evaluation banners appear.
To upgrade or downgrade a license
If you want to change your ActiveReports license type you need to do one of the following:
Upgrade from a Standard to a Professional License:
1. From the Start menu, go to the All Programs > GrapeCity > License Manager.
2. In the GrapeCity License Manager window that appears, under Upgrade/Downgrade click Upgrade to
Professional Edition:
Note: When using the PDF export filter in your project, make sure you check the licenses.licx file for
reference to the PDF Export Assembly.
To create the Web Key with the Web Key Generator utility
For your medium trust and Windows Azure projects with ActiveReports, you may need to generate a Web Key by
using the Web Key Generator utility on a machine with licensed ActiveReports.
1. Run the WebKeyGenerator.exe from the ...\Common Files\GrapeCity\ActiveReports 9 folder.
2. In the dialog that appears, copy the Web Key by clicking Copy. We recommend that you use the second
Copy button to copy the Web Key together with the corresponding web.config section.
3. Paste the Web Key into the web.config file of your project between the opening and closing
<configuration> tags to remove the licensing message. The web.config key looks like the following.
XML code. Paste INSIDE the Web.config file
<configuration>
<appSettings>
<add key=" ActiveReports 9 License" value="Generated Web Key" />
</appSettings>
</configuration>
Note: If you see the message "Your computer is not currently licensed" in the Web Key Generator dialog,
please license your machine.
2. From the Project menu, select Add New Item, and the select an ActiveReports report. (You can delete it
later. This is only to add the references to the project.)
3. Open the Visual Studio Build menu and select Rebuild Solution.
4. Check the licenses.licx file and verify that ActiveReports licensing is added for all of the features used in
your project.
Note: If you use other ActiveReports features in your class library that are still showing an evaluation
banner, for example, features exclusive to the Professional Edition, you can add those references manually
and rebuild the solution.
To license ActiveReports when you cannot compile the calling application or the calling application is
COM
IMPORTANT: This is the ONLY reason you should ever use the Application License Generator.
2. Click the Browse button and select the compiled dll that requires licensing.
3. In the Assembly description field, enter the description for the assembly that you are licensing. You can
later view this description by right-clicking the licensed assembly.
4. Click the Generate button.
5. Distribute the generated file <AssemblyName>.GrapeCity.Licenses.dll along with the application.
To remove an Invalid license message
If your license key is invalid or corrupt, you may get an invalid license message.
To remove the message, do any one of the following:
Run the setup to re-install and authenticate the license.
Open the GrapeCity License Manager utility by clicking Run the License Manger
(activate/deactivate) link in this error message and click Activate.
Follow the licensing steps from To license an ActiveReports Trial without reinstalling to license your product
and remove the error message.
To deactivate an ActiveReports license
You can deactivate your ActiveReports license and go back to a Trial License.
1. From the Start menu, go to the All Programs > GrapeCity > License Manager.
2. In the GrapeCity License Manager window that appears, under Action click Deactivate.
3. In the Deactivate [ActiveReports 9] screen that appears select the Next button.
4. Confirm the Product screen appears. Confirm that the correct product is getting downgraded and click the
Next button.
5. Deactivation Successful screen appears with the Product Name as ActiveReports 9 and the Current
Status as Trial License (number of days left).
Upgrading Reports
ActiveReports 9 allows you to upgrade from ActiveReports and Data Dynamics reports.
Important: Be sure to create a backup for your project before starting the upgrade process.
For a list of changes from the previous version, see Breaking Changes.
Breaking Changes
When you upgrade reports from previous versions of ActiveReports or Data Dynamics Reports, there are several breaking changes.
Other Changes
Rendering Extensions (Image) - ColorDepth is a obsolete property of GrapeCity.ActiveReports.Export.Image.Page.Settings class.
DataDynamics.ActiveReports.DataSources GrapeCity.ActiveReports.Data
DataDynamics.ActiveReports.Interop GrapeCity.ActiveReports
DataDynamics.ActiveReports.Options GrapeCity.ActiveReports.SectionReportModel
DataDynamics.ActiveReports.Export GrapeCity.ActiveReports.Export
DataDynamics.ActiveReports.Export.Html GrapeCity.ActiveReports.Export.Html
DataDynamics.ActiveReports.Document.Annotations GrapeCity.ActiveReports.Document.Section.Annotations
Note: GrapeCity.ActiveReports.Viewer.Win.v9.dll does not get added automatically to the project references when the report layout is added. You
need to either add the Viewer control or manually add the reference to this assembly.
3. Choose Microsoft Access (mdb) or Crystal Reports (rpt) as the input format and click Next to convert
the selected report.
4. Browse to the location that contains the Microsoft Access file or Crystal Reports using the ellipsis button.
Once you select the location, a list of available reports appear in the dialog.
5. Select the reports to import and click Next to analyze the selected reports.
6. Use the ellipsis button to select a destination folder to store the converted reports. Also select an output
format (Section Report, Page Report, RDL Report or All) for each report in the Output Format column.
8. Once the conversion process is complete, click Finish to close the wizard and go the destination folder to
view the converted reports. You may optionally leave the check on for the Open Log file checkbox to see
the results log.
The import wizard converts reports to the closest possible ActiveReports format, but due to differences between
Please refer to the additional information below, to understand the conversion process in detail.
Getting Started
Quickly begin using ActiveReports by reviewing some of the most commonly used features.
Viewer HtmlExport
WebViewer PdfExport
Designer RtfExport
ReportExplorer TextExport
Toolbox TiffExport
XlsExport
4. For the Silverlight Viewer control, go to the Silverlight Components tab and select Viewer.
5. Click OK to add the controls to the selected toolbox tab.
Caution: ActiveReports controls may not appear in the toolbox unless your project is using .NET 3.5 or
later.
To use ActiveReports in a Visual Studio project, you add one of the included report templates.
3. In the Name box, type a name for the report, and click Add. The selected report type is added to your
project and opens in the report designer.
Note: When you add a report layout the Viewer assembly (GrapeCity.ActiveReports.Viewer.Win.v9.dll) is not
added automatically to the project references. You may need to manually add it in your project if required.
RDL Report
Section Report
Visual Basic.NET code. Paste INSIDE the Form Load event.
' Create a new Section report instance
Dim sectionReport As New GrapeCity.ActiveReports.SectionReport()
Viewing Reports
ActiveReports provides a number of ways to view your report output. You have an option of previewing the report
as you create it in a Visual Studio project at design time.
With the in-built Viewers for Windows Forms, Web and Silverlight, you can view your report in any of these
platforms as well in a separate viewer control. The following topics introduce all the available report viewing
options.
In this section
Using the Viewer
This section explains how to view a report in the Windows Forms Viewer and demonstrates the Viewer's features,
touch gestures and shortcut keys.
ActiveReports and the Web
This section introduces the Web Viewer where you can view your report output in various types of viewers and
provides key features of each viewer type.
Using the Silverlight Viewer
This section describes how to view a report in the Silverlight viewer and introduces its toolbar and features.
Using the WPF Viewer
This section describes the WPF Viewer toolbar, its additional features and how to view a report in the WPF viewer.
Pan mode A hand symbol serves as the cursor that you can use
to navigate.
Selection Allows you to select contents on the report. Click the
mode Copy icon (see image and description below) to copy
the selected content to the clipboard.
Snapshot Allows you to select content on the report that you
mode can paste as an image into any application that
accepts pasted images.
Toggle Displays the sidebar that includes the Thumbnails,
sidebar Parameters, Document map and Search results
panes.
Print Displays the Print dialog where you can specify the
printing options.
Galley mode Provides a viewer mode which removes automatic
page breaks from a Report Definition Language (RDL)
and displays data in a single page. This mode
maintains page breaks you create in the report and
removes only automatic page breaks.
Copy Copies text that you select in the Selection mode to
the clipboard.
Find Displays the Find dialog to find any text in the report.
Current zoom Displays the current zoom percentage which can also
be edited.
Zoom in Increases the magnification of your report.
Viewer Sidebar
The Viewer sidebar appears on the left of the Viewer control when you click the Toggle sidebar button in the
toolbar. By default, this sidebar shows the Thumbnails and Search Results panes. The additional Document map
and Parameters also appear in this sidebar. You can toggle between any of the viewer panes by clicking the
buttons for each pane at the bottom of the sidebar.
Thumbnails pane
The Thumbnails pane appears by default in the sidebar when you click the Toggle sidebar button in the toolbar.
This pane comprises of a thumbnail view of all the pages in a report. Click any thumbnail to navigate directly to
the selected report page. You can also modify the size of the thumbnail when you click (+) or (-) button to zoom
in and zoom out.
To search in a report:
Enter the word or phrase in the search field.
Under Use these additional criteria, you may optionally choose to search for the whole word or match
the case of the search string while searching in the report.
Click the Search button to see the results appear in the Find results list.
Click an item in the list to jump to that item in the report and highlight it.
To start a new search or clear the current search results, click the Clear button under the Find results list.
Document map pane
The Documents map pane is enabled for reports where the Label property or the Document map label is set. This
pane displays each value for the text box, group, or sub report that you label, and you can click them to navigate
to the corresponding area of the report in the Viewer.
If a report does not have the Label property or Document map label set, the Documents map pane does not
appear in the sidebar.
Parameters pane
The Viewer allows you to view reports with parameters. In the toolbar, click the Toggle sidebar button to open
the Viewer sidebar and if your report contains parameters, the Parameters pane shows up automatically.
1. In the Parameters pane, you are prompted to enter a value by which to filter the data to display.
2. Enter a value or set of values and click View report, to filter the report data and display the report.
If a report does not have parameters, the Parameters pane does not appear in the sidebar.
The following example demonstrates how you display a RDL Report in the Viewer control.
Visual Basic. NET code. Paste INSIDE the Form_Load event.
Dim file_name As String = "..\..\RdlReport1.rdlx"
Dim pageReport As New GrapeCity.ActiveReports.PageReport(New
System.IO.FileInfo(file_name))
Dim pageDocument As New GrapeCity.ActiveReports.Document.PageDocument(pageReport)
Viewer1.LoadDocument(pageDocument)
The following example demonstrates how you can display a section report (code-based) in the Viewer
control.
Visual Basic. NET code. Paste INSIDE the Form_Load event.
Dim sectionReport As New SectionReport1()
Viewer1.LoadDocument(sectionReport)
The following example demonstrates how you can display a section report (xml-based) in the Viewer
control.
Visual Basic. NET code. Paste INSIDE the Form_Load event.
Dim sectionReport As New GrapeCity.ActiveReports.SectionReport()
Dim xtr As New System.Xml.XmlTextReader("..\..\SectionReport1.rpx")
sectionReport.LoadLayout(xtr)
xtr.Close()
Viewer1.LoadDocument(sectionReport)
The following example demonstrates how you display a RDL Report in the Viewer control.
The following example demonstrates how you can display a section report (code-based) in the Viewer
control.
C# code. Paste INSIDE the Form_Load event.
SectionReport1 sectionReport = new SectionReport1();
viewer1.LoadDocument(sectionReport);
The following example demonstrates how you can display a section report (xml-based) in the Viewer
control.
Additional Features
Following is an introduction to the additional capabilities of the Viewer to guide you on using it effectively:
Split windows
1. Run your viewer project.
2. Click above the vertical scrollbar to grab the splitter control and drag downward.
3. With the viewer split into two sections, you can easily compare report pages.
Advanced Printing Options
Viewer provides advanced printing options that allow you to control the report page layout and watermark settings
through the Page Setup dialog. In this dialog, you can also preview the report as it would appear with each print
setting. See Use Advanced Printing Options for further details.
You can also set the PrintingSettings ('PrintingSettings Property' in the on-line documentation) property
of the Viewer to directly print without displaying a dialog or to switch from a ActiveReports print dialog to a .NET
Framework standard print dialog (System.Windows.Forms.PrintDialog) on clicking the Print button on the Viewer
toolbar. You can set the PrintingSettings property of the Viewer control from the Properties window.
ShowPrintDialog Displays a dialog in which the user can set the printer options
before printing.
ShowPrintProgressDialog Displays a print progress dialog, in which the user can cancel the printing
job.
UsePrintingThread Specifies whether printing should be performed for individual threads or
not.
UseStandardDialog Specifies whether to use the .NET Framework standard print dialog
(System.Windows.Forms.PrintDialog) while printing the document
(section or page).
Exporting
Use the Export Filters to export a page or a section report to different formats directly from the Viewer. After you
load the document in the Viewer, you can use a sample code like the following which shows one overload of the
Export ('Export Method' in the on-line documentation) method with a PDF export filter. This code creates an
outputPDF.pdf file in the bin\debug folder of your project.
To write the code in Visual Basic.NET
Visual Basic. NET code. Paste INSIDE an event like Button_Click event.
Dim PDFEx As New GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport
Viewer1.Export(PDFEx, New FileInfo(Application.StartupPath + "\outputPDF.pdf"))
Note: Make sure that you add a reference to the required export assembly in your project before setting the
export filter in code. See Export Filters further details.
Annotations Toolbar
You can use annotations when working with a report in the Viewer and add notes, special instructions or images
directly to the reports.
Annotations are added via the Viewer's toolbar, which is hidden by default. You can make the Annotations toolbar
available by setting the AnnotationToolbarVisible property to true in the viewer's properties grid.
Keyboard Shortcuts
The following shortcuts are available on the Viewer:
Keyboard Action
Shortcut
Up Arrow Goes to the previous page.
Down Arrow Goes to the next page.
Right Arrow Goes to right page. If no thumbnail exist on the right, it goes to the next page.
Left Arrow Goes to left page. If no thumbnail exist on the left, it goes to the previous page.
Page Down Scroll to the next thumbnail's view port. It also keep the current selected page
unchanged.
Page Up Scroll to the previous thumbnail's view port. It also keep the current selected page
unchanged.
Home Goes to the first page.
End Goes to last page.
Touch Support
ActiveReports introduces touch support for Windows Viewer. This feature gives you the flexibility to interact with
the Viewer using simple touch gestures. Now you can install ActiveReports on any touch enabled Windows device
and view the reports anywhere you are.
You can switch to the touch mode by just clicking the Touch mode button on the Viewer toolbar.
Note: In touch mode, you can still use the mouse to perform ActiveReports operations.
Print Displays the Print dialog where you can specify the printing options.
Galley Provides a viewer mode which removes automatic page breaks from a Report
mode Definition Language (RDL) and displays data in a single page. This mode
maintains page breaks you create in the report and removes only automatic
page breaks.
For RDL report only.
Copy Copies text that you select in the Selection mode to the clipboard.
Note: In case the GrapeCity.ActiveReports.Export.Xml.v9.dll and
GrapeCity.ActiveReports.Export.Word.v9.dll are not available in GAC, you
might need to add references to these assembly files to enable the
viewer's Copy button.
Find Displays the Find dialog to find any text in the report.
Current Displays the current zoom percentage which can also be edited.
zoom
Multiple Offers you an option to select how many pages to preview in the viewer at one
page time.
Previous Takes you to the page prior to the current page. This button is enabled when a
page page other than the first page is open.
Current Opens a specific page in the report. To view a specific page, type the page
page number and press the Enter key.
Next page Takes you to the page following the current page. This button is disabled on
reaching the last page of the report.
Context menu
To display the context menu, you must tap and hold in the preview area.
Preview
Selection mode, Pan from selection start point to selection end point.
Snapshot mode
Double Preview Area Tap twice to change the view mode (from the Single page view
tap to the Multiple page mode).
Selection mode, Displays the context menu where you can select the pan,
Tap and Snapshot mode selection, or snapshot mode.
hold
Professional Edition
Important: Before using the WebViewer control, you must first Configure HTTPHandlers in IIS 7 and IIS 8.
In this section
Getting Started with the Web Viewer
Explore the ways that the WebViewer control can save you time.
Using the HTML5 Viewer
Learn about the features available with the HTML5 Viewer.
Medium Trust Support
Learn about the features and limitations available in Medium Trust Support environment.
Standard Edition
With the Standard Edition license, you can export reports to use on the Web or use Web Services to distribute
reports or data sources. For more information on Web exporting, please see the Custom Web Exporting (Std
Edition) section.
Set the Report property to a new instance of an ActiveReport class as shown in the examples below.
To write the code in Visual Basic.NET (Page report/RDL report)
VB code. Paste INSIDE the Page Load event
Dim rpt As New GrapeCity.ActiveReports.PageReport()
rpt.Load(New System.IO.FileInfo(Server.MapPath("")+"\invoice.rdlx"))
WebViewer1.Report = rpt
Note: You can use either the ReportName property or the Report property to bind a report to the WebViewer. If you
use both properties, you will get the error message.
5. You must also Configure HTTPHandlers in IIS 6 on your server so that IIS knows how to associate ActiveReports files in the browser.
Property Description
DisplayTransparency Specify whether to print transparent objects.
HyperLinkBackColor Specify the background color of hyperlinks displayed in the viewer.
HyperLinkForeColor Specify the color of hyperlink text.
HyperLinkUnderline Specify whether hyperlink text is underlined.
MultiPageViewColumns Specify the number of columns to show when the ViewType is set to
MultiPage.
MultiPageViewRows Specify the number of rows to show when the ViewType is set to
ScalePages Specify how to handle page scaling during printing. Select from:
None (pages are not scaled)
Auto (pages are scaled down if they do not fit on the
paper)
AllowScaleUp (pages are scaled up or down to best fit the
paper)
StartPrint Specify whether to print the report after loading for one-touch
printing. If you set the WebViewer's Height and Width properties to
0, you can print the report without displaying the Print dialog.
ResourceLocale Specify the Culture for localization. Separate multiple values with
commas.
ResourceUrl Specify a comma-separated list of URLs to SWF files with resource
bundles.
SearchResultsBackColor Specify the background color used to highlight search results text in
report pages.
SearchResultsForeColor Specify the text color for highlighted search results text in report
pages.
ShowSplitter Specify whether to display the splitter, which allows the user to
compare report pages in the viewer.
ThemeUrl Specify the relative URL of a theme to use on the FlashViewer. The
following themes are included, and can be found in
...\GrapeCity\ActiveReports 9\Deployment\Flash\Themes. Add them
to your project to use them.
FluorescentBlue.swf
Office.swf
OliveGreen.swf
Orange.swf
VistaAero.swf
WindowsClassic.swf
XP.swf
TocPanelOptions Alignment Specify the alignment of the table of contents pane. Select from Left
or Right.
ShowThumbnails Specify whether to display a pane with thumbnail views of pages.
ShowToc Specify whether to display the table of contents in the FlashViewer.
Visible Specify whether to show the table of contents pane initially, without
requiring the user to click the Toggle Sidebar button.
Width Specify the width of the table of contents pane in pixels.
Url Specify the relative URL of the FlashViewer control. If you leave this
value blank, ActiveReports looks in the main Web folder.
Zoom Specify the zoom level, between 10% and 800%, at which to
display the report.
Caution: As with any other Flash application, browser keyboard shortcuts do not work if the Flash Viewer
has focus. Click anywhere outside the Flash Viewer to give focus back to the browser to use browser
keyboard shortcuts. Likewise, to use the Flash Viewer keyboard shortcuts, click the Flash viewer to give
focus back to the Flash Viewer if focus is on the browser.
Print
1. On the Flash Viewer toolbar, click the Print button.
2. In the Print dialog that appears, select the printer settings and click Print.
Page Range
1. On the Flash Viewer toolbar, click the Page Range button.
2. In the Page range dialog that appears, select All for all pages, Current Page for the current page, or
Range to specify pages for printing and then click OK.
3. On the Flash Viewer toolbar, click the Print button and then, in the Print dialog that appears, click Print.
Note: With the ViewerType of WebViewer control set to FlashViewer, you can only use hyperlinks and
document map interactive features.
Note: You need to modify the IIS Express setting when loading an RDF file in the Flash Viewer using client-
side scripts. For more details, go to the Flash Viewer Troubleshooting section in Troubleshooting.
Property Description
The HtmlViewer downloads only HTML and javascript to the client browser.
Go to page Opens a specific page in the report. To view a specific page, type
the page number and press ENTER.
Go to Navigates through a report page by page.
Previous/Next
page
Go to First/Last Jumps to the first or last page of a report.
page
Back to parent Returns to the parent report in a drill-down page report or RDL
report report.
Note: You can obtain the ClientId from the WebViewer control.
ViewerViewModel
In order to work with the API, obtain an instance of the ViewerViewModel first, using the GetViewModel(clientId) javascript function that searches ViewerViewModel
array through the clientId. This function throws an exception if there is no ViewerViewModel with the requested clientId available.
Use code like the following to call an instance of the ViewerViewModel:
var viewModel = GetViewModel(clientId);
After obtaining the ViewerViewModel, the code can call API methods and properties.
Print this.Print() Prints the report using pdf printing. In order to print without
any errors the PageLoaded() property must be True.
SidebarViewModel
SidebarViewModel allows you access to its various properties and methods to get the current state and show/hide sidebar and sidebar panels.
Save As Displays the drop-down list of formats to export the report. The
available options are PDF Document, Word Document, Image
File, MHTML Web Archives, and Excel Workbook. Tapping the
menu item exports the report to the selected format.
2/124 Current Displays the current page number and page total. Enter the page number to view
Page a specific page.
Back to Returns to the parent report in a drill-through page report.
Parent
In the Parameters pane, click the button to open the Parameters Value editor where you can choose or enter
values depending on the parameter type.
After you select or enter the values, click the Back button to navigate to Parameters Pane. Click the View Report
button to view the report according to the selected parameter values.
If a report does not have parameters, the Parameters button in the toolbar is disabled. For more information,
see Parameters.
HTML5 Viewer Mobile Search Pane
The Search pane appears when you tap the Search button in the toolbar.
This pane allows you to search for a specific text in the report.
To search in a report:
Enter the word or phrase in the search field.
Under the search field, you may choose to use the Match case and Whole phrase options while
searching in the report.
Click the Search button to see the results appear below the Search button.
Click an item in the list to jump to that item in the report.
2/124 Current page Displays the current page number and page total. Enter the page
number to view a specific page.
Next Navigates to the next page of the displayed report.
Save As Displays the drop-down list of formats to export the report. The
available options are PDF Document, Word Document, Image File,
MHTML Web Archives, and Excel Workbook. Tapping the menu item
exports the report to the selected format.
Click View Report button to view the report according to the selected parameter values.
Note: Internet Explorer and Mozilla Firefox browsers do not support the display of DatePicker control in the
Caution: For a DateTime type parameter in HTML5 Viewer, the FormatString for the DatePicker is
represented with (mm/dd/yyyy) while the TimePicker is represented with dashes (--:--:-- --).
To search in a report:
Enter the word or phrase in the search field.
Under the search field, you may choose to use the Match case and Whole phrase options while
searching the report.
Click the Search button to see the results appear below the Search button.
Click an item in the search results to jump to that item in the report.
Note: When using input tags in the HTML 5 viewer, please note that due to limitations in certain browsers,
the datetime-local type may not appear correctly.
Initialization Options
The following options can be set during initialization or at runtime while working with the HTML5 Viewer.
uiType
element
Description: JQuery selector that specifies the element that hosts the HTML5 Viewer control.
Type: String
Example:
var viewer = GrapeCity.ActiveReports.Viewer( { element: '#viewerContainer2', reportService: { url: '/ActiveReports.ReportService.asmx' }, });
reportService
Description: The report service that can use ActiveReports Server or ActiveReports Web Report Service.
Type: Object that has the url and optional securityToken properties
Example:
reportService: { url: 'http://remote-ar-server.com', securityToken: '42A9CD80A4F3445A9BB60A221D042FCC', resourceHandler: 'http://remote-ar-server.com/resourceHandler.aspx' };
reportService.url
Description: The url of AR9 Server instance of the AR9 Web service that provides the reportInfo and output.
Type: String
Example:
reportService: { url: 'http://remote-ar-server.com' };
reportService.securityToken
Description: The security key needed to login to the AR9 server.
Type: String
Example:
reportService: { securityToken: '42A9CD80A4F3445A9BB60A221D042FCC' };
reportService.resourceHandler
Description: The url of the AR9 Server resource handler.
Type: String
Example:
reportService: { resourceHandler: 'http://remote-ar-server.com/resourceHandler.aspx' };
report
Description: The report that is displayed in ActiveReports Server or ActiveReports Web Report Service.
Type: An object that has id and parameters properties.
Example:
report: { id: 'CustomersList', parameters: [ { name: 'CustomerID', value: 'ALFKI' }] };
reportID
Description: The id of the report to be shown by the HTML5 Viewer.
Type: String
Example:
Example:
report: { id: 'CustomersList', parameters: [ { name: 'CustomerID', value: 'ALFKI' }] };
reportParameters
Description: The array of the {name, value} pairs that describe the parameters values used to run the report.
Type: Array
Example:
report: { id: 'CustomersList', parameters: [ { name: 'CustomerID', value: 'ALFKI' }] };
reportLoaded
Description: The callback that is invoked when the HTML5 Viewer obtains the information about the requested report. The reportInfo object is passed in the callback including the TOC info, Parameters info and
the link to the rendered report result.
Type: function(reportInfo)
Example:
var reportLoaded = function reportLoaded(reportInfo) { console.log(reportInfo.parameters); } viewer.option('reportLoaded', reportLoaded);
action
Description: The callback that is invoked before the HTML5 Viewer opens the hyperlink, bookmark link, drill down report or toggles the report control visibility.
Type: function(actionType, actionParams)
Example:
function onAction(actionType, actionParams) { if (actionType === 0) { window.open(params.url, "Linked from report", "height=200,width=200"); } } viewer.option('action', onAction);
availableExports
Description: The array of export types available via Export functionality of HTML5 Viewer. Available export formats are 'Pdf', 'Image', 'Word', 'Html' and 'Xls'.
Type: Array
Example:
viewer.option("availableExports", ['Pdf']);
maxSearchResults
Description: The number of search results received for a single search invoke.
Type: Number
Example:
maxSearchResults: 10
error
Description: The callback that is invoked when an error occurs in the process of displaying the report.The error message can be customized.
Type: function(error)
documentLoaded
Description: The callback that is invoked when a document is loaded entirely on the server.
Type: function()
Example:
var documentLoaded = function documentLoaded() { setPaginator(); } viewer.option('documentLoaded', documentLoaded);
localeUri
Description: The url of the file containing the localization strings.
Type: String
Example:
var viewer = GrapeCity.ActiveReports.Viewer( { localeUri: 'Scripts/i18n/ru.txt' });
Methods
option
Description: Gets or sets the option value by name if the value parameter is specified.
Syntax: option(name,[value])Object
Parameters:
name: The option name to get or set.
value: (optional) The option value to set. If this argument is omitted than the method returns the current option value.
Example:
viewer.option('uiType', 'mobile'); viewer.option('report', { id: 'my report' });
Example:
viewer.refresh()
Example:
viewer.print()
Parameters:
number: The number of pages to go to.
offset object: The object such as {left:12.2, top:15}.
callback: The function to call after perform action.
Example:
viewer.goToPage(1, { 2, 3 }, function onPageOpened() {});
Example:
viewer.backToParent()
Parameters:
exportType: Specifies export format. Available export formats are 'Pdf', 'Word', 'Html' and 'Xls'.
callback: Function that is invoked once the export result is available (its Url is passed in the callback).
saveAsDialog: Indicates whether the save as dialog should be shown immediately once the export result is ready.
settings: The export settings are available for RenderingExtensions (Page and RDL reports).
Example:
Parameters:
callback: The callback to handle TOC tree.
Example:
viewer.getToc(function (toc) { console.log(toc); })
Properties
pageCount
Description: Gets the page count of the currently displayed report.
Syntax: viewer.pageCount
Example:
console.log(viewer.pageCount)
Example:
// Toolbar, MobileToolbarTop, MobileToolbarBottom $(viewer.toolbar).hide(); $(viewer.toolbarTop).hide(); $(viewer.toolbarBottom).hide();
ToolbarTop
Description: Returns the HTML element that displays the top toolbar in mobile UI mode.
Syntax: viewer.ToolbarTop
Example:
// Toolbar, MobileToolbarTop, MobileToolbarBottom $(viewer.toolbar).hide(); $(viewer.toolbarTop).hide(); $(viewer.toolbarBottom).hide();
ToolbarBottom
Description: Returns the HTML element that displays the bottom toolbar in mobile UI mode.
Syntax: viewer.ToolbarBottom
Example:
// Toolbar, MobileToolbarTop, MobileToolbarBottom $(viewer.toolbar).hide(); $(viewer.toolbarTop).hide(); $(viewer.toolbarBottom).hide();
Note: In ActiveReports, these files are located in the C:\Program Files\GrapeCity\ActiveReports 9\Deployment\Html
3. In the target HTML page, add the references to the GrapeCity.ActiveReports.Viewer.Html.css, GrapeCity.ActiveReports.Viewer.Html.js and its following dependencies:
jQuery 1.9.0 or higher
Bootstrap 3.0
Knockout.js 2.3.0 or higher
Note: You can obtain the dependencies like jQuery from Content Delivery Network (CDN) or copy them locally.
5. In the target HTML page, add the DIV element that will contain the HTML5 Viewer.
Paste inside the <body></body> tags
<div id="viewer" style="width:800px;height:600px;"></div>
8. In the Add New Item dialog that appears, select ActiveReports 9 Web Service and click Add. The ActiveReports9 Web Service is required for the proper functioning of the HTML5 Viewer.
9. Add an ActiveReport to the Visual Studio project. See Adding an ActiveReport to a Project for information on adding different report layouts.
10. Add the following code to view your report in the HTML5 Viewer. The code might vary depending on the technology that you use to develop the HTML5 Viewer component.
Paste inside the <script></script> tags
$(function ()
{
var viewer = GrapeCity.ActiveReports.Viewer(
{
},
reportService: {
url: '/ActiveReports.ReportService.asmx'
},
uiType: 'desktop'
});
});
The following steps describe how to access reports from different domain using CORS.
1. Add Global Application Class file (Global.asax) in your application on the service side.
2. Open the Global.asax.cs file, and add the following code to access reports using cross websites.
Paste inside the Global.asax.cs
protected void Application_BeginRequest(object sender, EventArgs e) { HttpContext.Current.Response.AddHeader("Access-Control-Allow-Origin", "*"); if (HttpContext.Current.Request.HttpMethod == "OPTIONS") { HttpContext.Current.Response.AddHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS"); HttpContext.Current.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept"); HttpContext.Current.Response.End(); }
Note: In case of Internet Explorer 9, you need to add $.support.cors = true; code on the client side while initializing the HTML5 Viewer to access reports from a different domain.
Caution: Assemblies placed in the Global Assembly Cache, or GAC (C:\WINDOWS\ASSEMBLY), have Full
trust permissions, so the results on your deployment machine may differ from those on your development
machine.
Note: If you see an evaluation banner when deploying your ActiveReports project, you should use the Web
Key Generator utility to create the Web Key and integrate the license information into your project.
Feature Limitations
1. Exporting
RTF, Text, TIFF and Excel filters are not supported in Medium trust.
Digital signatures cannot be used in case of PDF rendering extension and PDF export.
Chart and Matix control of Page Reports and RDL Reports are not displayed properly in case of
PDF rendering extension and PDF export.
2. The End User Designer and Windows Form Viewer controls require Full trust.
3. The Picture control does not support metafiles, which require Full trust.
4. The ImageType property of the Chart control must be set to PNG.
5. OleObject, FormattedText and Custom controls require Full trust.
6. Scripting requires Full trust, so if you need to use code in reports under Medium trust, use code-based
reports rather than RPX format.
7. WebViewer
Bullet, Sparkline and Calendar control of PageReports and RDLReports are not displayed in all the
Viewer types.
Report containing the Image control of PageReports and RDLReports is not displayed properly in
case of HTML type.
Note: Microsoft Silverlight 4 Tools are required for application development with the ActiveReports Silverlight
Viewer.
Fit page Fits the width of the page according to viewer dimensions.
width
Fit whole Fits the whole page within the current viewer dimensions.
page
First Takes you to the first page of the report. This button is enabled when a page
page other than the first page is open.
Previous Takes you to the page prior to the current page. This button is enabled when
page a page other than the first page is open.
Current Shows the current page number and opens a specific page in the report. To
page view a specific page, type the page number and press the Enter key.
Next Takes you to the page following the current page. This button is disabled on
page reaching the last page of the report.
Last page Takes you to the last page of the report. This button is disabled on reaching
the last page of the report.
Backward Takes you to the last viewed page. This button is enabled when you move to
any page from the initial report page. Clicking this button for the first time
also enables the Forward button.
Forward Takes you to last viewed page before you clicked the Backward button. This
button is enabled once you click the Backward button.
See Provide PDF Printing in the Silverlight Viewer (Pro Edition) to learn how you can set up and print a report from
the Silverlight Viewer to PDF format.
Silverlight feature limitations
Limitations on printing:
ActiveReports Silverlight Viewer does not provide the one-touch printing option.
The maximum value for the print range is 2000 pages.
Vertical text is not supported in the ActiveReports Silverlight Viewer.
Horizontal and vertical text of MS PMincho and some other ideographic characters may render
incorrectly in the ActiveReports Silverlight Viewer.
The use of the Silverlight Viewer control in layout panels has a limitation related to the default size of
the panel.
The multipage mode is not available in the ActiveReports Silverlight Viewer.
To display a report with annotations in the Thumbnails view correctly, hide the Thumbnails view by
clicking the Show TOC/Thumbnails icon in the Toolbar and then open the report in the Silverlight Viewer.
IIS Express setting needs to be done when loading an RDF file in the Viewer. For more details, go to
the Silverlight Viewer Troubleshooting section in Troubleshooting.
Some Silverlight properties and events are not supported in XAML. However, you can still use these
properties by setting them in code as follows:
Visual Basic.NET code. Add this code in an event like Button_Click.
Viewer1.FontStyle = FontStyles.Italic
Warning: The TargetInvocationException occurs on running a WPF browser application in Partial Trust. Refer
to Running WPF Viewer in Partial Trust section given below to run your WPF Browser Application in
Partial Trust. To ensure that you are using Full Trust:
1. From the Visual Studio Project menu, select YourProject Properties.
2. On the Security tab, under Enable ClickOnce security settings, select the This is a full trust
application option.
To search in a report:
Enter the word or phrase in the search field.
Under Use these additional criteria, you may optionally choose to search for the whole word or match
the case of the search string while searching in the report.
Click the Search button to see the results appear in the Find results list.
Click an item in the list to jump to that item in the report and highlight it.
To start a new search or clear the current search results, click the Clear button under the Find results list.
If a report does not have the Label property or Document map label set, the Documents map panes does not
appear in the sidebar.
Parameters pane
The WPF Viewer allows you to view reports with parameters. In the toolbar, click the Toggle sidebar button to
open the WPF Viewer sidebar and if your report contains parameters, the Parameters pane shows up
automatically.
1. In the Parameters pane, you are prompted to enter a value by which to filter the data to display.
2. Enter a value or set of values and click View report, to filter the report data and display the report.
If a report does not have parameters, the Parameters pane does not appear in the sidebar.
5. In the Properties window, with the report selected, set Copy to Output Directory to Copy Always.
6. On MainWindow.xaml, with the viewer selected, go to the Properties window and double click the Loaded
event.
Note:
Refer to the LoadDocument ('LoadDocument Method' in the on-line documentation)
method to see other ways to load a report in WPF Viewer.
Microsoft .NET Framework version 4.0 or higher is required to view reports in WPF Viewer.
The following example demonstrates how you can display a section report (code-based) in the WPF Viewer
control.
Visual Basic.NET code. Paste INSIDE the viewer1_Loaded event in MainWindow.xaml.vb.
viewer1.LoadDocument(new YourReportName())
The following example demonstrates how you can display a section report (xml-based) in the WPF Viewer
control.
Visual Basic.NET code. Paste INSIDE the viewer1_Loaded event in MainWindow.xaml.vb.
Viewer1.LoadDocument("YourReportName.rpx")
The following example demonstrates how you can display a section report (code-based) in the WPF Viewer
control.
C# code. Paste INSIDE the viewer1_Loaded event in MainWindow.xaml.cs.
viewer1.LoadDocument(new YourReportName());
The following example demonstrates how you can display a section report (xml-based) in the WPF Viewer
control.
C# code. Paste INSIDE the viewer1_Loaded event in MainWindow.xaml.cs.
viewer1.LoadDocument("YourReportName.rpx");
Additional Features
Following is an introduction to the additional capabilities of the Viewer to guide you on using it effectively.
Keyboard Shortcuts
The following shortcuts are available on the WPF Viewer.
ShowPrintDialog Displays a dialog in which the user can set the printer options
before printing.
ShowPrintProgressDialog Displays a print progress dialog, in which the user can cancel the printing
job.
UsePrintingThread Specifies whether printing should be performed for individual threads or
not.
UseStandardDialog Specifies whether to use the .NET Framework standard print dialog
(System.Windows.Forms.PrintDialog) while printing the document
(section or page).
Note: These steps assume that you have already created a WPF Browser Application that contains the WPF
Viewer control.
1. In the Solution Explorer, right-click your WPF Browser Application and select Properties.
2. On the properties page that opens, go to the Security tab.
3. On the Security tab, set Zone your application will be installed from to Custom and click the Edit
Permissions XML button. This opens the app.mainfest file.
4. In the app.manifest file, replace the existing xml code inside the <applicationRequestMinimum>
</applicationRequestMinimum> tags with the following code.
Code
Note: The Partial Trust Limitations are applicable to the WPF viewer running in Partial Trust. For more
information, see Medium Trust Support.
4. In the Name field, enter a name for the report application, and click OK. The selected report type is added
to your project.
5. Go to the Visual Studio Solution Explorer and double-click Form1.cs or Form1.vb. Notice that the Viewer
control already appears on the form.
Note: If you run the application right after the new report project is created, a blank report appears
on the Form.
Concepts
Learn about concepts that help you to understand how best to use ActiveReports.
ActiveReports Designer
ActiveReports offers an integrated designer that lets you create report layouts in Visual Studio and edit them at
design time, visually, and through code, script, or regular expressions. Like any form in Visual Studio, it includes a
Property Window with extensive properties for each element of the report, and also adds its own Toolbox filled
with report controls, and a Report Explorer with a tree view of report controls.
The designer supports two types of report layouts: section layout and page layout.
Section Report Layout
This layout presents reports in three banded sections by default: page header, detail and page footer. You can
remove the page header and footer, add a report header and footer, and add up to 32 group headers and
footers. Drag controls onto these sections to display your report data. Reports designed in this layout are saved in
RPX format.
In this section
Design View
Explore the elements of the design tab that appear with both types of reports.
Report Menu
Learn about the options available in the Report menu in Visual Studio.
Designer Tabs
Find general information about the Designer, Script, and Preview tabs of the designer.
Designer Buttons
Learn to control grid settings, drag and drop settings, and mouse modes on the designer.
Page Tabs
Explore the ways that you can use different page layouts in the same report in Page Reports.
Toolbar
Learn about the commands available in the ActiveReports Toolbar.
Report Explorer
Learn how you can use the Report Explorer to manage the report controls, data regions, parameters, and other
items in your reports.
Layers List
Learn how you can use layers for tracing pre-printed layouts, performing target specific printing and exporting in
Page Reports and RDL Reports.
Toolbox
Design View
The report designer is fully integrated with the Microsoft VisualStudio IDE. In this topic, we introduce the main
parts of the designer in section and page reports to help you select the one to best suit your specific needs.
Report designer in section reports
In a section report, the designer offers the following features that you can use to create, design and edit a report.
Design Surface
The design surface offers a default report structure that contains a page header, a detail section, and a page footer
along with some grey area below these sections. Drag report controls and fields onto these sections to display your
data. Use section grab handles to drag a section's height up or down. Right click the report and select Insert to
add other types of header and footer section pairs.
DataSource Icon
The DataSource icon is located in the band along the top of the detail section. Click this icon to open the Report
Data Source dialog, where you can bind your report to any OLE DB, SQL, or XML data source. See Report Data
Source Dialog for more information.
Section Collapse Icon
A Section Collapse icon (-) appears on each band adjacent to the section header. When you click the collapse icon
the section collapses and an expand icon (+) appears. Please note that section collapse is only available in the
Designer tab. All sections of the report are visible in the Preview tab or when the report is rendered.
Tip: In order to make a section invisible, set the Height property of the section to 0 or the Visible property
to False.
Rulers
Design Surface
The design surface of a report appears initially as a blank page and grid lines. You can create your own layout and
drag report controls and fields onto the design surface to display your data.
Rulers
Use the ruler to determine how your report will look on paper. Please note that you have to add the right and left
margin widths to determine whether your report will fit on the selected paper size. See Rulers for more
information.
Designer Tabs
The designer provides three tabs: Designer, Script and Preview. You can create your report layout visually in
the Designer tab, add script to report events in the Script tab to implement .NET functionality, and see the result
in the Preview tab. See Designer Tabs for more information.
Page Tabs(Page Report)
By default, the designer provides two page tabs, Page 1 and New, below the design surface. Each page tab
represents a layout page of the report. Page 1 represents the first page of your report, and you can click New to
Tip: ActiveReports provides some useful keyboard shortcuts for the controls placed on the design surface.
Arrow Keys: To move control by one grid line.
[Ctrl] + Arrow Keys: To move control by 1/100 inch (around 0.025 cms)
[Shift] + Arrow Keys: To increase or decrease the size of the control by one grid line.
Report Menu
The Report menu provides access to common reporting operations. To show the Report Menu in the Visual Studio
menu bar, select the Design View of the report in the ActiveReports Designer. This menu does not appear in the
menu bar when the report is not selected.
The following drop-down sections describe the Report menu items. Menu items differ based on the type of report
layout in use.
Report menu for section reports
Report Opens the Report dialog to the Parameters page where you can manage, add and
Parameters delete parameters.
Embedded Opens the Report dialog to the Images page, where you can select images to embed in
Images a report. Once you add images to the collection, they appear in the Report Explorer under
the Embedded Images node.
Report Properties Opens the Report dialog to the General page where you can set report properties such
as the author, description, page header and footer properties, and grid spacing.
Set Master Report Opens the Open dialog to select a Master Report (RDLX-master file format) to apply to
the current project.
Generate Excel Creates an Excel template of the report that you or the end user can customize for use
Template with Excel exports to control the way the exported reports appear.
View Opens the Designer, Script or Preview tab. See Designer Tabs for more details.
Designer
Script
Preview
Designer Tabs
The Designer has three tabs located at the bottom of the report design surface. Create a report layout in the
Designer Tab
The Designer tab appears by default on your designer. This tab is used to design your report layout visually. You
can implement most of the design-time features here, drag controls from the toolbox to create a layout, bind data
regions to data, and set properties for the report and controls through the context menu.
Tip: Layout-related features like designer buttons and zoom slider can be used in this tab to help you
manage your report display efficiently.
Script Tab
The Script tab opens the script editor, where you can provide VB.NET or C# functionality to the reports without
compiling the .vb or .cs files. You may use either Visual Basic or C# script in this tab with section reports, or Visual
Basic with page reports and RDL reports.
The generated reports serve as stand-alone reports which you can load, run, and display in the viewer control
without the designer. This feature is useful when distributing reports without recompiling.
In page reports/RDL reports, you can embed code blocks that you can reference in the expressions you use on
report controls. See Using Script for more information about using script.
In section reports, you can add code to object events. The two drop-down boxes in the script editor allow you to
select any section of the ActiveReport and any events associated with that section, or the report itself and related
events. When you select an event, the script editor generates a method stub for the event. See Add Code to
Layouts Using Script for more information about scripting in section reports.
Preview Tab
The Preview tab allows you to view your report without the need to actually run your project. This makes it easy
to quickly see the run-time impact of changes you make in the designer or the code.
This tab does not display data in the following conditions:
Code or script in the report class is incorrect.
Report class constructor has been changed.
Report data source has not been set correctly.
Settings have been implemented outside the report class
.mdb file is being copied in the project
When the report is inherited from a class other than ActiveReports, preview is possible only when the base class is
in the same project. If the base class is not in the same project and is referencing an external class library, you
will not get a preview in the Preview tab.
Designer Buttons
Designer buttons are located to the right of the designer tabs along the bottom of the designer, and are enabled
when you are on the Designer tab. They allow you to control settings for the design surface.
Grid Settings
Dimension Lines
Dimension lines appear during a drag operation, and run from the borders of the report control or data region
being moved or resized to the edges of the report designer surface. Dimension lines let you track the location of
the control as you move it by displaying the distance between the control and the edge of the writable area of the
report.
Note: With section reports, you can change the number of grid columns and rows in the Report Settings
dialog on the Global Settings tab. With page reports and RDL reports, you can change the grid spacing in the
Report Properties dialog on the General tab.
Hide Grid
By default, grid lines and dots appear on the report design surface. You can click this button to hide the grid and
design your report on a blank page. Lines or dots are also removed from the design surface when you hide the
grid, but Snap to Lines or Snap to Grid settings remain unaffected.
Show Dots
You can click this button to have dots appear on the design surface in between the grid lines to guide you in the
placement of controls.
Show Lines
You can click this button to have faint grey lines appear on the design surface in between the grid lines to guide
you in the placement of controls.
Tip: If you plan to export a report to Excel format, use Snap Lines or Snap to Grid to ensure that your
controls are aligned in columns and rows as it prevents overlapping. This makes the export to excel closer to
how a report looks at run or design time.
Snap Lines
This setting aligns the control you are dragging with other controls on the report design surface. When you drag
the control around, snap lines appear when it is aligned with other controls or with the edges of the report, and
when you drop it, it snaps into place in perfect alignment. See Snap Lines for more information.
Snap to Grid
This setting aligns the control you are dragging with grid lines on the report design surface. When you drop the
control, it snaps into place in alignment with the nearest grid mark. To place your controls freely on the report
design surface, turn this setting off.
Mouse Modes
These settings allow you to specify how you want the mouse to behave in the designer.
Select Mode
In Select mode, when you click items on the report designer surface, you select them. Use this mode for editing,
data binding and styling in the Designer tab. An arrow cursor appears in the Select mode.
Pan Mode
Use the Pan mode to make navigation easier. A hand cursor appears in Pan mode and you can navigate through
your report by pressing the left mouse button and dragging the report to the desired position.
Tip: To enable Pan mode while you are in Select Mode, hold down the middle mouse button and move to the
desired location with the hand cursor.
Page Tabs
Page tabs appear in an Excel-like bar below the report design surface. This feature is only available in page
reports, where report layouts are designed on separate pages and you can control the way each page appears.
Using page tabs, you can select which page to view or edit, add new pages, remove existing pages, reorder
pages, and create duplicate pages.
By default, a new report has a Page 1 tab and a New tab.
Page 1: This is the layout for the first page of the report. If no other page layouts exist, the layout on
this page is applied to the entire report.
New: Click to add a new page where you can create a layout for pages displayed after the first page.
Right-click any page tab (except the New tab) to get a context menu that allows you to Insert a new page,
Duplicate the page, or Delete the page.
Adding a new page
To add a new page, click the New tab.
A new page tab with an incremented page number appears to the right of any existing page tabs. This page has
the same page size and margins as the previous page. The New tab moves to the right of the newly added page.
Inserting a page
To insert a page, right-click the page tab and select Insert. A page is inserted to the left of the selected page. It
has the same page size and margins as the selected page.
Deleting a page
To delete a page, right-click the page tab that you want to remove and select Delete. This option is disabled if
there is only one page in the report.
Creating a copy of a page
Note: When the duplicate page contains a data region, ActiveReports replaces the data region with an
OverflowPlaceHolder on the new page. Reset the OverflowName ('OverflowName Property' in the on-
line documentation) property for the duplicated page to maintain the overflow data chain between page
tabs.
Reordering pages
To change the order of page tabs, drag a tab and drop it at the desired location. The tab is inserted in the chosen
location and the page number is updated according to its position. The page numbers of other tabs also change
automatically.
You can cancel the move operation by pressing the [Esc] key while dragging the tab.
Toolbar
ActiveReports provides a toolbar integrated with the Visual Studio IDE for quick access to report designing
commands. This toolbar comprises of buttons and dropdown lists which offer functions for a number of commonly
used commands.
Note: Toolbar descriptions are grouped in a logical order for understanding. The buttons and dropdowns may
appear in a different order in the ActiveReports toolbar.
Text Decoration
Command Description
Style Offers a dropdown list of selectable styles for formatting text in controls like Label,
TextBox, CheckBox and ReportInfo. These styles are available in a section report
only.
Font Size Sets the font size of all the text in a control.
Fore Color Opens a Choose Color dialog to set the text color of controls.
Back Color Opens a Choose Color dialog to set the background color of controls.
Bold Sets or removes text emphasis from the entire text of the control.
In section report, for the RichTextBox control, bold applies to the selected text
only. In a page report or a RDL report, for a data region like Matrix or Table, you
can change the emphasis of the entire text or only the text of the selected
TextBox within the region.
Italic Sets or removes text slant for the entire text of the control.
In a section report, for the RichTextBox control, italic applies to the selected text
only. In a page report or a RDL report, for a data region like Matrix or Table, you
can italicize the entire text or only the text of the selected TextBox within the
region.
Underline Sets or removes the text underline for the entire text of the control.
In a section report, for the RichTextBox control, underline applies to the selected
text only. In a page report or a RDL report, for a data region like Matrix or Table,
you can also underline the entire text or only the text of the selected TextBox
within the region.
Text Alignment
Command Description
Align Left Aligns the text to the left in the control area.
Align Right Aligns the text to the right in the control area.
Layout Editing
Command Description
Zoom In Increases the magnification level of the design surface and any elements within it.
Zoom Opens a dropdown list to set the magnification level of the design surface between 50% and
400%. Zoom percentage is set to 100% by default.
Control Alignment
Command Description
Align to Snaps the top left of the selected control to the closest gridline.
Grid
Align Aligns the selected controls with their left border coinciding with the left border of the primary
Lefts control. The vertical space separating the controls remains the same.
Align Aligns the selected controls with their right border coinciding with the right border of the primary
Rights control. The vertical space separating the controls remains the same.
Align Aligns the selected controls with their top border coinciding with the top border of the primary
Tops control. The horizontal space separating the controls remains the same.
Align Aligns the selected controls vertically to the middle with respect to the primary control. The
Middles horizontal space separating the controls remains the same.
Align Aligns the selected controls with their bottom border coinciding with bottom border of the primary
Bottoms control. The horizontal space separating the controls remains the same.
Control Resizing
Command Description
Make Same Width Resizes the width of the selected controls to the width of the primary control.
Make Same Resizes the height of the selected controls to the height of the primary control.
Height
Make Same Size Resizes the size (width and height) of the selected controls to the size of the primary
control.
Size to Grid Snaps the selected control to the closest gridline by resizing the control on all four sides.
Control Spacing
Command Description
Make Horizontal Creates equal space between the selected controls with respect to the primary control,
Spacing Equal using the outermost edges of the controls as end points.
Increase Increases the horizontal spacing by one grid unit with respect to the primary control.
Horizontal
Spacing
Decrease Decreases the horizontal spacing by one grid unit with respect to the primary control.
Horizontal
Spacing
Remove Removes the horizontal space so that the selected controls move to the nearest edge of
Horizontal the top-left control.
Spacing
Make Vertical Creates equal space between the selected controls with respect to the primary control,
Spacing Equal using the top and bottom edges of the control as the end points.
Increase Vertical Increases the vertical spacing by one grid unit with respect to the primary control.
Spacing
Decrease Vertical Decreases the vertical spacing by one grid unit with respect to the primary control.
Spacing
Remove Vertical Removes the vertical spacing so that the selected controls move to the nearest edge of
Spacing the top-left control.
Command Description
Bring to Front Moves the selected controls to the front of all other controls on the report.
Send to Back Moves the selected controls behind all other controls on the report.
RichTextBox commands
Command Description
Bullets Adds or removes bullets from the selected text inside a RichTextBox control in a section report.
Indent Increases the indent of selected text in the RichTextBox control area in a section report.
Outdent Decreases the indent of selected text in the RichTextBox control area in a section report.
Others
Command Description
View Shows or hides the Report Explorer window. See Report Explorer for further details.
ReportExplorer
Reorder Opens the Group Order dialog, where you can drag and drop groups to rearrange them. This
Groups button is enabled when you have multiple groups in a section report.
Layer List Opens the Layer List window to displays a list of Layers in the report along with their visiblity
and lock options. Layer List Explorer also allows you to add or remove Layers from your
reports. See Working with Layers for further details.
Note: Primary control is the control in a selected group of controls, to which you align all other controls. It is
generally the first control selected in the group and has sizing handles (white boxes) which are different from
the rest of the selected controls.
Report Explorer
The Report Explorer gives you a visual overview of the report elements in the form of a tree view where each
node represents a report element.
Using the Report Explorer with any type of report, you can remove controls, add, edit or remove parameters, add
a data source, and drag fields onto the report. You can also select the report or any element in the report to
display in the Properties Window, where you can modify its properties.
ActiveReports supports three types of reports:
Section reports (in your choice of XML-based RPX or code-based CS or VB files)
Tip: Another way to show the Report Explorer window in Visual Studio, is from the View menu,
select Other Windows, then Report Explorer 9.
7. Click OK to save the data source and return to the report design surface. In the Report Explorer, under the
Fields node, the Bound node is populated with fields returned by the query.
To add a calculated field
1. In the Report Explorer, expand the Fields node.
2. Right-click the Calculated node and select Add. The new calculated field is displayed in the Report
Explorer and in the Properties window.
3. In the Properties window, set the Formula property to a calculation, for example: = UnitPrice * 1.07
4. Drag the field from the Report Explorer onto the design surface of your report to create a textbox that is
bound to the field.
To bind a Field to a TextBox control
1. In the Report Explorer, expand the Fields node, then the Bound or Calculated node that you want to use.
2. Click the field that you want to bind to a TextBox control, drag it onto the report surface and drop it into
the section where you want the TextBox to appear.
3. A TextBox control is created and bound to the field with the filed name in the DataField property, and a
related value in the Name and Text properties. For example, if you drag the City field onto the report, the
DataField property of the TextBox becomes City, the Name and Text properties become txtCity1.
To add parameters
1. In the Report Explorer, right-click the Parameters node and select Add. The new parameter is displayed in
the Report Explorer and in the Properties window.
2. In the Properties window, set the Prompt property to a string value to ask users for data.
3. Leave the PromptUser property set to True. When you run the report, a dialog displays the Prompt to the
user.
4. From the Report Explorer, drag the parameter to the report design area to create a TextBox that is bound
to the parameter. When you run the report, the value that the user supplies in the prompt dialog displays
in the bound TextBox on the report.
To change report settings
1. In the Report Explorer, double-click the Settings node. The Report Settings dialog appears.
2. You can set a number of options on the four tabs in the dialog.
3. When you have finished changing report settings, click OK.
4. Click the Accept button to create the data set. The data fields appear in the data set node.
To bind a DataSet field to a TextBox control
1. In the Report Explorer, expand the DataSources node, then the node for the data source, then the DataSet
that you want to use.
2. From the DataSet node, click the DataSet field that you want to bind to a TextBox control, drag it onto the
report surface or onto a data region and drop it.
3. A TextBox control is created and bound to the field with the proper expression in the Value property. For
example, if you drag the City field onto the report, the Value property of the TextBox contains the
expression =Fields!City.Value.
4. Click the Accept button to create the data set. The data fields appear in the data set node.
To bind a DataSet field to a TextBox control
1. In the Report Explorer, expand the DataSources node, then the node for the data source, then the DataSet
that you want to use.
2. From the DataSet node, click the DataSet field that you want to bind to a TextBox control, drag it onto the
report surface or onto a data region and drop it.
3. A TextBox control is created and bound to the field with the proper expression in the Value property. For
example, if you drag the City field onto the report, the Value property of the TextBox contains the
expression =Fields!City.Value.
To add parameters
1. In the Report Explorer, right-click the Parameters node and select Add Parameter. The Report
Parameters dialog appears.
2. On the General tab of the dialog, enter text for prompting users for a value.
3. On the Available Values tab, you can select values from a DataSet to populate a list from which users can
select a value.
4. On the Default Values tab, you can provide default values to use if the user does not select a value.
5. Click Accept to save the parameter. The new parameter appears in the Report Explorer under the
Parameters node.
6. From the Report Explorer, drag the parameter to report design area to create a TextBox that is bound to
the parameter. When you run the report, the value that the user supplies in the prompt dialog displays in
the bound TextBox on the report.
Toolbox
In ActiveReports, the Visual Studio integrated toolbox tabs display all of the controls specific to the type of report
that has focus, or the ActiveReports controls that you can use on Web Forms or Windows Forms.
When a Section report has focus, the ActiveReports 9 Section Report toolbox becomes available. For
information about the report controls available in this toolbox, please see the Section Report Toolbox topic.
When a Page report has focus, the ActiveReports 9 Page Report toolbox becomes available. For information
about the report controls available in this toolbox, please see the Toolbox topic.
When a RDL report has focus, the ActiveReports 9 RDL Report toolbox becomes available. For information
about the report controls available in this toolbox, please see the Toolbox topic.
When a Windows Form has focus, the ActiveReports 9 toolbox group offers the following Windows Forms controls:
ReportExplorer (requires Professional Edition license)
Toolbox (requires Professional Edition license)
Designer (requires Professional Edition license)
Viewer
When a Web Form has focus, the ActiveReports 9 toolbox group offers one Web control: the WebViewer (requires
Professional Edition license). For more information, see Getting Started with the Web Viewer.
Properties Window
The Visual Studio Properties window is an important tool when you design a report. Select any page, section, data
region, control or the report itself to gain access to its properties in the Properties window. By default, this window
is placed to the right of the report design area, or wherever you may have placed it in Visual Studio. You can show
Tip: If the commands or description section is missing in Visual Studio, you can toggle it back on by right-
clicking anywhere in the Properties window and clicking Commands or Description.
In the image below, you can see a chart control selected on the designer surface, revealing its properties in the
Properties window, along with any associated commands, and a description of the selected property.
Rulers
In ActiveReports, rulers appear to the top and left of the Design View to guide you in vertically and horizontally
aligning items in the report. They have large tick marks to indicate half inch points and smaller tick marks to
indicate eighths of an inch.
Note: The numbers indicate the distance in inches from the left margin, not from the edge of the page.
Section Reports
In Section Reports, the white area on the ruler indicates the designable area of the report. The grey area at the
bottom of the vertical ruler and at the right of the horizontal ruler indicate the report margins. Grab handles on the
vertical ruler indicate the height of individual sections. You can drag them up or down to change section heights,
or double-click to automatically resize the section to fit the controls in it.
In a section layout, you can change ruler measurements from inches to centimeters and centimeters to inches.
Use the following instructions to modify ruler measurements at design- time.
In section reports, you can change the units of measure for the rulers. See Change Ruler Measurements for further
details.
Page/RDL Reports
In Page Reports or RDL Reports, margin markers indicate the designable area of the report. The area inside the
margin markers is designable, and the areas outside the markers are the margins. To change the margins, you can
drag the margin markers to the desired locations.
In a page layout, you can change ruler measurements from inches to centimeteres and centimeteres to inches.
Use the following instructions to modify ruler measurements in page reports.
Scroll Bars
Scroll Bars appear automatically when controls or data regions do not fit the visible area of the report design
surface. A scroll bar consists of a shaded column with a scroll arrow at each end and a scroll box (also called
a thumb) between the arrows. You can scroll up, down, right or left using the scroll arrow buttons, scroll box or
mouse wheel.
Auto Scrolling
When a user drags a control beyond the edge of the design surface and the mouse pointer reaches near the
Note: In Section Layout and Report Definition Language (RDL), when the mouse button is released during
auto scrolling at a location outside the design surface, the surface extends to accommodate the control.
Tip: To enable auto scrolling for multiple controls, hold down the [Ctrl] or [Shift] key to select the controls.
Drag them together to the edge of the design surface and enable auto scrolling.
Snap Lines
Snap lines assist in accurate positioning of elements on a report design surface while you drag report controls on
it. These dynamic horizontal and vertical layout guidelines are similar to the ones found in Visual Studio. You
can see snap lines on the ActiveReports Designer as well as the Standalone Designer Application.
Snap lines appear on the design surface by default. In order to disable them, click the Snap Lines button below
the design surface, or in section reports, hold down the [Alt] key while dragging a control to temporarily hide the
snap lines.
When you drag a control on the design surface, blue snap lines appear and the control slows down as it aligns with
another control or a section edge. Unless you are also using the Snap to Grid setting, with Snap Lines, the
control can move freely around the report and can be placed anywhere on the design surface.
Tip: If you plan to export a report to Excel format, use snap lines to ensure that your controls are aligned in
columns and rows to avoid empty cells or overlapping of controls in the spreadsheet.
On selecting multiple items where all the items move as a single unit, snap lines appear for all items in
the selection.
Note: Snap lines do not appear when you move a control with arrow keys.
Keyboard Shortcuts
You can hold down the Ctrl key and use the mouse wheel to zoom in and zoom out of the design surface.
You can also use keyboard shortcuts for the following functions:
[Ctrl] + [+] : Zoom in
[Ctrl] + [-] : Zoom out
[Ctrl] + 0 : Return to 100%
Report Types
ActiveReports provides a number of ways to design a report. You can choose a report type based on your layout
requirements. Depending on the type of report you select, you also get various file formats to create your reports.
In this section
Report Definition Language (RDL) Report
Page Report
Code-Based Section Report
XML-Based Section Report
Master Reports
One way in which RDL reports differ from Page reports is the ability to create and use master reports. A master
report is one that you use to add common report functionality like data, company logos, and page headers or
footers, while using the ContentPlaceHolder control to designate areas where content reports can add data. In this
way, you can quickly change the data source or company address and logo for an entire suite of reports in one
convenient place. For more information, see Master Reports.
Themes
Both Page and RDL reports can use themes to apply standard formatting to a range of report controls. Like using a
master report, this allows you to change the look of a whole suite of reports in one place. You can specify colors
for text and background, hyperlink colors, major and minor fonts, images, and constants, and then specify theme
values in report control properties. When you want to change the look, you can do it all in the *.rdlx-theme file
and it will apply to each report when it runs. For more information, see Create and Add Themes.
Note: The PageHeader and PageFooter sections of RDL Reports do not display controls bound to dataset
values at runtime. These sections only display controls with static data like labels or, you can also add
parameters using dataset values and use controls bound to parameter value in order to display dataset field
values in these sections.
Data Visualizers
The Image and TextBox report controls have a Data Visualizer feature that allows you to display data in small,
easy-to-comprehend graphs. This is a powerful tool to really make your data pop. For more information, see Data
Visualizers.
Grouping
You can group data within data regions by fields or expressions, control the scope of aggregates, and even create
recursive hierarchies in data with parent-child relationships. The Level function allows you to indent by level to
show these relationships visually. For more information, see Grouping Data (Page Layout).
Interactivity
Interactive Sorting
You can allow users to sort data in List, BandedList, Table, or Matrix data regions using the Interactive Sort
properties of a TextBox report control. For more information, see Allow Users to Sort Data in the Viewer.
Parameters
You can add parameters to reports that allow users to select which values to display in the report. These are also
useful in creating drill-through reports. For more information, see Add Parameters.
Drill Down
You can use the Visibility settings available on report controls, data regions, table rows, and matrix row and
column groups to create drill-down reports. With these settings, you can initially hide items and set a toggle item
that users can click to drill into more detailed data. For more information, see Create a Drill-Down Report.
Drill Through
You can use the Action property in the Navigation settings available on text boxes, images, and chart data values
to create drill-through reports that let users click links to more detailed reports with parameters. Although you can
create drill-through links to reports without parameters, this may leave users searching a huge detailed report for
Bookmark Links
You can also use the Action property in the Navigation settings to jump to a bookmark or URL.
Pagination
You can control where pages break in RDL reports using PageSize settings, as well as PageBreakBefore and
PageBreakAfter properties on data regions, groups, and rectangles.
Page Report
The new Page report offers you a way to create very specific styles of reports that are very difficult, if not
impossible, in other .NET reporting tools. You design this type of report on a page where none of the report
controls can grow or shrink at run time, making it ideal for duplicating legacy paper forms.
As with all Page reports, instead of report sections where you place report controls, you place data regions and
controls directly on the page. But with Page reports, there is no need to use code or add measurements to make
sure that everything fits. Unlike the RDL Report, the controls remain fixed at run time, so you can drop a table on
the report, set a property to size it exactly how you want it, and have something very close to a WYSIWYG report
at design time.
Additional pages
You can run an entire report using the same page layout for every page, which is useful for something like an
invoice, but does not satisfy every reporting need.
For other types of reports, you can add pages and create different layouts for each one, or duplicate a page you
have already created. This can save a lot of time and effort when you have a report with many precisely placed
controls, and you need additional pages that duplicate many of them. For example, when you need to provide
employees with federal, state, and city copies of tax forms that have only one label changed. For more
information, see Overflow Data in Multiple Pages.
You can also insert new pages between existing ones, and drag page tabs to rearrange them. With multiple pages,
you can also choose how to collate the pages at run time. For more information, see how to Set Up Collation and
Collate Multiple Copies of a Report.
Caution: Page Reports do not support nested data regions. A red border indicating overlapping of controls
appears around the nested data region, on placing one data region inside another.
Code
This type of report is the most flexible in terms of what a .NET developer can achieve using code. It has an
extensive API and is event-based, which allows you to control all aspects of the report and how it is generated. If
you like, you can even build a report completely in code. See details about the API in the Class Library (on-line
documentation) section of the help.
The API is also available with XML-based section reports, but you use VB or C# script instead of Windows Forms-
like code. For more information, see XML-Based Section Report .
Data
Code-based section reports connect to data either via settings that you specify in the Report Data Source dialog,
or through code. You can find more information on all of the ways to connect to data in a section report in the
Work with Data in Section Reports topic.
For more information on using script with a layout file, see Scripting in Section Reports.
XML-based section reports are the same as Code-Based Section Report with regard to data, events, structure, and
exports, but everything is contained in a single, portable RPX file.
In this section
Toolbox
This section provides information on each of the report controls and data regions available in the ActiveReports 9
Page Report and ActiveReports 9 RDL Report group in the Visual Studio toolbox.
Data Sources and Datasets
Find out about the Data Sources you can access through ActiveReports and fetch data through DataSets along
with an overview of the Report DataSource and DataSet dialogs.
Shared Data Source (RDSX)
See the advantages of using the RDSX proprietary file format as a data source in your reports.
Expressions
Learn about setting expressions in reports and creating expression through the Expression Editor.
Layers
Learn about using Layers a in reports and it's advantages.
Using Script
Embed code in the script tab to extend the features in your reports.
Report Dialog
See the various options provided in Report Dialog.
FixedPage Dialog
See the various options provided in FixedPage Dialog.
Grouping Data (Page Layout)
See the various options provided for grouping data in ActiveReports.
Add Page Numbering
Select out of a list of pre-defined formats or create custom formats to display page numbers in reports.
Themes
Create themes to define the appearance of reports, and apply the themes to any number of reports for a
consistent look.
Master Reports (RDL)
Use master reports to create a reusable template of common elements you can apply to other reports.
Data Visualizers
Learn about a number of ways to make your data pop using small graphs in images and background colors.
Custom Resource Locator
Find information about the ResourceLocator class that allows you to find resources on your machine for use in your
RDL reports.
Toolbox
When a Page report or RDL report has focus in Visual Studio, the ActiveReports 9 Page Report and ActiveReports
9 RDL Report toolbox group offers a number of report controls and data regions that you can use when creating a
report. You can drag these from the toolbox and drop them onto your reports. These tools are different than those
in the Section Report Toolbox.
Note: Take care in naming report controls, as they are displayed to end users in the advanced search feature
of the Viewer.
In this section
BandedList
The BandedList is a data region with freeform bands in which you can place report controls. With a detail band
that repeats data for every row in the dataset, this data region resembles the Section report design surface.
BandedList
The BandedList data region is a collection of free-form bands. By default, it is composed of three bands: a header,
a footer and a detail band. Bound report controls in the detail band repeat for every row of data. The header and
footer rows render once at the beginning and end of the BandedList, respectively, and are a good place for titles
and grand totals.
Click inside each band to reveal its properties in the Properties window, or click the four-way arrow to select the
entire data region and reveal its properties. Properties for this data region include the following.
Band Properties
Property Description
CanGrow Change to True to allow the data region to grow vertically to accommodate data.
CanShrink Change to True to allow the data region to shrink if there is not enough data to fill it.
KeepTogether Change to True to have ActiveReports attempt to keep all of the data in the band together
on one page.
PageBreakAtEnd Change to True to insert a page break after rendering all of the data in the band.
PageBreakAtStart Change to True to insert a page break before rendering any of the data in the band.
RepeatOnNewPage With header and footer bands, repeats the band on every page when the related details
span multiple pages.
BandedList Properties
Property Description
DataSetName Select the dataset to use in the data region.
KeepTogether Change to True to have ActiveReports attempt to keep all of the data in the data region
together on one page.
NewSection Change to True to render the data region in a new section.
OverflowName Select the name of the OverflowPlaceHolder control in which to render data that exceeds the
allowed space for the data region on the first page of the report.
You can add group header and group footer bands. Report controls in these bands repeat once for each group
instance. You can also nest groups, plus, in RDL reports, you can nest other data regions in any header or footer
band. Grouping in the BandedList is similar to grouping in the Table data region. You can provide a grouping
expression for each group, and also sort the groups.
Caution: You cannot sort the detail data in a BandedList, so any sorting of this type must be done at the
query level.
Note: You can click <Expression...> in many of these properties to open the Expression Editor where you
can create an expression to determine the value.
General
Name: Enter a name for the banded list that is unique within the report.
Tooltip: Enter the value or expression you want to appear when a user hovers the cursor over the banded list in
the viewer at run time.
Dataset name: Select a dataset to associate with the banded list. The combo box is populated with all of the
datasets in the report's dataset collection.
Has own page numbering: Select to indicate whether this banded list is in its own section with regards to
pagination.
Page Breaks: Select any of the following options to apply to each instance of the banded list.
Insert a page break before this banded list
Insert a page break after this banded list
Fit banded list on a single page if possible
Header and Footer: Select any of the following options.
Repeat header band on each page
Repeat footer band on each page
Visibility
By default, the banded list is visible when the report runs, but you can hide it, hide it only when certain conditions
are met, or toggle its visibility with another report control.
Initial visibility
Visible: The banded list is visible when the report runs.
Hidden: The banded list is hidden when the report runs.
Expression: Use an expression with a Boolean result to decide whether the BandedList is visible. True
for hidden, False for visible.
Visibility can be toggled by another report control: Select this check box to display a toggle image next to
another report control. This enables the drop-down box below where you can specify the TextBox control that
toggles the visibility of the BandedList. The user can click the toggle item to show or hide this BandedList.
Navigation
Document map label: Enter an expression to use as a label to represent this item in the table of contents
(document map).
Bookmark ID: Enter an expression to use as a locator for this BandedList. You will then be able to provide a
bookmark link to this item from another report control using a Jump to bookmark action.
Groups
Click the plus sign button to add a new group to the BandedList, and delete them using the X button. Once you
add one or more groups, you can reorder them using the arrow buttons, and set up information for each group on
the following tabs.
General
Name: Enter a name for the group that is unique within the report. This property cannot be set until after a Group
on expression is supplied.
Group on: Enter an expression to use for grouping the data.
Document map label: Enter an expression to use as a label to represent this item in the table of contents
(document map).
Barcode
The Barcode report control offers 39 different barcode styles to choose from. This saves you the time and
expense of finding and integrating a separate component. As with other data-bound report controls, you can use
an expression to bind the value of a field to the Barcode Value property.
Note: This barcode is ported from the Section report Barcode control, so if you create reports
programmatically, the Page report/RDL report barcode is treated as a CustomReportItem.
Barcode Dialog
Properties for the Barcode are available in the Barcode dialog. To open it, with the Barcode selected in the report,
under the Properties Window, click the Property dialog link.
The Barcode dialog lets you set properties on the report control with the following pages.
Note: You can select the <Expression...> option in many of these properties to open the Expression Editor
where you can create an expression to determine the value.
General
Name: Enter a name for the barcode that is unique within the report.
Tooltip: Enter the value or expression you want to appear when a user hovers the cursor over the barcode in the
viewer at run time.
Value: Enter an expression or a static label, or choose a field expression from the drop-down list. You can access
the expression editor by selecting <Expression...> in the list. The value of this expression or text is used to
render the barcode in the report.
Invalid Barcode Text: Enter a message to display if the barcode contains invalid values (content, character,
length).
Caption
Location: Select whether to display the caption above or below the barcode, or select None to display the
barcode without a caption.
Text Alignment: Select the horizontal alignment of the caption. The default value of General centers the
caption.
Barcode Settings
Symbology: Enter the type of barcode to use. ActiveReports supports all of the most popular symbologies:
Table of all included symbologies
Notes: The RSS and QRCode styles have fixed height-to-width ratios. When you resize the width, the height
is automatically calculated.
When you choose a style that offers supplemental options, the additional options appear below.
UPC_A with the add-on code UPC_A may include the add-on
code to the right of the main
code. The add-on code may
include up to 5 supplemental
characters.
When you choose a symbology which offers supplemental options, the additional options appear below the
Symbology drop-down box.
Bar Height: Enter a value in inches (for example, .25in) for the height of the barcode.
Narrow Bar Width (also known as X dimension): This is a value defining the width of the narrowest part of the
barcode. Before using an extremely small value for this width, ensure that the scanner can read it. This value is
specified in Length units (for example, '10cm', '4mm', '1in').
Tip: For accurate scanning, the quiet zone should be ten times the Narrow Bar Width value.
Quiet Zone
A quiet zone is an area of blank space on either side of a barcode that tells the scanner where the
symbology starts and stops.
Left: Enter a size in inches of blank space to leave to the left of the barcode.
Right: Enter a size in inches of blank space to leave to the right of the barcode.
Top: Enter a size in inches of blank space to leave at the top of the barcode.
Bottom: Enter a size in inches of blank space to leave at the bottom of the barcode.
Note: The units of measure listed for all of these properties are the default units of measure used if
you do not specify. You may also specify cm, mm, in, pt, or pc.
Checksum
A checksum provides greater accuracy for many barcode symbologies.
Compute Checksum: Select whether to automatically calculate a checksum for the barcode.
Note: If the symbology you choose requires a checksum, setting this value to False has no effect.
Code49 Options
Code49 Options are available for the Code49 barcode style.
Use Grouping: Indicates whether to use grouping for the Code49 barcode. The possible values are True
or False.
Group Number: Enter a number between 0 and 8 for the barcode grouping.
DataMatrix Options
DataMatrix Options are available for the DataMatrix barcode style.
EccMode: Select the Ecc mode from the drop-down list. The possible values are ECC000, ECC050,
ECC080, ECC100, ECC140 or ECC200.
Ecc200 Symbol Size: Select the size of the ECC200 symbol from the drop-down list. The default value is
SquareAuto.
Ecc200 Encoding Mode: Select the encoding mode for ECC200 from the drop-down list. The possible
values are Auto, ASCII, C40, Text, X12, EDIFACT or Base256.
Ecc000_140 Symbol Size: Select the size of the ECC000_140 barcode symbol from the drop-down list.
Structured Append: Select whether the barcode symbol is part of the structured append symbols. The
possible values are True or False.
Structure Number: Enter the structure number of the barcode symbol within the structured append
symbols.
File Identifier: Enter the file identifier of a related group of the structured append symbols. If you set the
value to 0, the file identifier symbols are calculated automatically.
Encoding: Select the barcode encoding from the drop-down list.
EAN128FNC1 Options
EAN128FNC1 Options are available for the EAN128FNC1 barcode style.
DPI: Specify the resolution of the printer as dots per inch to create an optimized barcode image with the
specified Dpi value.
Module Size: Enter the horizontal size of the barcode module.
Bar Adjust: Enter the adjustment size by dot units, which affects the size of the module and not the entire
barcode.
GS1Composite Options
GS1Composite Options are available for the RSS14Stacked and RSSLimited barcode styles.
Type: Select the type of the composite barcode from the drop-down list. The possible values are None or
CCA. CCA (Composite Component - Version A) is the smallest variant of the 2-dimensional composite
component.
Value: Enter the expression to set the value of the composite barcode.
MicroPDF417 Options
MicroPDF417 Options are available for the MicroPDF417 barcode style.
Compaction Mode: Select the type of the compaction mode from the drop-down list. The possible values
are Auto, TextCompactionMode, NumericCompactionMode, or ByteCompactionMode.
Version: Select the version from the drop-down box to set the symbol size.
Segment Index: The segment index of the structured append symbol. The valid value is from 0 to 99998,
and less than the value in Segment Count.
Segment Count: The segment count of the structured append symbol. The valid value is from 0 to 99999.
File ID: The file id of the structured append symbol. The valid value is from 0 to 899.
PDF417 Options
PDF417 Options are available for the Pdf417 barcode style.
Columns: Enter column numbers for the barcode.
Rows: Enter row numbers for the barcode.
Error Correction Level: Enter the error correction level for the barcode.
PDF 417 Barcode Type: Select the PDF417 barcode type form the drop-down list. The possible values are
Normal or Simple.
QRCode Options
QRCode Options are available for the QRCode barcode style.
Model: Select the model for the QRCode barcode style from the drop-down list. The possible values
are Model1 or Model2.
Error Level: Select the error correction level for the barcode from the drop-down list. The possible values
are M, L, H or Q.
Version: Enter the version of the QRCode barcode style.
Mask: Select the pattern for the barcode masking form the drop-down list.
Use Connection: Select whether to use the connection for the barcode. The possible values are True or
RssExpandedStacked Options
RssExpandedStacked Options are available for the RSSExpandedStacked barcode style.
Row Count: Enter the number of the barcode stacked rows.
Font
Family: Select a font family name or a theme font.
Size: Choose the size in points for the font or use a theme.
Style: Choose Normal or Italic or select a theme.
Weight: Choose from Lighter, Thin, ExtraLight, Light, Normal, Medium, SemiBold, Bold, ExtraBold,
Heavy, or Bolder.
Color: Choose a color to use for the text.
Decoration: Choose from None, Underline, Overline, or LineThrough.
Border
Style: Select a style for the border.
Width: Enter a value in points to set the width of the border.
Color: Select a color to use for the border, or select the <Expression...> option to open the Expression
Editor and create an expression that evaluates to a .NET color.
Background
Color: Select a color to use for the background, or select the <Expression...> option to open the
Expression Editor and create an expression that evaluates to a .NET color.
Format
Format code: Select one of the common numeric formats provided or use a custom .NET formatting code to
format dates or numbers. For more information, see MSDN's Formatting Types topic.
Amount of space to leave around report control
Top margin: Set the top padding in points.
Left margin: Set the left padding in points.
Right margin: Set the right padding in points.
Bottom margin: Set the bottom padding in points.
Rotation: Choose None, Rotate90Degrees, Rotate180Degrees, or Rotate270Degrees.
Visibility
Bullet
The Bullet report control is an easy-to-read linear gauge that is a good alternative to using a dashboard for data
visualization.
A bullet graph has a pointer that shows a key measure. With this control, you can take a single value, the year-to-
date revenue for example, and compare it to a target value that you define in the control's properties. You can
also define the beginning of the graph as the worst value and the end of the graph as the best value. To make the
data visualization even more intuitive, you can define a qualitative range (bad, satisfactory and good) for
segments on the bullet graph and immediately see the position of the key measure within the bullet graph range.
You can combine multiple Bullets into a data region, a table for example, to show single values side by side. You
can orient Bullets horizontally or vertically, and put them together as a stack to analyze several data dimensions at
once.
Bullet Dialog
Properties for the Bullet are available in the Bullet dialog. To open it, with the Bullet control selected on the report,
under the Properties Window, click the Property dialog link.
The Bullet dialog lets you set properties on the report control with the following pages.
General
Name: Enter a name for the Bullet that is unique within the report.
Data
Value: Enter an expression to use as the bullet value.
Target Value: Enter an expression to use as the target value of the bullet graph.
Appearance
Value Style
Color: Select a color to use for the value marker, or select the <Expression...> option to open the
Expression Editor and create an expression that evaluates to a .NET color. The default value is Black.
Target Style
Target Type: Choose Line, Dot or Square. The default value is Line.
Color: Select a color to use for the target value marker, or select the <Expression...> option to open the
Expression Editor and create an expression that evaluates to a .NET color. The default value is Black.
Width: Enter a value in points to set the width of the target value marker. The default value is 3pt.
Note: The Width setting applies only when the Target Type is set to Line.
Tick Marks
Position: Choose None, Inside or Outside. The default value is Outside.
Color: Select a color to use for the tick marks, or select the <Expression...> option to open the
Expression Editor and create an expression that evaluates to a .NET color. The default value is LightGray.
Width: Enter a value in points to set the width of the tick marks. The default value is 1pt.
Interval between tick marks: Set the interval at which you want to show tick marks.
Ranges
Worst Value: Enter a value or expression to define the lowest value on the graph.
Bad/Satisfactory Boundary: Enter a value or expression to define the boundary between bad and satisfactory
values.
Display 3 Sections: Select this check box to show three separate value ranges (bad, satisfactory, and good)
instead of two (bad and satisfactory). This enables the Satisfactory/Good Boundary.
Satisfactory/Good Boundary: Enter a value or expression to define the boundary between satisfactory and good
values.
Best Value: Enter a value or expression to define the highest value on the graph.
Labels
Display Labels: Select this check box to display axis labels for the bullet graph. Selecting this box enables the
rest of the properties on this page.
Format: Select one of the provided format codes or use a custom .NET formatting code to format dates or
numbers. For more information, see MSDN's Formatting Types topic.
Initial visibility
Visible: The bullet graph is visible when the report runs.
Hidden: The bullet graph is hidden when the report runs.
Expression: Use an expression with a Boolean result to decide whether the bullet graph is visible. True
for hidden, False for visible.
Visibility can be toggled by another report control: Select this check box to display a toggle image next to
another report control. This enables the drop-down box below where you can specify the TextBox control that
toggles the visibility of the bullet. The user can click the toggle item to show or hide this bullet.
Data Output
Element Name: Enter a name to be used in the XML output for this Bullet.
Output: Choose Auto, Yes, No, or Content only to decide whether to include this Bullet in the XML output. Auto
exports the contents of the bullet graph only when the value is not a constant.
Calendar
The Calendar report control is used to display date-based data or events in a calendar format in your report. In
the Properties Window or the Calendar Dialog, you can modify the appearance of the days, months, weekends,
and events in the calendar, and create events for it.
Calendar Dialog
Properties for the Calendar are available in the Calendar dialog. To open it, with the Calendar control selected on
the report, under the Properties Window, click the Property dialog link.
The Calendar dialog lets you set properties on the report control with the following pages.
Note: You can select the <Expression...> option in many of these properties to create an expression to
determine the value. For properties with enumerated values, the values are listed under Constants in the
Fields tree view on the left side of the Expression Editor.
General
Event Settings
Start Date: Enter an expression to use to identify the Start Date value(s) of the events to be displayed.
End Date: Enter an expression to use to identify the End Date value(s) of the events to be displayed.
Value: Enter an expression to use to identify the event text value(s) of the events to be displayed.
Detail Grouping
Name: Enter a name for the detail group that is unique within the report. A name is created automatically if you
do not enter one.
Group on: Enter an expression to use for grouping the data. If you have already assigned a dataset name in the
Dataset Name property, you can select a field from the dataset.
Filters
You need to provide three values to add a new filter to the collection: Expression, Operator, and Value.
Expression: Enter the expression to use for evaluating whether data should be included in the group.
Operator: Select from the following operators to decide how to compare the expression to the left with the value
to the right.
Equal Only choose data for which the value on the left is equal to the value on the right.
Like Only choose data for which the value on the left is similar to the value on the right.
For more information on using the Like operator, see the MSDN Web site.
NotEqual Only choose data for which the value on the left is not equal to the value on the right.
GreaterThan Only choose data for which the value on the left is greater than the value on the right.
GreaterThanOrEqual Only choose data for which the value on the left is greater than or equal to the
value on the right.
LessThan Only choose data for which the value on the left is less than the value on the right.
LessThanOrEqual Only choose data for which the value on the left is less than or equal to the value on
the right.
TopN Only choose items from the value on the left which are the top number specified in the value on
the right.
BottomN Only choose items from the value on the left which are the bottom number specified in the
value on the right.
TopPercent Only choose items from the value on the left which are the top percent specified in the
value on the right.
BottomPercent Only choose items from the value on the left which are the bottom percent specified in
the value on the right.
In Only choose items from the value on the left which are in the array of values specified on the right.
Selecting this operator enables the Values list at the bottom.
Between Only choose items from the value on the left which fall between the pair of values you specify
on the right. Selecting this operator enables two Value boxes instead of one.
Value: Enter a value to compare with the expression on the left based on the selected operator. For multiple
values used with the Between operator, the lower two value boxes are enabled.
Values: When you choose the In operator, you can enter as many values as you need in this list.
Event Appearance
Format: Select one of the common numeric formats provided or use a custom .NET formatting code to format
dates or numbers. For more information, see MSDN's Formatting Types topic.
Alignment: Select the horizontal alignment of the event text.
Font
Family: Choose the font family name.
Background
Fill Color: Select a color to use for the background of the calendar event.
Border Color: Select a color to use for the border, or select the <Expression...> option to open the
Expression Editor and create an expression that evaluates to a .NET color.
Image
You can display an image on all calendar events using the following options to define the image.
Source: Choose from External, Embedded, or Database.
MIME Type: Select the MIME type of the image chosen.
Value: Enter the name of the image to display.
Calendar Appearance
The Calendar Appearance page has the following tabs: Month Appearance, Day, Day Headers, Weekend, and Filler
Day.
All but Day Headers have the same properties. (There is no Formatting section on the Day Headers tab.)
Font
Family: Choose the font family name.
Size: Choose the size in points for the font.
Style: Choose Normal or Italic.
Weight: Choose from Lighter, Thin, ExtraLight, Light, Normal, Medium, SemiBold, Bold, ExtraBold, Heavy,
and Bolder.
Color: Select a Web or custom color for the font.
Decoration: Choose from None, Underline, Overline, and LineThrough.
Border
Style: Select a style for the border.
Width: Enter a value in points to set the width of the border.
Color: Select a color to use for the border, or select the <Expression...> option to open the Expression
Editor and create an expression that evaluates to a .NET color.
Background Fill Color: Select a color to use for the background of the calendar's month section.
Formatting
Alignment: Select the horizontal alignment of the calendar month text.
Format: Select one of the common numeric formats provided or use a custom .NET formatting code to
format dates or numbers. For more information, see MSDN's Formatting Types topic.
Navigation
Action
Select one of the following actions to perform when a user clicks on an event in the calendar.
Tip: You can remove or change the order of parameters using the X and arrow buttons.
Jump to bookmark: Select this option and provide a valid Bookmark ID to allow the user to jump to the
report control with that Bookmark ID.
Jump to URL: Select this option and provide a valid URL to create a hyperlink to a Web page.
Document map label: Enter an expression to use as a label to represent this item in the table of contents
(document map).
Bookmark ID: Enter an expression to use as a locator for this calendar. You will then be able to provide a
bookmark link to this item from another report control using a Jump to bookmark action.
Data Output
Element Name: Enter a name to be used in the XML output for this calendar.
Output: Choose Auto, Yes, No, or Content only to decide whether to include this calendar in the XML output.
Auto exports the contents of the calendar only when the value is not a constant.
Chart
The Chart data region shows your data in a graphical representation that often makes it easier for users to
comprehend large amounts of data quickly. Different types of charts are more efficient for different types of
information, so we offer a wide variety of chart types. This makes it easy and cost effective to add charting to your
reports, as there is no need to purchase and integrate a separate charting tool.
To hone in on your needs, when you first drag the Chart report control onto a page report/RDL report, you can
select the broad category of chart type to use: Bar, Column, Scatter, Line, or Dot Plot.
Once you select a chart category, there are a number of dialogs to help you to customize your chart.
Note: You can select <Expression...> within many of these properties to create an expression to determine
the value, or you can select a theme value to keep reports consistent.
Chart Appearance
To open the Chart Appearance dialog, select the Chart on the report, and below the Properties window, click the
Chart appearance command. This dialog has the following pages.
Tip: To go directly to the Plot Area page, click in the middle of the chart to select the Plot Area, then under
the Properties Window, click Property dialog.
Gallery
The Gallery page of the Chart dialog, in basic mode, displays each of the broad categories of chart types, plus
subtypes so that you can refine your choice. For even more chart types, click the Advanced button.
Bar Charts
Bar charts present each series as a horizontal bar, and group the bars by category. The x-axis values determine
the lengths of the bars, while the y-axis displays the category labels. With a bar chart, you can select from the
following subtypes.
Plain: Compares values of items across categories.
Column Charts
Column charts present each series as a vertical column, and group the columns by category. The y-axis values
determine the heights of the columns, while the x-axis displays the category labels. With a column chart, you can
select from the following subtypes.
Plain: Compares values of items across categories.
Stacked: A column chart with two or more data series stacked one on top of the other that shows how
each value contributes to the total.
Percent Stacked: A column chart with two or more data series stacked one on top of the other to sum
up to 100% that shows how each value contributes to a total with the relative size of each series
representing its contribution to the total.
Scatter Charts
Scatter charts present each series as a point or bubble. The y-axis values determine the heights of the points,
while the x-axis displays the category labels. With a scatter chart, you can select from the following subtypes.
Plain: Shows the relationships between numeric values in two or more series sets of XY values.
Connected: Plots points on the X and Y axes as one series and uses a line to connect points to each
other.
Smoothly Connected: Plots points on the X and Y axes as one series and uses a line with the angles
smoothed out to connect points to each other.
Bubble: Shows each series as a bubble. The y-axis values determine the height of the bubble, while the
x-axis displays the category labels. This chart type is only accessible in Advanced chart types.
Line Charts
Line charts present each series as a point, and connect the points with a line. The y-axis values determine the
heights of the points, while the x-axis displays the category labels. With a line chart, you can select from the
following subtypes.
Plain: Compares trends over a period of time or in certain categories.
Smooth: Plots curves rather than angled lines through the data points in a series to compare trends
over a period of time or in certain categories. Also known as a Bezier chart.
Area Charts
Area charts present each series as a point, connect the points with a line, and fill the area below the line. The y-
axis values determine the heights of the points, while the x-axis displays the category labels. With an area chart,
you can select from the following subtypes.
Plain: Compare trends over a period of time or in specific categories.
Stacked: An area chart with two or more data series stacked one on top of the other, shows how each
value contributes to the total.
Percent Stacked: An area chart with two or more data series stacked one on top of the other to sum
up to 100%, shows how each value contributes to the total with the relative size of each series
representing its contribution to the total.
Financial Charts
Stock charts present each series as a line with markers showing some combination of high, low, open, and close
values. The y-axis values determine the heights of the lines, while the x-axis displays the category labels. With
a financial chart, you can select from the following subtypes.
High Low Close: Displays stock information using High, Low, and Close values. High and low values are
displayed using vertical lines, while tick marks on the right indicate closing values.
Open High Low Close: Displays stock information using Open, High, Low, and Close values. Opening
values are displayed using lines to the left, while lines to the right indicate closing values. The high and
low values determine the top and bottom points of the vertical lines.
Candlestick: Displays stock information using High, Low, Open and Close values. The height of the wick
line is determined by the High and Low values, while the height of the bar is determined by the Open
and Close values. The bar is displayed using different colors, depending on whether the price of the
stock has gone up or down.
Renko: Bricks of uniform size chart price movement. When a price moves to a greater or lesser value
than the preset BoxSize value required to draw a new brick, a new brick is drawn in the succeeding
column. A change in box color and direction signifies a trend reversal.
Kagi: Displays supply and demand trends using a sequence of linked vertical lines. The thickness and
direction of the lines vary depending on the price movement. If closing prices go in the direction of the
previous Kagi line, then that Kagi line is extended. However, if the closing price reverses by the preset
reversal amount, a new Kagi line is charted in the next column in the opposite direction. Thin lines
indicate that the price breaks the previous low (supply) while thick lines indicate that the price breaks
the previous high (demand).
Point and Figure: Stacked columns of Xs indicate that demand exceeds supply and columns of Os
indicate that supply exceeds demand to define pricing trends. A new X or O is added to the chart if the
price moves higher or lower than the BoxSize value you set. A new column is added when the price
reverses to the level of the BoxSize value multiplied by the ReversalAmount you set. This calculation
of pricing trends is best suited for long-term financial analysis.
Three Line Break: Vertical boxes or lines illustrate price changes of an asset or market. The price in a
three line break graph must break the prior high or low set in the NewLineBreak property in order to
reverse the direction of the graph.
Other Charts
Other chart types may be used for special functions like charting the progress of individual tasks. You can select
from the following subtypes.
Funnel: Shows how the percentage of each data item contributes to the whole, with the largest value at
the top and the smallest at the bottom. This chart type works best with relatively few data items.
Pyramid: Shows how the percentage of each data item contributes to the whole, with the smallest
value at the top and the largest at the bottom. This chart type works best with relatively few data items.
Gantt: This project management tool charts the progress of individual project tasks. The chart
compares project task completion to the task schedule.
Title
Chart title: Enter an expression or text to use for the title.
Font
Family: Choose the font family name.
Size: Choose the size in points for the font.
Border
Style: Choose an enumerated style for the border.
Width: Set a width value in points between 0.25pt and 20pt.
Color: Select a Web or Custom color.
Border
Style: Choose an enumerated style for the border.
Width: Choose a width value between 0.25pt and 20pt.
Color: Select a Web or Custom color.
Chart Data
See the Chart Data Dialog topic for all of the pages and tabs available for customizing your chart data.
Chart Legend
To open the Chart Legend dialog, select the Chart on the report, and below the Properties window, click the
Chart legend command. This dialog has the following pages.
General
Show chart legend: Clear this check box to disable the legend. This also disables all of the other properties on
this page.
Use Smart Settings: Check this option to apply smart settings or clear this checkbox to activate the properties
given below.
Layout: Choose the layout style for the legend.
Column: This option displays legend items in a single vertical column.
Row: This option displays legend items in a single horizontal row.
Table: This option displays legend items in a table of vertical columns, and is best when you have a
large number of values.
Position: Select an enumerated value to determine the position of the legend relative to the chart area. The
default value is RightCenter.
Display legend inside plot area: Select this check box to display the legend inside the plot area along with your
data elements.
Style
The Style page of the Chart Legend dialog allows you to control the Font, Border, and Fill properties for the legend.
Font
Family: Choose the font family name.
Size: Choose the size in points for the font.
Style: Choose Normal or Italic.
Weight: Choose from Lighter, Thin, ExtraLight, Light, Normal, Medium, SemiBold, Bold, ExtraBold, Heavy, and
Bolder.
Color: Select a Web or custom color for the font.
Decoration: Choose from None, Underline, Overline, and LineThrough.
Border
Style: Choose an enumerated style for the border.
Width: Enter a width value between 0.25pt and 20pt.
Color: Select a Web or Custom color.
Chart Axis
Click the Axis X or Axis Y line of the chart to select AxisXLine or AxisYLine, then under the Properties Window,
click Property dialog. The Chart Axis dialogs let you set axis properties on the data region with the following
pages.
Note: The X and Y Axis dialogs are disabled if your chart type is doughnut or pie.
Title
Axis X or Axis Y
X- or Y-Axis title: Enter text to display near the X or Y axis of the chart.
Text alignment: Choose Center, Near, or Far.
Font
Family: Choose the font family name.
Size: Choose the size in points for the font.
Style: Choose Normal or Italic.
Weight: Choose from Lighter, Thin, ExtraLight, Light, Normal, Medium, SemiBold, Bold, ExtraBold, Heavy, and
Bolder.
Color: Select a Web or custom color for the font.
Decoration: Choose from None, Underline, Overline, and LineThrough.
Line Style
Font
Family: Choose the font family name.
Size: Choose the size in points for the font.
Style: Choose Normal or Italic.
Weight: Choose from Lighter, Thin, ExtraLight, Light, Normal, Medium, SemiBold, Bold, ExtraBold, Heavy, and
Bolder.
Color: Select a Web or custom color for the font.
Decoration: Choose from None, Underline, Overline, and LineThrough.
Major Grid Lines
Show major grid lines: Select this check box to show grid lines for the axis.
Interval: Set the interval at which you want to show major grid lines or tick marks or both.
Border
Style: Choose one from the enumerated styles for the border.
Width: Enter a width value between 0.25pt and 20pt.
Color: Select a color for the border.
Tick mark: Choose one of the following values to determine whether and where to display major tick marks. The
style and interval of the tick marks are set with the above properties.
None: No tick mark is displayed.
Inside: Tick marks are displayed inside the axis.
Outside: Tick marks are displayed outside the axis.
Cross: Tick marks are displayed crossing the axis.
Minor Grid Lines
Show minor grid lines: Select this check box to show minor grid lines for the axis.
Interval: Set the interval at which you want to show minor grid lines or tick marks or both.
Border
Style: Choose one from the enumerated styles for the border.
Width: Enter a width value between 0.25pt and 20pt.
Color: Select a color for the border.
Tick mark: Choose one of the following values to determine whether and where to display minor tick marks. The
style and interval of the tick marks are set with the above properties.
None: No tick mark is displayed.
Inside: Tick marks are displayed inside the axis.
Outside: Tick marks are displayed outside the axis.
General Page
Name: Enter a name for the chart that is unique within the report. This name is displayed in the Document
Outline and in XML exports.
Tooltip: Enter the value or expression you want to appear when a user hovers the cursor over the chart in the
viewer at run time.
Dataset Name: Select a dataset to associate with the chart. The combo box is populated with all of the datasets
in the report's dataset collection.
Line/Border
These properties control the appearance of the border of bars or columns, or the lines, depending on the
type of chart.
Style: Choose one of the enumerated styles for the lines.
Width: Choose a width value between 0.25pt and 20pt for the thickness of the lines.
Color: Choose a Web or Custom color to use for the lines.
Font
Family: Choose the font family name.
Size: Choose the size in points for the font.
Style: Choose Normal or Italic.
Weight: Choose from Lighter, Thin, ExtraLight, Light, Normal, Medium, SemiBold, Bold, ExtraBold, Heavy,
and Bolder.
Color: Select a Web or custom color for the font.
Decoration: Choose from None, Underline, Overline, and LineThrough.
Action
Choose from the following actions to perform when the user clicks on the chart element.
None: The default behavior is to do nothing when a user clicks the chart element at run time.
Jump to report: For drill-through reporting, select this option and provide the name of a local report, the relative
path of a report in another folder, or the full path of a report on another server.
Parameters
Name: Supply the exact names of any parameters required for the targeted report. Note that parameter
names you supply in this must match parameters in the target report.
Value: Enter a Parameter Value to pass to the detail report. This value must evaluate to a valid value
for the parameter.
Omit: Select this check box to omit this parameter from the report.
Jump to bookmark: Select this option and provide a valid Bookmark ID to allow the user to jump to the report
control with that Bookmark ID.
Jump to URL: Select this option and provide a valid URL to create a hyperlink to a Web page.
Data Output
Element name: Enter a name to be used in the XML output for this chart element.
Output: Choose Yes or No to decide whether to include this chart element in the XML output.
Filters Page
Chart Data Filters Page
The Filters page of the Chart Data dialog allows you to filter the data that is included in the chart. Use the plus
sign button to add a filter, and the arrow and X buttons to move or delete filters. You need to provide three values
to add a new filter to the collection.
Expression: Enter the expression to use for evaluating whether data should be included in the chart.
Operator: Select from the following operators to decide how to compare the expression to the left with the value
to the right:
Equal Only choose data for which the value on the left is equal to the value on the right.
Like Only choose data for which the value on the left is similar to the value on the right.
For more information on using the Like operator, see the MSDN Web site.
NotEqual Only choose data for which the value on the left is not equal to the value on the right.
GreaterThan Only choose data for which the value on the left is greater than the value on the right.
GreaterThanOrEqual Only choose data for which the value on the left is greater than or equal to the
value on the right.
LessThan Only choose data for which the value on the left is less than the value on the right.
LessThanOrEqual Only choose data for which the value on the left is less than or equal to the value on
the right.
TopN Only choose items from the value on the left which are the top number specified in the value on
the right.
BottomN Only choose items from the value on the left which are the bottom number specified in the
value on the right.
TopPercent Only choose items from the value on the left which are the top percent specified in the
value on the right.
BottomPercent Only choose items from the value on the left which are the bottom percent specified in
Checkbox Dialog
Properties for the CheckBox are available in the Checkbox dialog. To open it, with the CheckBox control selected
on the report, under the Properties Window, click the Property dialog link.
The Checkbox dialog lets you set properties on the report control with the following pages.
Note: You can select the <Expression...> option in many of these properties to create an expression to
determine the value. For properties with enumerated values, the values are listed under Constants in the
Fields tree view on the left side of the Expression Editor.
General
Name: Enter a name for the checkbox that is unique within the report. This name is displayed in the Document
Outline and in XML exports.
Tooltip: Enter the value or expression you want to appear when a user hovers the cursor over the checkbox in the
viewer at run time.
Value: Enter an expression or a static label, or choose a field expression from the drop-down list. You can access
the expression editor by selecting <Expression...> in the list. The value of this expression or text is displayed in
the report to the right of the checkbox.
Visibility
Initial visibility
Visible - The checkbox is visible when the report runs.
Hidden - The checkbox is hidden when the report runs.
Expression - Use an expression with a Boolean result to decide whether the checkbox is visible. For
example, on a "Free Shipping" checkbox, you could use the expression to see whether the
ShippingCountry is international. A value of true hides the checkbox, false shows it.
Visibility can be toggled by another report control: Select this checkbox to specify a report control to use as
a toggle to show or hide the checkbox. Then specify the TextBox control to display with a toggle image button.
When the user clicks the TextBox control, the checkbox changes between visible and hidden.
Appearance
Background
Color: Select a color to use for the background of the checkbox.
Image: Enter an image to use for the background of the checkbox.
Font
Family: Select a font family name or a theme font.
Size: Choose the size in points for the font or use a theme.
Style: Choose Normal or Italic or select a theme.
Weight: Choose an enumerated weight value or select a theme.
Color: Choose a color to use for the text.
Decoration: Choose from None, Underline, Overline, or LineThrough.
Format
Format code: Select one of the common numeric formats provided or use a custom .NET formatting code to
format dates or numbers. For more information, see MSDN's Formatting Types topic.
Line Spacing: This property sets the space between lines of text.
Line height: This property sets the height of each line of text.
Character Spacing: This property sets the space between characters of text.
Alignment
Vertical alignment: Choose Top, Middle, Bottom, or the <Expression...> option.
Horizontal alignment: Choose General, Left, Center, Right, Justify, or the <Expression...> option.
Justification method: Choose Auto, Distribute, DistributAllLines, or the <Expression...> option.
Wrap mode: Choose NoWrap, WordWrap, or CharWrap.
Note: You must select Justify in the Horizontal alignment property to enable the Justification method
property options.
Container
The Container report control is a container for other items. There are a number of ways in which you can use it to
enhance your reports.
Visual Groupings
You can place report controls within the Container to group them visually, and to make it easier at design time to
move a group of report controls.
Note: Drawing a container around existing items does not contain them. Instead you must drag the items
into the container.
You can use a container as a border for your report pages, and set border properties to create purely visual effects
within your report, and even display an image behind a group of report controls by setting the
BackgroundImage property of the Container.
Anchoring Items
Probably the best usage of the Container report control is to anchor report controls which may otherwise be
pushed down by a vertically expanding data region. For example, if you have a group of textboxes below a table
with some of them to the left or right, any of them directly below the table are pushed down below the expanded
table at run time, while the upper textboxes remain where you placed them at design time. To prevent this from
happening, place the group of textboxes within a container.
Container Dialog
Properties for the Container are available in the Container dialog. To open it, with the Container control selected on
the report, under the Properties Window, click the Property dialog link.
The Container dialog lets you set properties on the report control with the following pages.
Note: You can select the <Expression...> option in many of these properties to create an expression to
determine the value. For properties with enumerated values, the values are listed under Constants in the
Fields tree view on the left side of the Expression Editor.
General
Name: Enter a name for the container that is unique within the report. This name can be called in code.
Page breaks:
Insert a page break before this container: Insert a page break before the container.
Insert a page break after this container: Insert a page break after the container.
Appearance
Background
Color: Select a color to use for the background of the container.
Image: Enter an image to use for the background of the container.
Border
Note: To enable specific corners, check the CheckBox available near each corner of the Container control.
Visibility
Initial visibility
Visible: The container is visible when the report runs.
Hidden: The container is hidden when the report runs.
Expression: Use an expression with a Boolean result to decide whether the container is visible. True for
hidden, False for visible.
Visibility can be toggled by another report control: Select this check box to display a toggle image next to
another report control. This enables the drop-down box below where you can specify the TextBox control that
toggles the visibility of the container. The user can click the toggle item to show or hide this container.
Navigation
Document map label: Enter an expression to use as a label to represent this item in the table of contents
(document map).
Bookmark ID: Enter an expression to use as a locator for this container. You will then be able to provide a
bookmark link to this item from another report control using a Jump to bookmark action.
Data Output
The Data Output page of the Container dialog allows you to control the following properties when you export to
XML:
Element name: Enter a name to be used in the XML output for this container.
Output: Choose Auto, Yes, No, or Contents only to decide whether to include the contents of
this container in the XML output. Choosing Auto exports the contents of the container only when the
value is not a constant.
FormattedText
The FormattedText report control can perform mail merge operations, plus it displays richly formatted text in
XHTML. To format text in the FormattedText report control, enter XHTML code into the Html property.
Supported XHTML Tags
If you use valid HTML tags that are not in this list, ActiveReports ignores them.
Important: All text used in the Html property must be enclosed in <body></body> tags.
Tag Description
<%MergeFieldName%> Inserts a mail merge field.
<!-- -- > Defines a comment
<!DOCTYPE> Defines the document type
<a> Defines an anchor
<abbr> Defines an abbreviation
<acronym> Defines an acronym
<address> Defines an address element
Caution: To enter & in the HTML property, you need to use &.
Background
Color: Select a color to use for the background of the FormattedText.
Image: Enter an image to use for the background of the FormattedText.
Border
Image
The Image report control displays an image that you embed in the report, add to the project, store in a database,
or access through a URL. You can choose the Image Source in the Properties Window after you place the Image
report control on the report.
Embedded Images
The benefit of using an embedded image is that there is no separate image file to locate or to keep track of when
you move the report between projects. The drawback is that the larger the file size of the image you embed, the
more inflated your report file size becomes.
To embed an image in your report
1. In the Report menu, select Embedded Images.
2. Click under the Image column to reveal an ellipsis button (...) and select an image file from your local
files. The Name and MimeType columns are filled in automatically and the image file's data is stored in
the report definition.
3. Click to select the Image report control, and in the Properties grid, set the Source property to Embedded.
4. Drop down the Value property and select the image from the list of embedded images.
Data Visualizer Images
You can use a data visualizer to display data in small graphs that are easy to comprehend.
To add a data visualizer image to your report
1. Click to select the Image report control, and in the Properties grid, drop down the Value property and
select <Data Visualizer...>.
2. In the Data Visualizers dialog that appears, select the Visualizer Type that you want to use, Icon Set,
Range Bar, or Data Bar.
3. Use expressions related to your data to set the rest of the values in the dialog.
Project Images
You may have an image that you want to use in multiple reports, for example a logo. In such cases, you can store
it as a project image. This not only allows you to quickly locate the correct image for new reports in the project,
but also makes it easier when you update your logo, as you will not need to search through every report to replace
embedded images. Another benefit is that the images are distributed with your application.
Note: Microsoft Access database images are generally stored as OLE objects which the Image report control
cannot read.
Web Images
You can also use any image to which you can navigate via a URL. The benefit of this is that images stored in this
way add nothing to the file size of the project or of the report, but the drawback is that if the web based image is
moved, it will no longer show up in your report.
To use a Web image
1. Click to select the Image report control, and in the Properties grid, set the Source property to External.
2. In the Value property, enter the URL for the image.
Image Dialog
Properties for the Image are available in the Image dialog. To open it, with the Image control selected on the
report, under the Properties Window, click the Property dialog link.
The Image dialog lets you set properties on the report control with the following pages.
Note: You can select <Expression...> within many of these properties to open the Expression Editor.
General
Name: Enter a name for the image that is unique within the report. This name can be called in code.
Tooltip: Enter a string or expression that you want to appear when a user hovers the cursor over the image in the
viewer at run time.
Image Value: Enter the name of the image to display. Depending on the Image Source chosen below, you can
give a path to the image, select an image to embed, or pull images from a database. This property also allows you
to choose the <Data Visualizer...> option to launch a dialog that will let you build a data visualization
expression.
Image Source: Select whether the image comes from a source that is External, Embedded, or Database.
MIME Type: Select the MIME type of the image chosen.
Visibility
Initial visibility
Visible: The image is visible when the report runs.
Hidden: The image is hidden when the report runs.
Expression: Use an expression with a Boolean result to decide whether the image is visible. True for
hidden, False for visible.
Visibility can be toggled by another report control: Select this check box to display a toggle image next to
another report control. This enables the drop-down box below where you can specify the TextBox control that
toggles the visibility of the image. The user can click the toggle item to show or hide this image.
Action
Select one of the following actions to perform when a user clicks on this image.
None: The default behavior is to do nothing when a user clicks the image at run time.
Jump to report: For drill-through reporting, select this option and provide the name of a local report, the
relative path of a report in another folder, or the full path of a report on another server.
Parameters: Supply parameters to the targeted report by entering the Name of each parameter, the
Value to send to the targeted report, or whether to Omit the parameter. Note that parameter names you
supply must exactly match parameters in the target report.
Tip: You can remove or change the order of parameters using the X and arrow buttons.
Jump to bookmark: Select this option and provide a valid Bookmark ID to allow the user to jump to the
report control with that Bookmark ID.
Jump to URL: Select this option and provide a valid URL to create a hyperlink to a Web page.
Document map label: Enter an expression to use as a label to represent this item in the table of contents
(document map).
Bookmark ID: Enter an expression to use as a locator for this image. You will then be able to provide a bookmark
link to this item from another report control using a Jump to bookmark action.
Line
The Line report control can be used to visually separate data regions in a report layout. You can set properties in
the Properties grid or the Line Dialog to control the appearance of the line, and to control when the line is
rendered.
Line Dialog
Properties for the Line are available in the Line dialog. To open it, with the Line control selected on the report,
under the Properties Window, click the Property dialog link.
The Line dialog lets you set properties on the report control with the following pages.
General
Name: Enter a name for the line that is unique within the report. This name can be called in code.
Visibility
The Visibility page of the Line dialog allows you to control the following items:
Initial visibility
Visible: The line is visible when the report runs.
Hidden: The line is hidden when the report runs.
Expression: Use an expression with a Boolean result to decide whether the line is visible. True for
hidden, False for visible.
Visibility can be toggled by another report control: Select this check box to display a toggle image next to
another report control. This enables the drop-down box below where you can specify the TextBox control that
toggles the visibility of the line. The user can click the toggle item to show or hide this line.
Navigation
Document map label: Enter an expression to use as a label to represent this item in the table of contents
(document map).
Bookmark ID: Enter an expression to use as a locator for this line. You will then be able to provide a bookmark
link to this item from another report control using a Jump to bookmark action.
List Dialog
Properties for the List are available in the List dialog. To open it, with the List control selected on the report, under
the Properties Window, click the Property dialog link.
The List dialog lets you set properties on the report control with the following pages.
Note: You can select <Expression...> within these properties to create an expression to determine the
value.
General
Name: Enter a name for the list that is unique within the report. This name can be called in code.
Tooltip: Enter the value or expression you want to appear when a user hovers the cursor over the list in the
viewer at run time.
Dataset name: Select a dataset to associate with the list. The drop-down list is populated with all of the datasets
in the report's dataset collection.
Has own page numbering: Select to indicate whether this List is in its own section with regards to pagination.
Page Breaks: Select any of the following options to apply to each instance of the list.
Insert a page break before this list
Insert a page break after this list
Fit list on a single page if possible
Detail Grouping
Detail grouping is useful when you do not want to repeat values within the details. When a detail grouping is set,
the value repeats for each distinct result of the grouping expression instead of for each row of data. For example,
if you use the Customers table of the NorthWind database to create a list of countries without setting the details
grouping, each country is listed as many times as there are customers in that country. If you set the details
grouping to =Fields!Country.Value each country is listed only once.
Note: If the detail grouping expression you use results in a value that is distinct for every row of data, a
customer number for example, you will see no difference in the results.
The Detail Grouping page of the List dialog has the following tabs.
General
Name: Enter a name for the group that is unique within the report. This property cannot be set until after a
Group on expression is supplied.
Group on: Enter an expression to use for grouping the data.
Document map label: Enter an expression to use as a label to represent this item in the table of contents
(document map).
Parent group: For use in recursive hierarchies. Enter an expression to use as the parent group.
Filters
You need to provide three values to add a new filter to the collection: Expression, Operator, and Value.
Expression: Enter the expression to use for evaluating whether data should be included in the group.
Operator: Select from the following operators to decide how to compare the expression to the left with the value
to the right.
Equal Only choose data for which the value on the left is equal to the value on the right.
Like Only choose data for which the value on the left is similar to the value on the right.
For more information on using the Like operator, see the MSDN Web site.
Map
The Map data region is a professional edition feature that shows your business data against a geographical
background. You can create different types of map, depending on the type of information you want to
communicate in your report.
The Map data region consists of the following basic elements:
Title
Map Title describes the theme or subject of the map. The purpose of map title is to tell the viewer of what he is
looking at. You can add multiple titles to the Map using the MapTitleDesigner Collection Editor.
For more information, see Create a Map.
Viewport
Viewport refers to the area on the map where data is displayed against a geographical background. It specifies the
coordinates, projection system, parallels and meridians, center point, and scale of the map. In other words, it is
a map element that actually displays geographical data and occupies most area of the map control depending on
the location and dock position of other map elements. For more information, see Create a Map.
The Map Viewport dialog lets you set properties with the following pages.
General
Coordinate system: Specify the coordinate system of the viewport. Select from Planar, Geographic, or select the
<Expression...> option to open the Expression Editor and create an expression.
Projection: Specify the projection of the map. Tile layers must use the Mercator projection.
Minimum X: Specify the minimum X coordinate of the map in degrees.
Maximum X: Specify the maximum X coordinate of the map in degrees.
Minimum Y: Specify the minimum Y coordinate of the map in degrees.
Maximum Y: Specify the maximum Y coordinate of the map in degrees.
Projection Center X: Specify the X coordinate of the projection center in degrees.
Projection Center Y: Specify the Y coordinate of the projection center in degrees.
Minimum zoom: Specify the minimum zoom value.
Maximum zoom: Specify the maximum zoom value.
Map resolution: Enables the viewport to simplify vector data for polygon and line layers.
Show grid lines below the map: Specify whether to show the grid lines above or below the content of the map.
Meridians
Hide meridians: Specify whether to hide meridians.
Interval: Specify the spacing between the grid lines in degrees.
Line
Style: Choose from None, Dotted, Dashed, Solid, Double, Groove, Ridge, Inset, WindowInset,
Outset, or select the <Expression...> option to open the Expression Editor and create an
expression.
Width: Specify the width of the line.
Color: Select a Web or custom color for the line.
Show labels: Specify whether to show labels for meridians on the map.
Format: Specify the format string to display numeric labels.
Note: You can select <Expression...> within these properties to create an expression to determine the
value.
General
Location
Position: Specify the docking position of the distance scale panel. Choose from TopCenter, TopLeft,
TopRight, LeftTop, LeftCenter, LeftBottom, RightTop, RightCenter, RightBottom, BottomRight, or
select the <Expression...> option to open the Expression Editor and create an expression.
Show distance scale outside the viewport: Specify whether the panel is docked inside or outside
of the map viewport.
Scale
Color: Select the fill color for the distance scale bar.
Border color: Select the border color for the distance scale bar.
Appearance
Border
Style: Choose from None, Dotted, Dashed, Solid, Double, Groove, Ridge, Inset, WindowInset, or
Outset.
Width: Choose the width of the border line.
Color: Select a color for the border.
Background
Color: Select a color to use for the background of the distance scale.
Gradient: Select a color to use for the border, or select the <Expression...> option to open the
Expression Editor and create an expression that evaluates to a .NET color.
Gradient End Color: Select a color to use for the end color of the background gradient.
Pattern: Select the hatching pattern of the distance scale panel from the list of patterns, or select
the <Expression...> option to open the Expression Editor and create an expression.
Shadow offset: Specify the size of the shadow of the distance scale panel. Shadow offsets are drawn to the right
and below an element.
Font
Family: Choose the font family name.
Size: Choose the size in points for the font.
Style: Choose Normal or Italic, or select the <Expression...> option to open the Expression Editor and create an
expression.
Note: You can select <Expression...> within these properties to create an expression to determine the
value.
General
Location
Position: Specify the docking position of the color scale panel. Choose from TopCenter, TopLeft,
TopRight, LeftTop, LeftCenter, LeftBottom, RightTop, RightCenter, RightBottom, BottomRight, or select
the <Expression...> option to open the Expression Editor and create an expression.
Show color scale outside the viewport: Specify whether the panel is docked inside or outside of the
map viewport.
Color bar
Border color: Specify the outline color for color scale divisions.
Range gap color: Specify color to fill color divisions for undefined range values.
Labels
Display: Specify whether to display color scale labels on the color scale panel. Select from Auto,
ShowMiddleValue, ShowBorderValue, or select the <Expression...> option to open the Expression Editor and
create an expression.
Hide end labels: Specify whether to display first and last labels on the color scale panel.
Format: Specify the format string to display numeric labels.
Placement: Speciy the position of the color scale labels on the color scale panel. Select from Alternate, Top,
Bottom, or select the <Expression...> option to open the Expression Editor and create an expression.
Interval: Specify the frequency of the labels on the color scale panel. A value of 0 means no labels are displayed.
Tick mark length: Specify the length of the tick marks on the color scale panel.
Action
Select one of the following actions to perform when a user clicks on the color scale element.
Map Dialog
Properties for the Map are available in the Map dialog. To open it, with the Map control selected on the report,
under the Properties Window, click the Property dialog link.
The Map dialog lets you set properties on the report control with the following pages.
Note: You can select <Expression...> within these properties to create an expression to determine the
value.
General
Name: Enter a name for the map that is unique within the report. This name is called in code.
Tooltip: Enter the value or expression you want to display when a user hovers the cursor over the map in the
viewer at run time.
Antialiasing: Select the smoothing mode to apply to all map control elements. Choose All, None, Text, Graphic,
or select the <Expression...> option to open the Expression Editor and create an expression.
Antialiasing quality: Select the quality for antialiasing. Choose High, Normal, SystemDefault, or select the
<Expression...> option to open the Expression Editor and create an expression.
Visibility
Initial visibility
Visible: The map is visible when the report runs.
Hidden: The map is hidden when the report runs.
Expression: Use an expression with a Boolean result to decide whether the map is visible. True for
hidden, false for visible.
Visibility can be toggled by another report control: Select this check box to display a toggle image next to
another report control. This enables the drop-down box below where you can specify the TextBox control that
toggles the visibility of the map. The user can click the toggle item to show or hide this map.
Appearance
Border
Style: Choose from None, Dotted, Dashed, Solid, Double, Groove, Ridge, Inset, WindowInset, or
Outset.
Width: Specify the width of the border.
Color: Select a Web or custom color for the font.
Background
Color: Select a color to use for the background of the map.
Layers
A map is a collection of layers that display data on the map control.
Polygon layer: Display outlines of areas or markers for the polygon center point. See, Use a Polygon
Layer for more information.
Point layer: Display markers for point locations. See, Use a Point Layer for more information.
Line layer: Display lines for paths or routes. See, Use a Line Layer for more information.
Tile layer: Adds a Bing map tiles background. See, Use a Tile Layer for more information.
A map can have one or more layers. You can load these layers on top of each other to create a more detailed map.
For example, a polygon layer can represent the borders of a country, a line can represent transportation routes, a
point can represent the locations and a tile can add a virtual earth background on the map. See, Use Layers for
more information.
Map layer element appearance:
Properties that you set on a polygon layer, line layer and a point layer apply to all map elements on that
layer, whether or not the map elements are embedded in the report definition.
Properties that you set for rules apply to all map elements on a layer. All data visualization options apply
only to map elements that are associated with spatial data.
The Map layer Data dialog is used to set up spatial and analytical data for the map control. For more information
on spatial and analytical data, see Work with Data.
Analytical data: The map layer data is loaded from the the analytical dataset of the bound report
data source. In the Field name field that appears below, you must set the name of the data
field that contains spatial data in the Analytical dataset.
Caution: In Field name, enter the data field name as =[StateName], not as StateName.
Analytical Data
Dataset: Select the dataset for the analytical data to be displayed on the map layer.
Match: Use the plus sign button to add a relationship between a spatial data field and an analytical data field.
Spatial field: A field with spatial data that specifies an element on the map surface, for example, boundaries of a
country.
Analytical field: A field with analytical data that displays information on the related map element, for example,
the country population.
Filters
The Filters page of the Map Layer Data Properties dialog allows you to filter the data that is included in the
map. Use the plus sign button to add a filter, and the arrow and X buttons to move or delete filters. You need to
provide three values to add a new filter to the collection.
Expression: Enter the expression to use for evaluating whether data should be included in the map.
Operator: Select from the following operators to decide how to compare the expression to the left with the value
to the right:
Equal Only choose data for which the value on the left is equal to the value on the right.
Like Only choose data for which the value on the left is similar to the value on the right.
For more information on using the Like operator, see the MSDN Web site.
NotEqual Only choose data for which the value on the left is not equal to the value on the right.
GreaterThan Only choose data for which the value on the left is greater than the value on the right.
GreaterThanOrEqual Only choose data for which the value on the left is greater than or equal to
the value on the right.
LessThan Only choose data for which the value on the left is less than the value on the right.
LessThanOrEqual Only choose data for which the value on the left is less than or equal to the
value on the right.
TopN Only choose items from the value on the left which are the top number specified in the value
on the right.
BottomN Only choose items from the value on the left which are the bottom number specified in
the value on the right.
Matrix
The Matrix data region contains columns and rows in which the data is inserted and arranged. Columns and rows
in a matrix can be dynamic or static. Each cell in a matrix contains a textbox by default, but as with the other data
regions, the textbox can be replaced with any other report control. Also like other data regions, the matrix also
repeats each report control it contains for each row in the dataset, but unlike the others, it also repeats
horizontally for dynamic columns.
Cells
When you drop a matrix data region onto your report, it is initially composed of four cells.
The top left cell is the corner or label cell. You can leave this cell blank or use it to display a label for the matrix.
The top right cell is a column header and the bottom left cell is a row header. You can drag fields into these cells
or use expressions to group the data.
The bottom right cell is used to aggregate the detail data. At run time, detail cells display aggregates of the
intersections of columns and rows.
Data
The matrix data region is associated with a dataset. You can make this association in the DataSetName property
in the Properties grid.
Groups
You can group the columns and rows in the matrix by opening the Property dialog, and on the Row Groups or
Column Groups page, editing the Group on expression, or by dragging a field into the header cell.
You can nest column and row groups by right-clicking the UI above a column or to the left of row and choosing
Add Column Group or Add Row Group, or simply by dragging another field onto the column or row into which
you want to insert it.
To determine where new groups are displayed, when you drag a field into an existing group you can move the
mouse up or down (for columns) or left or right (for rows) to nest the new group within the existing group, or to
nest the existing group within the new group.
At run time, the nested group repeats within the original group. For instance, when you drag the City field from
your dataset onto a header already grouped by Country, the report displays the first country with all of its cities,
then the next country with all of its cities, and so on until all of the countries in the dataset are displayed with all
of their cities.
Static Rows and Columns
To insert a static row or column, right-click the detail cell and choose Add Column or Add Row. This displays a
Matrix Dialog
Properties for the Matrix are available in the Matrix dialog. To open it, with the Matrix control selected on the
report, under the Properties Window, click the Property dialog link.
The Matrix dialog lets you set properties on the report control with the following pages.
Note: You can select <Expression...> within many of these properties to create an expression to determine
the value.
General
Name: Enter a name for the matrix that is unique within the report. This name can be called in code.
Tooltip: Enter the value or expression you want to appear when a user hovers the cursor over the matrix in the
viewer at run time.
Dataset name: Select a dataset to associate with the matrix. The combo box is populated with all of the datasets
in the report's dataset collection.
Has own page numbering: Select to indicate whether this Matrix is in its own section with regards to pagination.
Page breaks: Select any of the following options to apply to each instance of the matrix.
Insert a page break before this matrix
Insert a page break after this matrix
Fit matrix on a single page if possible
Matrix column expand: Select the direction in which columns expand.
Left to right
Right to left
Groups before row headers: Select the number of columns to show before the row header columns begin. The
default value of 0 displays the row header column to the left.
Visibility
Initial visibility
Visible: The matrix is visible when the report runs.
Hidden: The matrix is hidden when the report runs.
Expression: Use an expression with a Boolean result to decide whether the matrix is visible. True for
hidden, false for visible.
Visibility can be toggled by another report control: Select this check box to display a toggle image next to
another report control. This enables the drop-down list where you can select the TextBox control that users can
click to show or hide this matrix.
Navigation
Document map label: Enter an expression to use as a label to represent this item in the table of contents
(document map).
Bookmark ID: Enter an expression to use as a locator for this matrix. You will then be able to provide a
OverflowPlaceHolder
In a Page report, the OverflowPlaceHolder control is a rectangular placeholder for data that does not fit inside the
fixed size of a List, BandedList, Matrix or Table data region. When you link a data region to an
OverflowPlaceHolder, this control gets its Size property values from the FixedSize of the data region it is linked
with.
You can also place multiple OverflowPlaceHolder controls in a report to create different looks for your data output.
Link a data region to an OverflowPlaceHolder control and then link that OverflowPlaceHolder control to another
OverflowPlaceHolder control. Two common layouts that you can create through this process are:
Multiple Page Layout: Place the data region on the first page of the report and OverflowPlaceHolder
controls on subsequent pages to create a layout with overflow data on multiple pages.
Columnar Report Layout: Place the data region and the OverflowPlaceHolder on the same page of the
report to create a layout that displays data in a columnar format ('Overflow Data in a Single Page'
in the on-line documentation) like the one in the following image.
The following image shows the Properties Window of a List data region (List1) where OverflowPlaceHolder1
is set in the OverflowName property.
Tip: Depending on your layout requirements, you can place the OverflowPlaceHolder control on the
same page tab as the data region or a different page tab.
The following image shows the Properties Window of OverflowPlaceHolder1 where the OverflowPlaceHolder2
is set in the OverflowName property.
Caution: In a report with multiple OverflowPlaceHolder controls, link the OverflowPlaceHolder controls to
their respective data regions and other OverflowPlaceHolder controls such that the overflow chain does not
break.
Shape
The Shape report control is used to display one of the available shape types on a report. You can add a shape
report control to a report by dragging it from the toolbox and dropping it onto the report design surface.
In the ShapeStyle property of the Shape report control, you can select Rectangle, RoundRect or Ellipse, or
you can use an expression to assign fields, datasets, parameters, constants, operations or common values to
Shape Dialog
Properties for the Shape are available in the Shape dialog. To open it, with the Shape control selected on the
report, under the Properties Window, click the Property dialog link.
The Shape dialog lets you set properties on the report control with the following pages.
Note: You can select <Expression...> within many of these properties to open the Expression Editor.
General
Name: Enter a name for the image that is unique within the report. This name can be called in code.
Shape Style: Choose Rectangle, RoundRect or Ellipse from the dropdown list.
Rounded Rectangle: When the Shape type is set to RoundRect, you can specify the radius for each corner of
the shape independently. Drag the handlers available at each corner of the shape to set the value of the radius
at each corner.
Note: To enable specific corners, check the CheckBox available near each corner of the Shape control.
Appearance
Background
Color: Select a color to use for the background of the Shape.
Image: Enter an image to use for the background of the Shape.
Border
Style: Select a style for the border.
Width: Enter a value in points to set the width of the border.
Color: Select a color to use for the border, or select the <Expression...> option to open the Expression Editor
and create an expression that evaluates to a .NET color.
Visibility
Initial visibility
Visible: The shape is visible when the report runs.
Hidden: The shape is hidden when the report runs.
Expression: Use an expression with a Boolean result to decide whether the shape is visible. True for
hidden, false for visible.
Visibility can be toggled by another report control: Select this check box to display a toggle shape next to
another report control. This enables the drop-down box where you can specify the TextBox control which, if
clicked, toggles the visibility of the shape.
Navigation
Document map label: Enter an expression to use as a label to represent this item in the table of contents
(document map).
Bookmark ID: Enter an expression to use as a locator for this shape. You will then be able to provide a bookmark
link to this item from another report control using a Jump to bookmark action.
Data Output
Element name: Enter a name to be used in the XML output for this shape report control.
Output: Choose Auto, Yes, No, Contents Only to decide whether to include this Shape in the XML output.
Sparkline
You can use the Sparkline report control as a simple means of displaying the trend of data in a small graph. The
Sparkline displays the most recent value as the rightmost data point and compares it with earlier values on a
scale, allowing you to view general changes in data over time. With the height similar to the surrounding text
and the width not more than 14 letters wide, the sparkline fits well in dashboards, reports, and other documents.
Customize the Sparkline control with the following types.
Type Description
Line The Line sparkline is widely used in financial and economic data analysis and is based on a
continuous flow of data. The currency exchange rates, changes in price are the examples of
application of this type of sparklines.
Columns The Column sparkline is used for sports scores, cash register receipts, and other cases where
previous values and the current value do not closely influence one another. In this case you are
dealing with discrete data points, and not a continuous flow of data as in the Line sparkline.
Whiskers The Whisker sparkline is typically used in win/loss/tie or true/false scenarios. This type is similar to
the Column sparkline, but it renders a tie (0 value) in a different manner. The bars in a whisker
sparkline render below the baseline for a negative value, above the baseline for a positive value,
and on the baseline for a zero value.
Area The Area sparkline is similar to the Line sparkline but visually you see the space under the line as
shaded.
StackedBar The Stacked Bar sparkline is presented as a horizontal bar with different segment lengths marked
by distinct color hues. The Stacked bar illustrates how the various segments of a part-to-whole
relationship correspond to one another - the largest segment represents the highest value and the
change in brightness indicates a new value on a scale.
Sparkline Dialog
Properties for the Sparkline are available in the Sparkline dialog. To open it, with the Sparkline control selected on
the report, under the Properties Window, click the Property dialog link.
The Sparkline dialog lets you set properties on the report control with the following pages.
General
Name: Enter a name for the sparkline that is unique within the report. This name can be called in code.
Data
Value: Enter an expression to use as the sparkline value.
Name: Enter a name for the sparkline that is unique within the report. This name can be called in code. A name is
created automatically if you do not enter one.
Group on: Enter an expression to use for grouping the data. If you open the expression editor, you can select a
field from the dataset.
Detail Grouping: Enter an expression to use if you do not want to repeat values within the details. If you open
the expression editor, you can select a field from the dataset.
Parent Group: For use in recursive hierarchies. Enter an expression to use as the parent group.
Appearance
Sparkline Type: Choose Line, Columns, Whiskers, Area or StackedBar. Each of these types has its own set of
Appearance properties that appears when you select the type.
Line Type Appearance Properties
Last point marker is visible: Select to display a marker at the last point on the sparkline.
Marker Color: Select a color to use for the last point marker, or select the <Expression...> option to open the
Expression Editor and create an expression that evaluates to a .NET color.
Line Style
Color: Select a color to use for the line, or select the <Expression...> option to open the Expression Editor and
create an expression that evaluates to a .NET color.
Width: Enter a value in points to set the width of the line.
Enable Wall Range: Select this check box to display a wall range for the sparkline. Selecting this box enables the
rest of the properties in this section.
Lower Bound: Select a value or enter an expression that defines the lower bound of the wall range.
Upper Bound: Select a value or enter an expression that defines the upper bound of the wall range.
Data Output
Element name: Enter a name to be used in the XML output for this sparkline report control.
Output: Choose Auto, Yes, No, Contents Only to decide whether to include this Sparkline in the XML output.
Choosing Auto exports the contents of the Sparkline report control.
Subreport(RDL)
The Subreport control is a placeholder for data from a separate report. In ActiveReports, we recommend that you
use data regions instead of Subreport controls wherever possible for better performance. The reason is that the
report server must process every instance of each subreport, which can become burdensome in very large reports
with a large number of subreports processed many times per report. Using data regions to display separate groups
of data can be much more efficient in such reports. For more information, see Work with Report Controls and Data
Regions.
Note: The Subreport control is not supported in Page reports, only RDL. Also, you cannot use a Section
report as the target of a Subreport in a RDL report, and vice versa. But you can export any type of report to
RDF and use that as the target of a Subreport in a section report.
Subreports make sense when you need to nest groups of data from different data sources within a single data
region, or when you can reuse a subreport in a number of reports. Here are some things to keep in mind while
designing subreports.
If you make changes to the subreport without changing the main report, click Refresh to re-run the
subreport in the Preview tab.
If you design the parent report in a stand-alone Report Designer application, save the parent report to
the same directory as the subreport to render it in the Preview tab.
If you set borders on the Subreport control and the body of the report hosted in it, ActiveReports does
not merge the two borders.
If the report hosted in the Subreport control cannot be found or contains no rows, only the border of the
Subreport control is rendered.
If the hosted report is found and does contain rows, the border of the hosted report body is rendered.
Parameters
Subreport Dialog
Properties for the Subreport are available in the Subreport dialog. To open it, with the Subreport control selected
on the report, under the Properties Window, click the Property dialog link.
The Subreport dialog lets you set properties on the report control with the following pages.
Note: You can select <Expression...> within any of these properties to open the Expression Editor.
General
Name: Enter a name for the subreport that is unique within the report. This name can be called in code.
Tooltip: Enter the value or expression you want to appear when a user hovers the cursor over the subreport in
the viewer at run time.
Subreport: Select the report to display within the subreport control. The combo box is populated with all of the
reports in the local folder. Alternatively, you can drag a report from the Solution Explorer and drop it onto the
report surface to create a new subreport.
Use this report’s theme when rendering subreport: Select this check box to have the subreport automatically
use the same theme as the hosting report.
Visibility
Initial visibility
Visible: The subreport is visible when the report runs.
Hidden: The subreport is hidden when the report runs.
Expression: Use an expression with a Boolean result to decide whether the subreport is visible. True for
hidden, false for visible.
Visibility can be toggled by another report control: Select this check box to display a toggle image next to
another report control. This enables the drop-down box where you can specify the TextBox control which, if
clicked, toggles the visibility of the subreport.
Navigation
Document map label: Enter an expression to use as a label to represent this item in the table of contents
(document map).
Bookmark ID: Enter an expression to use as a locator for this subreport. You will then be able to provide a
bookmark link to this item from another report control using a Jump to bookmark action.
Parameters
The Parameters page of the Subreport dialog allows you to enter new parameters and remove or change the order
of parameters using the X and arrow buttons. For each parameter in this list, there is a Parameter Name and a
Parameter Value.
Each Parameter Name must exactly match the name of a parameter in the target report.
For the Parameter Value, enter an expression to use to send information from the summary or main report to
the subreport target.
Data Output
Element name: Enter a name to be used in the XML output for this subreport.
Output: Choose Auto, Yes, or No to decide whether to include this subreport in the XML output. Choosing Auto
exports the contents of the subreport.
Table
The Table data region consists of columns and rows that organize data. A Table has three columns and three rows
by default, a total of nine cells, each of which is filled with a text box. At design time, you can add or remove
columns, rows and groupings to suit your needs. In RDL reports, you can embed other data regions in table cells.
Table Dialog
Properties for the Table are available in the Table dialog. To open it, with the Table data region selected on the
report, under the Properties Window, click the Property dialog link.
The Table dialog lets you set properties on the report control with the following pages.
Note: You can select <Expression...> within these properties to create an expression to determine the
value.
General
Name: Enter a name for the table that is unique within the report. This name can be called in code.
Tooltip: Enter the value or expression you want to appear when a user hovers the cursor over the table in the
viewer at run time.
Dataset name: Select a dataset to associate with the table. The combo box is populated with all of the datasets
in the report's dataset collection.
Header and Footer: Select any of the following options.
Repeat header row on each page
Repeat footer row on each page
Prevent orphaned footer on next page
Visibility
Initial visibility
Visible: The table is visible when the report runs.
Hidden: The table is hidden when the report runs.
Expression: Use an expression with a Boolean result to decide whether the table is visible. True for
hidden, false for visible.
Visibility can be toggled by another report control: Select this check box to display a toggle image next to
another report control. This enables the drop-down box where you can specify the report control which, if clicked,
toggles the visibility of the table.
Navigation
Document map label: Enter an expression to use as a label to represent this item in the table of contents
(document map).
Bookmark ID: Enter an expression to use as a locator for this table. You will then be able to provide a bookmark
link to this item from another report control using a Jump to bookmark action.
Note: If the detail grouping expression you use results in a value that is distinct for every row of data, a
customer number for example, you will see no difference in the results.
TableOfContents
The TableOfContents (ToC) report control is used to display the document map, an organized hierarchy of the
report heading levels and labels along with their page numbers, in the body of a report. The TableOfContents
control allows you to quickly understand and navigate the data inside a report in all viewers that are supported in
ActiveReports. Unlike the Document Map that is only available in the Viewers and cannot be rendered or printed,
you can use the TableOfContents control to embed the ToC structure in the report body for printing and rendering
purposes. You can add a TableOfContents report control to a report by dragging it from the toolbox and dropping it
onto the report design surface.
In the Properties Window, there are a number of properties that you can use to control the appearance and
behavior of the TableOfContents (ToC) report control. For example, in case of Page Report you can use the
OverflowName property to specify the OverflowPlaceHolder control name to link it with the ToC control. The
FixedHeight property allows you to set the maximum height of the ToC control on each page, similar to the
FixedSize property that is available with other report controls.
The Levels property contains the collection of ToC levels and allows you to access the LevelDesigner Collection
Editor dialog, where you can set up the report ToC levels and their properties. The MaxLevel property restricts
the maximum number of levels in the document map.
Any customization made to the Document Map like setting Numbering Style for document map levels using the
Report dialog or using the DocumentMap property gets directly applied to the ToC control. For more information,
see Add Items to the Document Map.
General
Name: Enter a name for the table of contents that is unique within the report. This name can be called in code.
Tooltip: Enter the value or expression you want to display when a user hovers the cursor over the ToC in the
viewer at run time.
Visibility
By default, the ToC is visible when the report runs, but you can hide it, hide it only when certain conditions are
met, or toggle its visibility with another report control.
Initial visibility
Visible: The ToC is visible when the report runs.
Hidden: The ToC is hidden when the report runs.
Expression: Use an expression with a Boolean result to decide whether the ToC is visible. True for hidden,
false for visible.
Visibility can be toggled by another report control: Select this check box to display a toggle ToC next to
another report control. This enables the drop-down box where you can specify the TextBox control which, if
clicked, toggles the visibility of the TOC.
Appearance
Border
Style: Select a style for the border.
Width: Enter a value in points to set the width of the border.
Color: Select a color to use for the border, or select the <Expression...> option to open the Expression
Editor and create an expression that evaluates to a .NET color.
Background
Color: Select a color to use for the background.
Data Output
Element name: Enter a name to be used in the XML output for the TableOfContents report control.
Output: Choose Auto, Yes, No to decide whether to include this ToC in the XML output. Choosing Auto exports
the contents of the ToC report control.
The LevelDesigner Collection Editor is used to set up the report ToC levels and their properties. To access the
LevelDesigner Collection Editor dialog, go to the Properties Window and in the Levels property, click
(Collection).
You can set the ToC level properties from the following locations:
The Properties grid of the LevelDesigner Collection Editor.
The Level properties dialog that gets displayed if you click the Property Pages button above the
LevelDesigner Collection Editor Properties grid.
The LevelDesigner Collection Editor lets you set the properties of a ToC level as follows.
TextBox
The Textbox is the most commonly used report control that displays data. By default, the TextBox appears in each
cell of a Table or Matrix data region. Also, the TextBox is what is created when you drag a field from the Data
Explorer onto the report.
In the Value property of the TextBox, you can enter static text or an expression. An expression can display fields
from a database, calculate a value, or visually display data.
Tip: You can enter text directly into the TextBox on the design surface of the report by double-clicking inside
it.
In the Properties Window are a number of properties that you can use to control the appearance and behavior
of the TextBox. For example, you can set the Action property to have the viewer jump to a bookmark within the
report, another report, or a URL when a user clicks the TextBox at run time. The DataElement properties allow
you to control how and whether the TextBox displays in XML exports.
By default, in RDL Reports, the TextBox can grow vertically to accommodate the data it displays, and
it cannot shrink smaller than it appears at design time. To change this behavior, set the CanShrink and CanGrow
properties in the Properties grid. (These properties are not available in Page Reports.)
Data Fields
When you drag a field from a dataset in the Data Explorer and drop it onto the report surface, a TextBox report
control with an expression is automatically created. The type of expression that is created depends upon the
context where you drop the field. The following table describes the various contexts and expressions created if you
drag a field named SalesAmount onto the report.
Note: The expression created is different for a field with a string or unknown data type. In these cases, the
First aggregate is used in place of the Sum aggregate in the expressions below. At run time, the first value
found within the scope is displayed instead of a summary.
Textbox Dialog
Properties for the Textbox are available in the Textbox dialog. To open it, with the Textbox control selected on the
report, under the Properties Window, click the Property dialog link.
The Textbox dialog lets you set properties on the report control with the following pages.
Note: You can select <Expression...> within many of these properties to open the Expression Editor.
General
Name: Enter a name for the textbox that is unique within the report. This name is displayed in the Document
Outline and in XML exports.
Tooltip: Enter the value or expression you want to appear when a user hovers the cursor over the textbox in the
viewer at run time.
Note: You must select Print Preview mode in order to see this property working in the viewer.
Value: Enter an expression or a static label, or choose a field expression from the drop-down list.
Visibility
Initial visibility allows you to select from the following options:
Visible: The textbox is visible when the report runs.
Hidden: The textbox is hidden when the report runs.
Expression: Use an expression with a Boolean result to decide whether the textbox is visible. For
example, on a "Free Shipping" textbox, you could use the expression to see whether the
ShippingCountry is international. A value of True hides the textbox, False shows it.
Visibility can be toggled by another report control: If you select this check box, it enables the drop-down box
where you can specify the TextBox control that users can click to toggle the visibility of the textbox.
Initial appearance of the toggle image: allows you to select from the following options:
Expanded: The toggle image shows as a minus sign, and all instances of this textbox are visible.
Collapsed: The toggle image shows as a plus sign, and all instances of this textbox are hidden.
Expression: Use an expression with a Boolean result to decide whether the toggle image is expanded.
A value of True expands the toggle image, False collapses it.
Navigation
Action
Select one of the following actions to perform when a user clicks on the textbox.
None: The default behavior is to do nothing when a user clicks the textbox at run time.
Jump to report: For drill-through reporting, select this option and provide the name of a local report, the
relative path of a report in another folder, or the full path of a report on another server.
Parameters: Supply parameters to the targeted report by entering the Name of each parameter,
the Value to send to the targeted report, or whether to Omit the parameter. Note that parameter
names you supply must exactly match parameters in the target report. You can remove or change
the order of parameters using the X and arrow buttons.
Jump to bookmark: Select this option and provide a valid Bookmark ID to allow the user to jump to the
report control with that Bookmark ID.
Jump to URL: Select this option and provide a valid URL to create a hyperlink to a Web page.
Document map label: Enter an expression to use as a label to represent this item in the table of contents
(document map).
Bookmark ID: Enter an expression to use as a locator for this textbox. You will then be able to provide a
bookmark link to this item from another report control using a Jump to bookmark action.
Appearance
Border
Style: Select a style for the border.
Width: Enter a value in points to set the width of the border.
Color: Select a color to use for the border, or select the <Expression...> option to open the Expression Editor
and create an expression that evaluates to a .NET color.
Background
Color: Select a color to use for the background of the textbox.
Image: Enter an image to use for the background of the textbox.
Note: The Background Color and Background Image properties allow you to choose the <Data
Visualizer...> option as well to launch the dialog that let you build a data visualization expression.
Font
Textbox height
Can increase to accommodate contents: Select this check box to set CanGrow to True.
Can decrease to accommodate contents: Select this check box to set CanShrink to True.
Can shrink text to fit fixed size control: Select this check box to set ShrinkToFit to True.
Data Sources
In ActiveReports, you can set the data source information in the Report Data Source Dialog.
The Report Data Source dialog is where you select the type of data to use, provide a connection string, and choose
other options for your data source. You can also decide to use a shared data source, use a single transaction, and
select a method for handling credentials. Once you add a data source, it appears in the Report Explorer under the
Data Sources node. You can also add multiple data sources in a single report.
Datasets
A dataset fetches data from the data source to display in a report. The DataSet Dialog is where you provide a
command type and query string and choose other options for your dataset.
You can also control the timeout period and other data options, and add fields, parameters, and filters to fetch the
data you need. With the XML data type, you have to add fields manually with XPath expressions. Once you have
added a dataset, its fields appear under the Data Source node in the Report Explorer. You can add multiple
datasets for a data source.
The Report Data Source dialog provides the following pages where you can set data source properties:
General
The General page of the Report Data Source dialog is where you can set the Name, Type and Connection string of
Credentials
The Credentials page gives you the following four options for the level of security you need for the data in your
report.
Use Windows Authentication
DataSet Dialog
You can access the DataSet dialog from the Report Explorer by doing one of the following:
With the Data Source node (like DataSource1) selected, click the Add icon on the top left and select
Data Set.
Right-click an existing data source and select Add Data Set.
The DataSet dialog provides the following pages where you can set dataset properties:
General
The General page of the DataSet dialog is where you can set the Name of the dataset.
Name: In the Name field, you can enter a name for the dataset. By default, the name is set to DataSet1. The
name of the dataset appears in the tree view of the Report Explorer. It is also used to call the dataset in code so it
should be unique within the report.
Query
The Query page of the DataSet dialog is where you set the SQL query, stored procedure or table to define the data
you want to fetch in the dataset of your report.
Command type: You can choose from the three enumerated command types.
Type Description
Text Choose Text if you want to write a SQL query to retrieve data.
StoredProcedure Choose StoredProcedure if you want to use a stored procedure.
TableDirect Choose TableDirect if you want to return all rows and columns from one or more tables.
Query: Based on the command type you select above, you can set the query string in this field.
Note: If you select the TableDirect command type, you may need to use escape characters or qualifying
characters in case any of the table names include special characters.
Timeout: You can set the number of seconds that you want the report server to wait for the query to return the
Parameters
The Parameters page of the Dataset dialog is where you can pass a Report Parameter into the parameter you
enter in the Query page. Enter a Name that matches the name of the Report Parameter and a Value for each
parameter in this page.
You can edit the parameters by selecting a parameter in the list and editing its Name and Value.
You can delete the parameters by using the Remove (X) icon above the Parameters list.
You can add new parameters by using the Add (+) icon above the Parameters list. The parameter name
Expressions
In ActiveReports, you can use an expression to set the value of a control in the report, or set conditions under
which certain styles apply. You can set Microsoft Visual Basic® .NET in expressions through,
Properties in the properties window
Expression Editor Dialog
All expressions begin with an equal sign (=). Even the expression for a field value for a TextBox is set as follows:
=Fields!LastName.Value
Tip: While building an expression, you can directly add the entire expression or part of it in the Expression
pane of the Expression Editor. Then use the Insert or Append buttons to create a complete expression.
Note: You can type the format as listed above for either field name values or aggregates on field names. This
evaluates the full expression when the report is viewed.
Besides the shorthand for field names, you can also type shorthand like [@Param] for parameters and [&Value] for
Globals such as [&PageNumber] on the design surface. Please note that you cannot use shorthand in the
Expression Editor.
Common Values
Common Values are run time values available to every property in every report. You can directly drag and drop
these common values from the Report Explorer onto the design surface or add and modify the values from the
Expression Editor. Following is a list of the values that you can see under the Common Values node in the Report
Explorer and the Expression Editor.
Note: Page N of M (Section), Page Number (Section) or Total Pages (Section) is applied to page numbering
when you set grouping in a report. Each section represents a group, not to be confused with sections in a
section report.
Common Functions
You can use a function in an expression to perform actions on data in data regions, groups and datasets. You can
access these functions in the Expression Editor dialog. In any property that accepts expressions, you can drop down
the property and select <Expression...> to open the dialog.
Within the Expression Editor dialog, there is a tree view of Fields. Expand the Common Functions node to view the
available functions. The following tables contain details about each of the functions included in ActiveReports for use
in property expressions.
Date & Time
DateAdd Month
DateDiff MonthName
DatePart Second
DateSerial TimeSerial
DateString TimeValue
DateValue TimeOfDay
Now Timer
Today TimeString
Day Weekday
Hour WeekdayName
Minute Year
Math
These are all methods and fields from the System.Math class. Please see the msdn Math Class topic for information
on overloads for each method.
Abs E PI
Acos Exp Pow
Asin Fix Round
Atan Floor Sign
Atan2 IEEERemainder Sin
BigMul Log Sinh
Ceiling Log10 Sqrt
Cos Max Tan
Cosh Min Tanh
Inspection
These are all methods from the Information class in Visual Basic. Please see the msdn Information Class topic for
more information.
IsArray IsError
IsDate IsNothing
IsDBNull IsNumeric
Program Flow
These are all methods from the Interaction class in Visual Basic. Please see the msdn Interaction Class topic for more
information.
Choose Switch
IIf Partition
Aggregate
You can use aggregate functions within report control value expressions to accrue data. ActiveReports supports
aggregate functions from RDL 2005, plus some proprietary extended set of functions. For all of the functions, you can
add an optional <Scope> parameter.
These are all the available aggregate functions:
Conversion
These are all methods from the Convert class in the .NET Framework. Please see the msdn Convert Class topic for
more information.
ToBoolean ToInt64
ToByte ToSingle
ToDateTime ToUInt16
ToDouble ToUInt32
ToInt16 ToUInt64
ToInt32
Miscellaneous
ActiveReports also offers several functions which do not aggregate data, but which you can use with an IIf function to
help determine which data to display or how to display it.
RowNumber Shows a running count of all the rows in the scope returned =RowNumber(optional <Scope>)
=RowNumber()
by the expression.
GetFields Returns an IDictionary<string,Field> object that contains =GetFields()
=Code.DisplayAccountID(GetFields())
the current contents of the Fields collection. Only valid
when used within a data region. This function makes it
Custom function. Paste in the
easier to write code that deals with complex conditionals.
Code tab.
To write the equivalent function without GetFields() would
require passing each of the queried field values into the 'Within the Code tab, add
method which could be prohibitive when dealing with many this function.
fields. Public Function
DisplayAccountID( flds as
Object) as Object
If flds("FieldType").Value
= "ParentAccount" Then
Return
flds("AccountID").Value
Else
Return
flds("ParentAccountID").Value
End If
End Function
Scope
All functions have a Scope parameter which determines the grouping, data region, or dataset to be considered when
calculating the aggregate or other function. Within a data region, the Scope parameter's default value is the
innermost grouping to which the report control belongs. Alternately, you can specify the name of another grouping,
dataset, or data region, or you can specify Nothing, which sets it to the outermost data region to which the report
control belongs.
The Scope parameter must be a data region, grouping, or dataset that directly or indirectly contains the report control
using the function in its expression. If the report control is outside of a data region, the Scope parameter refers to a
dataset. If there is only one dataset in the report, you can omit the Scope parameter. If there are multiple datasets,
you must specify which one to use to avoid ambiguity.
Note: You cannot set the Scope parameter to Nothing outside of a data region.
Layers
What are Layers?
Why Use Layers?
Other Advantages
Step 3: Printing the names of graduating students on the school diploma certificate.
Now, that the field has been placed at the correct location and bound to a list of student names, the last step is to print the
In this scenario, Layers are used to trace the layout of a field on a pre-printed certificate.
However, Layers are useful in some other scenarios as well.
Other Advantages
Lock the Default Layer to use the original sales receipt report as a template. This step is necessary to make sure that the
existing layout of the template report is not modified while making changes or adding controls to the layout. Please
see Working with Layers for details on how to lock a Layer.
Add two Layers on the existing report template, one for the Customer Copy watermark image and the other for the
Merchant Copy watermark image. Set the TargetDevice property of Customer Layer to Paper for printing a hard copy of the
sales receipt and Merchant Layer to Export for exporting it to a PDF format. Please see View, Export or Print Layers for
details on how to export Layers.
In this scenario an existing report is used as a template to output two different versions of the same report without having
to create and save two copies separately.
Replicating a Layout
Layers can be used to replicate the layout of a pre-printed form. This is particularly useful when you want to replicate a
layout of a pre-printed form which is either uneditable or unavailable in soft copy.
Let us take an example of an order summary letter sent to the customers to see how Layers can help replicate the Layout
of the scanned image easily.
Illustrative Example
Place the scanned image of the letter that needs to be replicated on Layer1 and set the DesignerLock property of this
Layer to True to make sure the image being traced is not modified or changed by mistake. Please see Working with
Layers for details on how to lock a Layer.
While designing any report, it is advisable to separate the layout, data and logic of your report. In this example, we have
placed all the static labels like the logo, header, footer on Layer2 and data bound fields on the Default Layer. This is
particularly useful when designing complex report layouts such as tax forms, regulatory notices or bill of lading
forms. Working on different Layers makes report designing easier as you can modify one aspect of the report, such as static
labels or bound data fields without modifying the entire report layout.
On the Default Layer, place the data bound fields like Order ID, Order Date and Amount. Notice the
DesignerTransparency of Layer2 above and the Default Layer below is set to 0.5 to display the scanned image placed
on Layer1 in the background.
Once the layout being used to copy the layout (scanned image in Layer1) is no longer required, set the DesignerVisible
property of Layer1 to False to hide the Layer or you can also delete this Layer. DesignerVisible property helps in checking
the accuracy of the layout by quickly showing or hiding the controls on the selected layer. In this case we have hidden the
visibility of Layer1 to verify the layout of the final output.
In this scenario, Layers are used to replicate the layout of a scanned image and also separate the layout and the data to
help organize our report better.
Note:
In case the Layers List window does not appear automatically in your application, select View >
Other Windows > Layers List 9 in Visual Studio.
A LayerList control is also available in the Visual Studio toolbar and can be used to add the Layers
feature in the End User Designer application. See how to add the Layer List control in the
walkthrough on Creating a Basic End User Report Designer (Pro Edition).
The Stand-alone Designer application (GrapeCity.ActiveReports.Designer.exe) also contains a
Layers List window. See Stand-alone Designer and Viewer for more information.
Add a Layer
Once a report is created, a Default Layer is automatically added in the Layers List.
1. In the Layers List, select the Layer for which the order is to be set.
2. In the Layers List toolbar, click the Bring to Front or Send to Back button to send the controls placed on
a Layer to the front or the back.
DesignerLock True/False
Locks or unlocks controls placed on a Layer.
You cannot move or resize the controls placed on the design
surface of a locked Layer through a keyboard or a mouse. Other
editing functions like cut, copy or paste and addition or deletion
of controls are possible.
This property can also be set using the check-box for Lock in the
Layers List.
Note: TargetDevice property only determines the target (i.e. Screen, Export or Print) where the group of
controls placed on a Layer appear. In order to get the output on a viewer or export or print the controls, you
need to add code for exporting or printing or adding a viewer to the application.
Tracing Layers
In Page Reports and Rdl reports, you can trace the layout of a pre-printed form to a pixel perfect accuracy using
Layers.
This walkthrough illustrates how you can trace data fields accurately from a scanned image of a boarding pass.
These steps show the results on a Page Report but are applicable to Rdl Reports also.
Note: Right-click and save the image below in your project folder before starting the walkthrough.
Runtime Layout
3. In the Report Data Source Dialog that appears, select the General page and in the Name field, enter a
name like CustomDS.
4. In the Type drop down to select a data provider, choose Xml Provider.
5. In the connection string section, add the following custom data to your project.
Xml
XmlData =
<Flight ID="31">
<Passengers>
<Passenger>
<PassengerName>Maria Anders</PassengerName>
<Passenger>
<PassengerName>Ana Trujillo</PassengerName>
<Seat>18E</Seat>
<Tracking>2322- 030-0074343</Tracking>
</Passenger>
<Passenger>
<PassengerName>Antonio Moreno</PassengerName>
<Seat>25A</Seat>
<Tracking>6722- 034-6784349</Tracking>
</Passenger>
<Passenger>
<PassengerName>Christina Berglund</PassengerName>
<Seat>14B</Seat>
<Tracking>5678- 543-6784349</Tracking>
</Passenger>
<Passenger>
<PassengerName>Thomas Hardy</PassengerName>
<Seat>28F</Seat>
<Tracking>9834- 413-6784569</Tracking>
</Passenger>
</Passengers>
</Flight>
Adding a dataset
1. In the Report Explorer, right-click the data source created in the previous step and select Add Data Set or
select Data Set option from the Add button dropdown.
2. In the DataSet Dialog that appears, select the General page and enter the name of the dataset as
BoardingData.
3. On the Query page, select Text under Command Type and enter the following XML path into the Query
text box to access the data of each passenger.
//Passenger
4. On the Fields page, enter the values from the table below to create fields for your report. Values for XML
data fields must be a valid XPath expression.
5. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
See Adding a DataSet for more information on adding dataset to a data source.
1. In the LayerList window, click the icon to add a new Layer to the report. Notice that a default Layer is
already added in the Layer List.
2. Select Layer1 to make it the Active Layer, and from the Properties window, change the Layer Name
to ImgLayer.
3. In the Layer List window, check the Lock check-box to lock ImgLayer to make sure the image being
traced is not modified or changed by mistake.
4. In the Layer List window,click the Send To Back button to move ImgLayer behind the Default Layer.
9. In the Report Explorer window, right-click the Embedded Images node and select Add Embedded
Image.
10. In the Open dialog box that appears, browse to the project folder location and select the BoardingPass.jpg
image you saved earlier.
11. Click Open to embed the image in your project.
12. From the Report Explorer, drag the embedded BoardingPass image onto the List data region and set the
properties as described in the following table.
13. From the Report Explorer, drag the following fields onto the List data region and set the following
properties.
14. In the Layer List window, select the Default Layer and then the ImgLayer and change their TargetDevice
property to Screen from the Properties window. See View, Export or Print Layers for more information.
Using Script
In a page report or a RDL report, you can use custom code in your expressions to extend the capabilities of your
report. However, for complex functions, or functions you plan to use many times in the report, you also have the
facility to embed the code within the report. You can also create and maintain a custom assembly for code that
you want to use in multiple reports and refer to its methods in expressions.
Note: In a page report or a RDL report, you can use Visual Basic.NET as the script language. However, you
can use both Visual Basic.Net and C# in your script for a section report.
Report Dialog
In a page report or a RDL report, you can set the basic report properties in the Report dialog. You can access this
dialog by doing one of the following:
Go to the Visual Studio Report menu and select Report Properties.
In the Report Explorer, right-click the Report node and from the context menu that appears, select
Report Properties.
In the Report Explorer, select the Report node and in the Commands section at the bottom of the
Properties Window, click the Property dialog command.
Right-click the gray area outside the design surface to select the Report and in the Commands section at
the bottom of the Properties Window, click the Property dialog command.
The Report dialog provides the following pages where you can set report properties:
General
The General page of the Report dialog allows you to control the following items:
Author: Enter the name of the report author here.
Description: Enter a description of the report here.
Draw grid: Clear this check box to remove the grid lines from the report design surface.
Snap to grid: Clear this check box to allow free placement of report items on the report design surface
instead of the automatic alignment of report items with grid lines.
Grid spacing: Enter the spacing between grid lines in inches. The default value is 0.125 inches.
Page headers: These options are enabled when you set a Page Header in a Report Definition Language
(RDL) report.
Print on first page - Select this check box to set the page header on the first page of the
report.
Print on last page - Select this check box to set the page header on the last page of the
report.
Page footers: These options are enabled when you set a Page Footer in a RDL report.
Print on first page - Select this check box to set the page footer on the first page of the
report.
Print on last page - Select this check box to set the page footer on the last page of the
report.
Auto refresh: Select this check box to automatically refresh the pages of the report at regular
intervals. When this check box is selected, you can supply the interval in seconds.
Ruler Units: Set the ruler units in Inches or Centimeters.
Preview Pages: Set the number of pages to display in the Preview tab. Minimum values is 0 and
maximum is 10000 pages. If the value is set to 0, the Preview tab displays all the pages. By default, the
Preview tab displays all the pages.
Appearance
The Appearance page of the Report dialog allows you to control the page layout for your report.
Columns
Number of columns: Enter the number of columns you want to use in your report.
Spacing: Enter the number of inches of space to use between columns.
Page Layout
Paper Size: Select one among the standard paper sizes from the dropdown.
Width: Specify the width of the layout.
Height: Specify the height of the layout.
Left margin: Specify the Left margin for the layout.
Right margin: Specify the Right margin for the layout.
Top margin: Specify the Top margin for the layout.
Bottom margin: Specify the Bottom margin for the layout.
Orientation: Select one among Portrait and Landscape as your page orientation.
Caution: If you are using the ActiveReports Stand-alone Report designer application, make sure the
assembly you load is created using .NET 3.5 framework or below as the Stand-alone Report designer is a
.NET 3.5 application.
Assembly Name
This is a list of the assemblies available for use in your report. You can delete assemblies using the Remove
button, or add them using the Open button which presents the Open file dialog.
Note: Any assemblies you reference must be copied to the ActiveReports 9 folder (...Common
Files\GrapeCity\ActiveReports 9) on your development machine as well as on any server to which you deploy
your reports.
Classes
This is a list of instance-based classes you can create for use in your report.
Class name: Enter the namespace and name of the class here. (i.e. Invoicing.GetDueDate)
Instance name: Enter a name for the instance of the class here. (i.e. m_myGetDueDate)
Data Output
The Data Output page of the Report dialog allows you to control how the report's data is rendered in XML exports.
Element name: Enter the name you want to appear as the top level data element in your exported XML
file.
Data transform (.xsl file): Enter the name of the XSL file you want to use as a style sheet for the
exported XML file.
Data schema: Enter the schema or namespace to use for validating data types in the exported XML file.
Render textboxes as: Choose whether to render textboxes as Attributes or Elements in the exported
XML file.
Attributes example: <table1 textbox3="Report created on: 7/26/2005 1:13:00 PM">
Elements example:
<table1> <textbox3>Report created on: 7/26/2005 1:13:28 PM</textbox3>
Themes
The Themes page of the Report dialog displays the report's themes. This dialog allows you to create a new theme,
add, modify or remove an existing one, as well as rearrange the order of themes if a report has many themes.
When you select to create or modify a theme, the Theme Editor is opened. See Themes for further information.
The FixedPage dialog provides the following pages where you can set the page properties:
General
The General page of the FixedPage dialog allows you to control the following properties:
Name: Enter a name for the Page report. This name is used to call the page in code so it should be
unique within the report.
Dataset name: Select a dataset to associate with the page report. The dropdown list is automatically
populated with all the datasets in the report's dataset collection.
Grouping
The Grouping page is useful when you want to show data grouped on a field or an expression on report's pages.
See Grouping in a FixedPage for more information.
The Grouping page contains following tabs which provide access to various grouping properties:
General
Name: Enter a name for the Fixed Layout group that is unique within the report. This property cannot
be set until after a Group on expression is supplied. A name is created automatically if you do not enter
one.
Group On: Enter an expression to use for grouping the data.
Document map label: Enter an expression to use as a label to represent this item in the table of
contents (document map).
Filters
The Filters tab allows you to add and control the Filter collection for the Fixed Layout Group. Use the + button to
add a filter and the X button to delete a filter. You need to provide three values to add a new filter to the
collection:
Expression: Enter the expression to use for evaluating whether data should be included in the group.
Operator: Select from the following operators to decide how to compare the expression to the left with
the value to the right:
Equal Only choose data for which the value on the left is equal to the value on the right.
Like Only choose data for which the value on the left is similar to the value on the right. For
more information on using the Like operator, see the MSDN Web site.
NotEqual Only choose data for which the value on the left is not equal to the value on the
Note: In this topic, the data displayed in the screenshots is from the Movie table available in the Reels
database. By default, the Reels.mdb file is located in the [User Documents folder]\GrapeCity
Samples\ActiveReports 9\Data folder.
In a Page Report, you can also group data on a report page. See Grouping in a FixedPage for further information.
Detail Grouping
Detail grouping is available in the List and Table data regions. It is useful when you do not want to repeat values
Note: If the detail grouping expression you use results in a value that is distinct for every row of data,
MovieID for example, you will see no difference in the results.
Recursive Hierarchies
If you want to display parent-child relationships in your data, you can create a recursive hierarchy. To do this, you
need a unique ID field for the child group and an ID field for the parent group.
For example, if you have pulled data from the Reels database using the following SQL query:
SQL Query
SELECT EmployeePosition.*, Employee.*, Employee_1.PositionID AS
ManagerPosition FROM Employee AS Employee_1 RIGHT JOIN (EmployeePosition
INNER JOIN Employee ON EmployeePosition.PositionID = Employee.PositionID)
ON Employee_1.EmployeeID = Employee.ManagementID;
You can set Detail Grouping in a Table data region using the
=Fields.Item("EmployeePosition.PositionID").Value field, and the =Fields!ManagerPosition.Value field as
the parent group to display parent-child relationships in your data.
Note: You can use only one group expression when you set a parent group.
Numbering Description
Format
Page N of M This format displays the current page out of the total number of pages in the report. Here N
signifies the current page of a report and M the total number of report pages. Use the following
expression to set this page numbering format:
="Page " & Globals!PageNumber & " of " & Globals!TotalPages
Page N of M This format displays the current page out of the total number of pages of a grouped report
(Section) section. Here N signifies the current page of a grouped report section and M signifies the total
number of pages in a grouped report section. Use the following expression to set this page
numbering format:
="Page " & Globals!PageNumberInSection & " of " & Globals!TotalPagesInSection
Page N of M This format displays the current page out of the total number of cumulative pages in a report.
(Cumulative) Here N signifies the current page of the report and M signifies the total number of cumulative
pages in a report. Use the following expression to set this page numbering format:
="Page " & Globals!CumulativePageNumber & " of " & Globals!CumulativeTotalPages
Page This format displays only the current page number of a report. Use the following expression to
Page This format displays only the current page number of a specific grouped report section. Use the
Number following expression to set this page numbering format: =Globals!PageNumberInSection
(Section)
Total Pages This format displays only the total number of pages in the report. Use the following expression to
set this page numbering format: =Globals!TotalPages
Total Pages This format displays only the total number of pages in specific grouped report section. Use the
(Section) following expression to set this page numbering format: =Globals!TotalPagesInSection
Cumulative This format displays only the current cumulative page number of the report. Use the following
Page expression to set this page numbering format: =Globals!CumulativePageNumber
Number
Cumulative This format displays only the total number of cumulative pages in a report. Use the following
Total Pages expression to set this page numbering format: =Globals!CumulativeTotalPages
Tip: In addition to modifying the page numbering expression in the Expression Editor, you can also modify
the pre-defined formats directly in the control on the design surface.
Themes
A theme is a collection of properties that defines the appearance of a report. A theme includes colors, fonts,
images, and constant expressions that you can apply to report elements once you add a theme to a report.
You can add one or many themes to a report. If a report has multiple themes, you can use the report's CollateBy
Enumeration (on-line documentation) to control the page order in a report. See Set Up Collation for more
information.
The Theme Editor and the Report - Themes dialog allow you to manage themes in a report.
In the Theme Editor, you can create a new theme by setting colors, fonts, images, and Use Constant Expressions
in a Theme and then saving a new theme as an .rdlx-theme file on your local machine. Then you can add this
theme to your report in the Report – Themes dialog. Also, in the File menu, select Open to open and modify an
existing theme and select Save or Save As to save the changes on your local machine.
Note: In a section report (code-based report), you have a concept similar to Master Reports. However, here
you create a base report class in a standard report that other reports inherit. See Inherit a Report
Template for further information.
Note: Code in the master report is hidden in the content report, so in order to allow content report
users to access code, the master report developer must provide information.
Data Visualizers
The Image and TextBox report controls support a type of expression called Data Visualizers that allow you to
create small graphs to make your data easier to understand. For example, you can red flag an overdue account
using the Flags Icon Set as a background image. There are several types of Data Visualizers available through a
dialog linked to properties on the Image and TextBox report controls.
Caution: In the following topics, the terms "argument" and "parameter" may seem interchangeable, but
within an expression, an argument refers to the returned value of a parameter, while a parameter may be a
variable.
Icon Set
Learn about the included image strips from which you can select using arguments. These include traffic lights,
arrows, flags, ratings, symbols, and more, plus you can create your own custom image strips.
Range Bar
Learn how you can provide minimum, maximum, and length arguments to render a 96 by 96 dpi bar image in line
with your text to show a quick visual representation of your data values.
Range Bar Progress
Learn about using a second bar to show progress along with the data range.
Data Bar
Learn about data bars, which are similar to range bars with a few different arguments.
Icon Set
The Icon Set data visualization allows you to use arguments to select an image from an image strip and display it
either as a TextBox BackgroundImage, or as an Image Value. You can use the standard image strips included with
ActiveReports, or create custom image strips.
Standard Image Strips
Name Image
Checkbox
3TrafficLights
Blank
Flags
GrayArrows
Quarters
Ratings
RedToBlack
Signs
Symbols1
Symbols2
TrafficLights
To use these image strips, place code like the following in the BackgroundImage property of a TextBox report
control, or in the Value property of an Image report control.
Note: When using icon sets, you must set the Source property to Database.
Parameters
Icon Set. This designates the name of the icon set to use.
Icon 1 Value. A Boolean expression that, if it evaluates to True, renders this icon from the strip.
Icon 2 Value. A Boolean expression that, if it evaluates to True, renders this icon from the strip.
Icon 3 Value. A Boolean expression that, if it evaluates to True, renders this icon from the strip.
Icon 4 Value. A Boolean expression that, if it evaluates to True, renders this icon from the strip.
Icon 5 Value. A Boolean expression that, if it evaluates to True, renders this icon from the strip.
You can use static values or any expression that evaluates to a Boolean value. For icon sets with fewer than five
icons, set the unused values to False.
Syntax
=IconSet("Flags", False, True, False, False, False)
Usage
Following the Icon Set argument, there are five Boolean arguments. The first argument to evaluate to True
displays the corresponding image. Use data expressions that evaluate to a Boolean value to replace the literal
values in the code above.
Example
This expression displays the first symbol (the green flag) on each row in which the Difference exceeds 10, displays
the second symbol (the yellow flag) on each row in which the quantity is greater than 0, and displays the third
symbol (the red flag) on each row in which the quantity is equal to or below 0. Notice that we provide literal False
values in the fourth and fifth arguments, which have no images in this strip.
Paste in the BackgroundImage Value property of a Textbox
=IconSet("Flags",Fields!Difference.Value > 10,Fields!Difference.Value >
In several of the included image strips, the last spots are empty. When using the Checkbox, 3TrafficLights, Flags,
RedToBlack, Signs, Symbols1, Symbols2, or TrafficLights image strip, it generally makes sense to set the Boolean
values for all of the unused icon spaces to False.
Range Bar
The Range Bar data visualization displays a 96 by 96 dpi bar image. The colored bar renders as half the height of
the image, centered vertically. The amount of colored bar to render to the right of the Start argument (or to the
left in the case of a negative value) is based on the Length argument. If the Length argument is zero, a diamond
renders.
The Minimum and Maximum arguments determine the range of data. The area between the Length argument and
the Maximum argument is transparent (or between the Length and the Minimum in the case of a negative value).
Parameters
Minimum. The lowest value in the range of data. This value corresponds to the leftmost edge of the
image. If this argument is greater than the Start argument, Start becomes equal to Minimum. The data
type is Single.
Maximum. The highest value in the range of data. This value corresponds to the rightmost edge of the
image. If this argument is less than the Start argument, Start becomes equal to Maximum. The data
type is Single.
Color. The HTML color string to use in rendering the Length in the bar image.
Start. The point from which the Range Bar begins to be rendered. The data type is Single.
Length. The width of the bar to render within the control. Setting this value to 0 renders a diamond
shape instead of a bar. The data type is Single.
You can use static values or aggregate functions (e.g. Min or Max) to set the parameters. For more information on
these and other aggregate functions, see the Common Functions topic.
Syntax
Usage
Use an expression with this syntax in the BackgroundImage Value property of a TextBox or the Value property
of an Image. This renders a bar in the color specified, the length of which changes depending on the number
returned by the Length parameter, in the case of the simple example, GrossProfit. If your data contains only
positive values, Start corresponds with Minimum at the left edge of the DataBar. The area between the Length and
the Maximum is transparent.
Simple Example
Set the Length parameter to the value of a field in your dataset to display the field values visually.
Paste into a TextBox BackgroundImage property
=RangeBar(0,15000,"BlueViolet",0,Fields!GrossProfit.Value)
Default Behavior
The function returns null (i.e. no image is rendered) in the following cases:
1. The Maximum is less than or equal to the Minimum.
2. The expression is placed in a property which does not take an image.
3. The Source property of the image is not set to Database.
The Start value changes in the following cases:
1. If the Start value is less than the Minimum value, Start is the same as Minimum.
2. If the Start value is greater than the Maximum value, Start is the same as Maximum.
The Length value changes in the following cases:
1. If the Start value plus the Length value is less than the Minimum value, Length becomes Minimum
minus Start.
2. If the Start value plus the Length value is greater than the Maximum value, Length becomes Maximum
minus Start.
If the argument for any of the parameters cannot be converted to the required data type, the default value is used
instead.
Dialog
When you select a TextBox control on your report, in the Properties window or Properties dialog, you can drop
down the BackGroundImage Value property and select <Data Visualizer...> to launch the dialog. The same is
true if you select an Image control and drop down the Value property. To build the data visualizer expression,
The Minimum and Maximum arguments determine the range of data. The area between the Length and Progress arguments
and the Maximum argument is transparent (or between the Length and Progress and the Minimum in the case of a negative
value).
Parameters
Minimum. The lowest value in the range of data. This value corresponds to the leftmost edge of the image.
If this argument is greater than the Start argument, Start becomes equal to Minimum. The data type is Single.
Maximum. The highest value in the range of data. This value corresponds to the rightmost edge of the image.
Syntax
=RangeBarProgress(Minimum, Maximum, Color, Start, Length, ProgressColor, Progress)
Usage
Use an expression with this syntax in the BackgroundImage property of a TextBox or the Value property of an Image.
This renders a double bar in the colors specified, the length of which changes depending on the number returned by the
Length parameter for the thick bar, in the case of the simple example, GrossSales. The thin bar length is based on the value
returned by the Progress parameter, in this case, GrossProfit. If your data contains only positive values, Start corresponds
with Minimum at the left edge of the Range Bar. The area between the Length or Progress and the Maximum is transparent.
Simple Example
Set the Length and Progress parameters to the values of fields in your dataset to display the field values visually.
Default Behavior
The function returns null (i.e. no image is rendered) in any of the following cases:
1. The Maximum is less than or equal to the Minimum.
2. The expression is placed in a property which does not take an image.
3. The Source property of the image is not set to Database.
The Start value changes in the following cases:
1. If the Start value is less than the Minimum value, Start is the same as Minimum.
2. If the Start value is greater than the Maximum value, Start is the same as Maximum.
The Length value changes in the following cases:
1. If the Start value plus the Length value is less than the Minimum value, Length becomes Minimum minus Start.
2. If the Start value plus the Length value is greater than the Maximum value, Length becomes Maximum minus
Start.
The Progress value changes in the following cases:
1. If the Start value plus the Progress value is less than the Minimum value, Progress becomes Minimum minus
Start.
2. If the Start value plus the Progress value is greater than the Maximum value, Progress becomes Maximum
minus Start.
If the argument for any of the parameters cannot be converted to the required data type, the default value is used instead.
Dialog
When you select a TextBox control on your report, in the Properties window or Properties dialog, you can drop down the
BackgroundImage Value property and select <Data Visualizer...> to launch the dialog. To build the data visualizer
expression, select the appropriate values for each of the options on the dialog.
For a Range Bar Progress expression, be sure to select the Display a progress indicator check box. This enables the
progress options.
Data Bar
The Data Bar data visualization displays a 96 by 96 dpi bar image. The colored bar fills the Image top to bottom,
while the Value argument determines the amount of colored bar to render to the right of the Zero argument (or to
the left in the case of a negative value).
The Minimum and Maximum arguments determine the range of data. The area between the Value argument and
the Maximum argument is transparent (or between the Value and the Minimum in the case of a negative value).
Parameters
Value. This is the field value in the report to be evaluated. The data type is Single.
Minimum. The lowest value in the range of data against which the Value argument is compared. This
value corresponds to the leftmost edge of the image. If this argument is greater than the Zero
argument, Zero becomes equal to Minimum. The data type is Single.
Maximum. The highest value in the range of data against which the Value argument is compared. This
value corresponds to the rightmost edge of the image. If this argument is less than the Zero argument,
Zero becomes equal to Maximum. The data type is Single.
Zero. This value determines the zero point to the left of which negative data is rendered, and to the
right of which positive data is rendered. The data type is Single.
Color. The HTML color string to use in rendering the Value in the bar image.
Alternate Color. The HTML color string to use when the Value is less than the Zero value (optional).
Syntax
=DataBar(Value, Minimum, Maximum, Zero, Color)
Usage
Use an expression with this syntax in either the BackgroundImage Value property of a TextBox or the Value
property of an Image. This renders a bar in the color specified, the length of which changes depending on the
number returned by the Value parameter, in the case of the simple example, InStock. If your data contains only
positive values, Zero corresponds with Minimum at the left edge of the Data Bar. The area between the Value and
the Maximum is transparent.
Simple Example
Set the Value parameter to the value of a field in your dataset to display the field values visually.
Paste into the BackgroundImage Value property of a TextBox
=DataBar(Fields!InStock.Value,0,20,0,"BlueViolet")
Default Behavior
The function returns null (i.e. no image is rendered) in any of the following cases:
1. The Maximum is less than or equal to the Minimum.
2. The expression is placed in a property which does not take an image.
3. The Source property of the image is not set to Database.
If the argument for any of the parameters cannot be converted to the required data type, the default value is used
instead.
Dialog
When you select a TextBox control on your report, in the Properties window or Properties dialog, you can drop
down the BackGroundImage Value property and select <Data Visualizer...> to launch the dialog. The same is
true if you select an Image control and drop down the Value property. To build the data visualizer expression,
select the appropriate values for each of the options in the dialog.
Color Scale 2
The ColorScale2 data visualization displays a background color in a range of colors to indicate minimum and
maximum values, and all shades in between.
Parameters
Value. This is the field value in the report to evaluate. The data type is Single.
Minimum. If the Value evaluates to this number, the StartColor renders.
Maximum. If the Value evaluates to this number, the EndColor renders.
Syntax
=ColorScale2(Value, Minimum, Maximum, StartColor, EndColor)
Usage
Use an expression with this syntax in the BackgroundColor property of a Textbox control. This causes the
background color to change depending on the value of the field you specified in the Value parameter, in the case
of the example, InStock. Any values falling between the Minimum value and the Maximum render with a color
between the StartColor and EndColor.
Example
Set the Value parameter to the value of a field in your dataset to display the field values visually.
Paste into the BackgroundColor property of a TextBox
=ColorScale2(Fields!InStock.Value,0,20,"Crimson","MidnightBlue")
Default Behavior
The function returns Transparent in any of the following cases:
1. The Value is out of range (i.e. does not fall between the Minimum and Maximum values).
2. The Maximum is less than the Minimum.
If the argument for any of the parameters cannot be converted to the required data type, the default value is used
instead.
Dialog
When you select a TextBox control on your report, in the Properties window or Properties dialog, you can drop
down the BackGroundColor property and select <Data Visualizer...> to launch the dialog. To build the data
visualizer expression, select the appropriate values for each of the options in the dialog.
Note: If you select the Use a middle color check box, the expression used in the BackgroundColor
property changes to ColorScale3. For more information, see ColorScale3.
Color Scale 3
The ColorScale3 data visualization displays a TextBox background color in a range of colors to indicate minimum,
Parameters
Value. This is the field value in the report to be evaluated. The data type is Single.
Minimum. If the Value evaluates to this number, the StartColor is rendered.
Middle. If the Value evaluates to this number, the MiddleColor is rendered.
Maximum. If the Value evaluates to this number, the EndColor is rendered.
StartColor. The HTML color string to use if the Value evaluates to the Minimum value.
MiddleColor. The HTML color string to use if the Value evaluates to the Middlevalue.
EndColor. The HTML color string to use if the Value evaluates to the Maximum value.
You can use static values or aggregate functions (e.g. Min, Avg, or Max) to set the Minimum, Middle, and
Maximum parameters. For more information on these and other aggregate functions, see the Common Functions
topic.
Syntax
=ColorScale3(Value, Minimum, Middle, Maximum, StartColor, MiddleColor, EndColor)
Usage
Use an expression with this syntax in the BackgroundColor property of a Textbox control. This causes the
background color to change depending on the value of the field you specified in the Value parameter, in the case
of the example, InStock. Any values falling between the Minimum value and the Middle value render with a
gradient scale color between the StartColor and MiddleColor. The closer the value is to the Minimum, the closer
to Crimson the color renders. In the same way, values falling between the Middle and Maximum render with a
color between the MiddleColor and EndColor, in this case, varying shades of yellow-green.
Example
Set the Value parameter to the value of a field in your dataset to display the field values visually.
Paste into the BackgroundColor property of a TextBox
=ColorScale3(Fields!InStock.Value,0,10,20,"Crimson","Yellow","MidnightBlue")
Default Behavior
The function returns Transparent in any of the following cases:
1. The Value is out of range (i.e. does not fall between the Minimum and Maximum values).
2. The Maximum is less than the Minimum.
3. The Middle is not between the Minimum and the Maximum.
If the argument for any of the parameters cannot be converted to the required data type, the default value is used
instead.
Dialog
When you select a TextBox control on your report, in the Properties window or Properties dialog, you can drop
down the BackGroundColor property and select <Data Visualizer...> to launch the dialog. To build the data
visualizer expression, select the appropriate values for each of the options in the dialog.
Note: If you clear the Use a middle color check box, the expression used in the BackgroundColor
property changes to ColorScale2. For more information, see ColorScale2.
API
You can implement a custom resource locator by deriving from the ResourceLocator Class (on-line
documentation) and overriding the GetResource method.
The GetResource method returns ParentUri and Value properties. The Value property contains the located
resource as a memory stream. The ParentUri property contains the string URI of the parent of the resource within
the resource hierarchy.
Here is the GetResource method used in the sample.
C# MyPicturesLocator.cs code showing usage of the GetResource Method from the Sample
C# code. Paste inside a class.
Resource resource;
string name = resourceInfo.Name;
if (name == null || name.Length == 0)
{
throw new ArgumentException(Resources.ResourceNameIsNull, "name");
}
Uri uri = new Uri(name);
if (uri.GetLeftPart(UriPartial.Scheme).StartsWith(UriSchemeMyImages, true,
CultureInfo.InvariantCulture))
{
Stream stream = GetPictureFromSpecialFolder(uri);
if (stream == null)
{
stream = new MemoryStream();
Resources.NoImage.Save(stream, Resources.NoImage.RawFormat);
}
resource = new Resource(stream, uri);
}
else
{
throw new
InvalidOperationException(Resources.ResourceSchemeIsNotSupported);
}
return resource;
}
/// Returns a stream containing the specified image from the My Pictures
folder, or null if the picture is not found.
/// The path parameter is the URI of the image located in My Pictures,
e.g. MyImages:logo.gif
private static Stream GetPictureFromSpecialFolder(Uri path)
{
int startPathPos = UriSchemeMyImages.Length;
if (startPathPos >= path.ToString().Length)
{
return null;
}
string pictureName = path.ToString().Substring(startPathPos);
string myPicturesPath =
Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
if (!myPicturesPath.EndsWith("\\")) myPicturesPath += "\\";
string picturePath = Path.Combine(myPicturesPath, pictureName);
Visual Basic MyPicturesLocator.vb code showing usage of the GetResource Method from the Sample
Visual Basic code. Paste inside a class.
Imports GrapeCity.ActiveReports.Extensibility
Imports System.Globalization
Imports System.IO
Imports System.Runtime.InteropServices
If (String.IsNullOrEmpty(name)) Then
End If
Else
Throw New
InvalidOperationException(My.Resources.ResourceSchemeIsNotSupported)
End If
Return resource
End Function
Try
Dim picture As Image = Image.FromFile(picturePath)
picture.Save(stream, picture.RawFormat)
stream.Position = 0
Catch ex As OutOfMemoryException
' The file is not a valid image, or GDI+ doesn't support the image
type.
Return Nothing
Catch ex As ExternalException
' The image can't be saved.
Return Nothing
End Try
Return stream
End Function
End Class
Sample
In the Samples folder installed with the product, there is a Custom Resource Locator sample in a path like:
C:\Users\MyUserName\Documents\GrapeCity Samples\ActiveReports 9\Page
Reports\RDL\API\C#\CustomResourceLocator
This sample contains a custom resource locator that looks for files in the current user’s My Pictures folder. It does
this by looking for special MyPictures protocol.
In this section
Section Report Toolbox
This section provides information on each of the report controls available in the ActiveReports 9 Section
Report group of the Visual Studio toolbox.
Section Report Structure
Learn about the report structure in a section layout.
Section Report Events
Learn about events that you can use to customize section reports.
Scripting in Section Reports
Learn how to use scripts in a section layout.
Report Settings Dialog
See the various options provided in Report Settings dialog.
Grouping Data in Section Reports
Learn about grouping data in section layout.
Date, Time, and Number Formatting
Learn how you can customize formatting with .NET strings.
Optimizing Section Reports
Learn about ways to optimize section reports to reduce memory consumption and increase speed.
CacheToDisk and Resource Storage
Learn about IsolatedStorage and other considerations when you use CacheToDisk to reduce memory consumption.
Note: Take care in naming report controls, as they are displayed to end users in the advanced search feature
of the Viewer.
In this section
Label
The label is used to display descriptive text for a control and helps the user to describe the data displayed in a
report.
TextBox (Section Report)
The text box is a basic reporting control that allows direct display and editing of unformatted text.
CheckBox (Section Report)
The checkbox gives the user an option of yes or no and true or false.
RichTextBox
The rich text box control allows the user to enter rich text in the form of formatted text, tables, hyperlinks,
images, etc.
Shape (Section Report)
The shape is a user interface element that allows to draw shapes on the screen.
Picture
This control displays images files on the screen and also performs functions like resizing and cropping of images
being used.
Line (Section Report)
The line visually draws boundaries or highlights specific areas of a report.
ChartControl
You can use the ChartControl for a graphical presentation of data in a report. There are numerous chart types that
you can use to easily design and render data.
ReportInfo
The ReportInfo control allows you to quickly display page numbers, page counts and report dates.
Cross Section Controls
The CrossSectionLine and CrossSectionBox controls provide visual boundaries and highlight specific areas of your
report that span multiple report sections. This CrossSectionLine control is a vertical line that starts in the header
section and spans the intervening sections until it ends in the footer. (For a horizontal or diagonal line, use the
Line control.) The CrossSectionBox control starts in the header section and spans any intervening sections to end
in the related footer section.
Label
The Label control for Section reports is very similar to the standard Visual Studio Label control. Since, by inheriting
from the ARControl object, it can bind to data with the DataField property, and since you can enter static text in
the TextBox control, the main difference between the two controls is the Angle property of the Label control, and
the following properties of the TextBox control: CanGrow, CanShrink, CountNullValues, Culture, DistinctField,
OutputFormat, SummaryFunc, SummaryGroup, SummaryRunning, and SummaryType.
This control may become obsolete if the Angle property is added to the TextBox, and then will be kept only for
compatibility with previous versions.
Important Properties
Property Description
Angle Gets or sets the angle (slope) of the text within the control area. Set the Angle property to
900 to display text vertically.
CharacterSpacing Gets or sets the space between characters in points.
DataField Gets or sets the field name from the data source to bind to the control.
HyperLink Gets or sets a URL to which the viewer navigates when the user clicks the label at run time.
The URL becomes an anchor tag or a hyperlink in HTML and PDF exports.
LineSpacing Gets or sets the space between lines in points.
MultiLine Gets or sets a value indicating whether to allow text to break to multiple lines within the
control.
ShrinkToFit Gets or sets a value indicating whether to decrease the font size so that all of the text shows
within the boundaries of the control.
Style Gets or sets a style string for the label.
Text Gets or sets the text to show on the report.
TextJustify Specifies how to distribute text when the Alignment property is set to Justify. With any other
Alignment setting, this property is ignored.
You can double-click in the Label control to enter edit mode and enter text directly in the control, or you can enter
text in the Properties window or in code through the Text property.
You can format text in the Label control in edit mode using the ActiveReports toolbar, or you can modify properties
in the Properties window. Formats apply to all of the text in the control. Text formatting changes in the Properties
window immediately appear in the control, and changes made in the toolbar are immediately reflected in the
Properties window.
Note: In edit mode for a Label with the Alignment property set to Justify, the Alignment value temporarily
changes to the default value, Left. Once you leave edit mode, it automatically changes back to Justify.
Keyboard Shortcuts
In edit mode, you can use the following keyboard shortcuts.
In the End User Designer, you can disable this feature in the EditModeEntering ('EditModeEntering Event' in
the on-line documentation) and EditModeExit ('EditModeExit Event' in the on-line documentation)
events.
Label Dialog
With the control selected on the report, in the Commands section at the bottom of the Properties window, you can
click the Property dialog command to open the dialog.
General
Name: Enter a name for the label that is unique within the report. This name is displayed in the Document Outline
and in XML exports.
Tag: Enter a string that you want to persist with the control. If you access this property in code, it is an object,
but in the Properties window or Property dialog, it is a string.
Visible: Clear this check box to hide the control.
DataField: Select a field from the data source to bind to the control.
Text: Enter static text to show in the label.
HyperLink: Enter a URL to use in the Viewer HyperLink event. The URL automatically converts to an anchor tag or
hyperlink in PDF and HTML exports.
Appearance
Background Color: Select a color to use for the background of the label.
Angle: Use the slider to set the degree of slope for the text within the control area.
Font
Name: Select a font family name or a theme font.
Size: Choose the size in points for the font.
Style: Choose Normal or Italic.
Weight: Choose from Normal or Bold.
Color: Choose a color to use for the text.
Text direction
RightToLeft: Select this check box to reverse the text direction.
Vertical text: Select this check box for top to bottom text.
Alignment
Vertical alignment: Choose Top, Middle, or Bottom.
Horizontal alignment: Choose Left, Center, Right, or Justify.
Justify method: Choose Auto, Distribute, or DistributeAllLines.
Note: You must select Justify in the Horizontal alignment property to enable the Justification method
property options.
Wrap mode: Choose NoWrap, WordWrap, or CharWrap to determine whether and how text breaks to the next
line.
Padding
Enter values in points to set the amount of space to leave around the label.
Top
Left
Right
Bottom
Property Description
CharacterSpacing Gets or sets a character spacing in points.
LineSpacing Gets or sets a line spacing in points.
OutputFormat Gets or sets the mask string used to format the Value property before placing it in the Text
property.
Style Gets or sets a style string for the textbox.
TextJustify Specifies text justification with TextAlign set to Justify.
VerticalAlignment Gets or sets the position of the textbox's text vertically within the bounds of the control.
VerticalText Gets or sets whether to render text according to vertical layout rules.
CanGrow Determines whether ActiveReports should increase the height of the control based on its
ShrinkToFit Determines whether ActiveReports decreases the font size when text values exceed
available space.
WrapMode Indicates whether a multi-line textbox control automatically wraps words or characters to
the beginning of the next line when necessary.
CountNullValues Boolean which determines whether DBNull values should be included as zeroes in summary
fields.
Culture Gets or sets CultureInfo used for value output formatting.
DataField Gets or sets the field name from the data source to bind to the control.
HyperLink Gets or sets the hyperlink for the text control.
Text Gets or sets the formatted text value to be rendered in the control.
DistinctField Gets or sets the name of the data field used in a distinct summary function.
SummaryFunc Gets or sets the summary function type used to process the DataField Values.
SummaryGroup Gets or sets the name of the group header section that is used to reset the summary value
when calculating subtotals.
SummaryRunning Gets or sets a value that determines whether that data field summary value will be
accumulated or reset for each level (detail, group or page).
SummaryType Gets or sets a value that determines the summary type to be performed.
You can double-click in the TextBox control to enter edit mode and enter text directly in the control, or you can
enter text in the Properties window or in code through the Text property.
You can format text in the TextBox control in edit mode using the ActiveReports toolbar, or you can modify
properties in the Properties window. Formats apply to all of the text in the control. Text formatting changes in the
Properties window immediately appear in the control, and changes made in the toolbar are immediately reflected
in the Properties window.
Note: In edit mode for a TextBox with the Alignment property set to Justify, the Alignment value temporarily
changes to the default value, Left. Once you leave edit mode, it automatically changes back to Justify.
Keyboard Shortcuts
In edit mode, you can use the following keyboard shortcuts.
In the End User Designer, you can disable this feature in the EditModeEntering ('EditModeEntering Event' in
the on-line documentation) and EditModeExit ('EditModeExit Event' in the on-line documentation)
events.
TextBox Dialog
With the control selected on the report, in the Commands section at the bottom of the Properties window, you can
click the Property dialog command to open the dialog.
General
Name: Enter a name for the textbox that is unique within the report. This name is displayed in the Document
Textbox height
Can increase to accommodate contents: Select this check box to set CanGrow to True.
Can decrease to accommodate contents: Select this check box to set CanShrink to True.
Can shrink text to fit fixed size control: Select this check box to set ShrinkToFit to True.
Text direction
RightToLeft: Select this check box to reverse the text direction.
Vertical text: Select this check box for top to bottom text.
Alignment
Vertical alignment: Choose Top, Middle, or Bottom.
Horizontal alignment: Choose Left, Center, Right, or Justify.
Justify method: Choose Auto, Distribute, or DistributeAllLines.
Wrap mode: Choose NoWrap, WordWrap, or CharWrap to select whether to wrap words or characters to the next
line.
Note: You must select Justify in the Horizontal alignment property to enable the Justification method
property options.
Wrap mode: Choose NoWrap, WordWrap, or CharWrap to determine whether and how text breaks to the next
line.
Property Description
CheckAlignment Gets or sets the alignment of the check box text within the control drawing area.
Checked Gets or sets a value indicating whether the check box is in the checked state. You can also set
the Checked property of the check box in code or bind it to a Boolean database value.
DataField Gets or sets the field from the data source to bind to the control.
Text Gets or sets the printed caption of the check box.
You can double-click in the CheckBox control to enter edit mode and enter text directly in the control, or you can
enter text in the Properties window or you can assign data to display in code through the Text property.
You can format text in the CheckBox control in edit mode using the ActiveReports toolbar, or you can modify
properties in the Properties window. Formats apply to all of the text in the control. Text formatting changes in the
Properties window immediately appear in the control, and changes made in the toolbar are immediately reflected
in the Properties window.
Note: In edit mode for a CheckBox with the Alignment property set to Justify, the Alignment value
temporarily changes to the default value, Left. Once you leave edit mode, it automatically changes back to
Justify.
Keyboard Shortcuts
In edit mode, you can use the following keyboard shortcuts.
In the End User Designer, you can disable this feature in the EditModeEntering ('EditModeEntering Event' in
the on-line documentation) and EditModeExit ('EditModeExit Event' in the on-line documentation)
events.
CheckBox Dialog
With the control selected on the report, in the Commands section at the bottom of the Properties window, you can
click the Property dialog command to open the dialog.
General
Name: Enter a name for the CheckBox that is unique within the report. This name is displayed in the Document
Outline and in XML exports.
Tag: Enter a string that you want to persist with the control. If you access this property in code, it is an object,
but in the Properties window or Property dialog, it is a string.
Visible: Clear this check box to hide the control.
DataField: Select a field that returns a Boolean value from the data source to bind to the control. The value of
this field determines how to set the Checked property at run time.
Text: Enter static text to show in the textbox. If you specify a DataField value, this property is ignored.
Check Alignment: Drop down the visual selector to choose the vertical and horizontal position for the check box
within the control.
Checked: Select this check box to have the CheckBox control appear with a check mark in the box.
Appearance
Background Color: Select a color to use for the background of the textbox.
Font
Name: Select a font family name or a theme font.
Size: Choose the size in points for the font.
Style: Choose Normal or Italic.
Weight: Choose from Normal or Bold.
Color: Choose a color to use for the text.
Decoration: Select check boxes for Underline and Strikeout.
GDI Charset: Enter a value to indicate the GDI character set to use. For a list of valid values, see MSDN
Font.GDICharSet Property.
GDI Vertical: Select this checkbox to indicate that the font is derived from a GDI vertical font.
Alignment
Wrap mode: Choose NoWrap, WordWrap, or CharWrap to select whether to wrap words or characters to the
next line.
Padding
Enter values in points to set the amount of space to leave around the check box.
Top
Left
Right
Bottom
RichTextBox
In ActiveReports, the RichTextBox control is used to display, insert and manipulate formatted text. It is different
Property Description
AutoReplaceFields If True, any fields in the RTF control are replaced with fields from the data source.
CanGrow Determines whether ActiveReports should increase the height of the control based on its
content.
CanShrink Determines whether ActiveReports should decrease the height of the field based on its
value.
MultiLine Gets or sets a value that determines whether the RichTextBox prints multiple lines or a
single line.
DataField Gets or sets the field name from the data source to bind to the control.
Keyboard Shortcuts
In edit mode, you can use the following keyboard shortcuts.
In the End User Designer, you can disable this feature in the EditModeEntering ('EditModeEntering Event' in
the on-line documentation) and EditModeExit ('EditModeExit Event' in the on-line documentation)
events.
Supported Tags
HTML Tags
The following HTML tags are supported in the RichTextBox control.
Tip: In order to show special characters in an HTML file loaded into the control, use the character entity
reference (for example, è for è or & for &).
RichTextBox Dialog
With the control selected on the report, in the Commands section at the bottom of the Properties window, you can
click the Property dialog command to open the dialog.
General
Name: Enter a name for the RichTextBox that is unique within the report. This name is displayed in the Document
Outline and in XML exports.
Tag: Enter a string that you want to persist with the control. If you access this property in code, it is an object,
RichTextBox height
Can increase to accommodate contents: Select this check box to set CanGrow to True.
Can decrease to accommodate contents: Select this check box to set CanShrink to True.
Multiline: Select this check box to allow the control to display multiple lines of text.
Property Description
LineColor Gets or sets the color of the shape lines.
LineStyle Gets or sets the pen style used to draw the line.
LineWeight Gets or sets the pen width used to draw the shape in pixels.
Style Gets or sets the shape type to draw. You can select from Rectangle, Ellipse and a
RoundedRect.
RoundingRadius Sets the radius of each corner for the RoundRect shape type. You can select Default, TopLeft,
TopRight, BottomLeft or BottomRight. Selecting Default sets the radius of all the corners of
the Shape control to a specified percentage. Default value = 10 (percent).
Shape Dialog
With the control selected on the report, in the Commands section at the bottom of the Properties window, you can
click the Property dialog command to open the dialog.
General
Name: Enter a name for the shape that is unique within the report. This name is displayed in the Document
Outline and in XML exports.
Tag: Enter a string that you want to persist with the control. If you access this property in code, it is an object,
but in the Properties window or Property dialog, it is a string.
Visible: Clear this check box to hide the control.
Appearance
Shape type: Select the type of shape to display. You can choose from Rectangle, Ellipse, or RoundRect. For a
circle, set the control width and height properties to the same value, and choose Ellipse, or choose RoundRect and
set the Rounding radius to 100%.
Rounded Rectangle: When the Shape type is set to RoundRect, you can specify the radius for each corner of
the shape independently. Drag the handlers available at each corner of the shape to set the value of the radius
at each corner.
Use the same radius on specified corners: Select this option to apply the same radius to all selected
corners of the shape.
Use different radius on specified corners: Select this option to apply a different radius to each
selected corner of the shape.
Line style: Select a line style to use for the shape line. You can set it to Transparent, Solid, Dash, Dot, DashDot,
or DashDotDot.
Line weight: Enter the width in pixels for the shape line.
Line color: Select a color to use for the shape line.
Background color: Select a color to use for the background of the shape.
Picture
In section reports, the Picture control is used to print an image on the report. In the Image property of the Picture
control, you can select any image file to display on your report.
Note: Use the PictureAlignment and SizeMode properties to control cropping and alignment.
Important Properties
Property Description
LineColor Gets or sets the border line color around the Picture control.
LineStyle Gets or sets the pen style used to paint the border around the Picture control.
LineWeight Gets or sets the pen width of the border line in pixels.
PictureAlignment Gets or sets the position of the image within the control area.
Description Gets or sets the alternate description for the picture. Used in the Html Export for the "alt"
img tag property.
HyperLink Gets or sets a URL address that can be used in the viewer's Hyperlink event to navigate to
the specified location. The URL is automatically converted into an anchor tag or a hyperlink in
HTML and PDF exports.
Image Gets or sets the image to print.
SizeMode Gets or sets a value that determines how the image is sized to fit the Picture control area.
Picture Dialog
With the control selected on the report, in the Commands section at the bottom of the Properties window, you can
click the Property dialog command to open the dialog.
General
Name: Enter a name for the picture control that is unique within the report. This name is displayed in the
Document Outline and in XML exports.
Tag: Enter a string that you want to persist with the control. If you access this property in code, it is an object,
but in the Properties window or Property dialog, it is a string.
Visible: Clear this check box to hide the control.
DataField: Select a field from the data source to bind to the control.
Choose image: Click this button open a dialog where you can navigate to a folder from which to select an image
file to display.
HyperLink: Enter a URL to use in the Viewer HyperLink event. The URL automatically converts to an anchor tag or
hyperlink in PDF and HTML exports.
Note: If you need lines to span across report sections, please see the CrossSectionLine control.
You can use your mouse to visually move and resize the Line, or you can use the Properties window to change its
X1, X2, Y1, and Y2 properties to specify the coordinates for its starting and ending points.
Important Properties
Property Description
AnchorBottom Anchors the line to the bottom of the containing section so that the line grows along with the
section.
LineColor Gets or sets the color of the line.
LineStyle Gets or sets the pen style used to draw the line.
LineWeight Gets or sets the pen width of the line in pixels.
X1 Gets or sets the horizontal coordinate of the line's starting point.
X2 Gets or sets the horizontal coordinate of the line's end point.
Y1 Gets or sets the vertical coordinate of the line's starting point.
Y2 Gets or sets the vertical coordinate of the line's end point.
Line Dialog
With the control selected on the report, in the Commands section at the bottom of the Properties window, you can
click the Property dialog command to open the dialog.
General
Name: Enter a name for the line that is unique within the report. This name is displayed in the Document Outline
and in XML exports.
Tag: Enter a string that you want to persist with the control. If you access this property in code, it is an object,
but in the Properties window or Property dialog, it is a string.
Visible: Clear this check box to hide the control.
Appearance
Line style: Select a line style to use for the line. You can set it to Transparent, Solid, Dash, Dot, DashDot, or
PageBreak
You can cause ActiveReports to break to a new page at any point within any section using the PageBreak control.
All controls placed below the PageBreak in the section render to a new page.
Tip: Another way to cause ActiveReports to break to a new page is by setting the NewPage property of a
section to Before, After, or BeforeAfter. This property is available on any section except for PageHeader and
PageFooter.
Important Properties
Property Description
Enabled Determines whether to enable the PageBreak.
Location - X Gets or sets the horizontal location of an object.
Location - Y Gets or sets the vertical location of an object.
PageBreak Dialog
With the control selected on the report, in the Commands section at the bottom of the Properties window, you can
click the Property dialog command to open the dialog.
General
Name: Enter a name for the PageBreak that is unique within the report. This name is displayed in the Document
Outline and in XML exports.
Tag: Enter a string that you want to persist with the control. If you access this property in code, it is an object,
but in the Properties window or Property dialog, it is a string.
Enabled: Select a field from the data source to bind to the control.
Property Description
Alignment The horizontal alignment of the caption in the control. Select from Near, Center, or Far.
See CaptionPosition for vertical alignment.
AutoSize When set to True, the barcode automatically stretches to fit the control.
BackColor Select a background fill color for the barcode.
Code49 Code49 options include Grouping and Group. If Grouping is set to True, any value not
expressed by a single barcode is expressed by splitting it into several barcodes, and the
Group property may be set to a number between 0 and 8. The default values are False
and 0, respectively. When the Group property is set to 2, the grouped barcode's second
symbol is created. When invalid group numbers are set, the BarCodeDataException is
thrown.
DataMatrix DataMatrix options include EccMode, Ecc200SymbolSize, Ecc200EncodingMode,
Ecc000_140SymbolSize, StructuredAppend, StructureNumber, and FileIdentifier. Select
from supplied values, or enter a number for the StructureNumber and FileIdentifier.
Font Set the font for the caption. Only takes effect if you set the CaptionPosition property to a
value other than None.
ForeColor Select a color for the barcode and caption.
GS1Composite GS1Composite Options only apply to the barcode styles RSS14Stacked and RSSLimited.
Type sets the composite symbol type.
Value sets the CCA character data.
NarrowBarWidth Also known as the X dimension, this is a value defining the width of the narrowest part
of the barcode. Before using an extremely small value for this width, ensure that the
scanner can read it. This value is specified in pixels (for example, 10 pixels).
NWRatio Also known as the N dimension, this is a value defining the multiple of the ratio between
the narrow and wide bars in symbologies that contain bars in only two widths. For
example, if it is a 3 to 1 ratio, this value is 3.
PDF417 PDF417 Options only apply to the barcode style PDF417.
Column sets column numbers for the barcode. Values for this property range
from 1 to 30. The default value is -1 which automatically determines row
QuietZone Sets an area of blank space on each side of a barcode that tells the scanner where the
symbology starts and stops. You can set separate values for the Left, Right, Top, and
Bottom.
Rotation Sets the amount of rotation to use for the barcode. You can select from None,
Rotate90Degrees, Rotate180Degrees,or Rotate270Degrees.
RssExpandedStacked Sets the number of stacked rows to use.
Style Sets the symbology used to render the barcode. See the table below for details about
each style.
SupplementOptions Sets the 2/5-digit add-ons for EAN/UPC symbologies. You can specify Text, DataField,
BarHeight, CaptionPosition, and Spacing for the supplement.
Text Sets the value to print as a barcode symbol and caption.ActiveReports fills this value
from the bound data field if the control is bound to the data source.
Limitations
Some barcode types may render incorrectly and contain white lines in the Html and RawHtml views. However, this
limitation does not affect printing and scanning. The list of barcode types that may render with white lines in the
Html and RawHtml views:
Code49
QRCode
Barcode Dialog
With the control selected on the report, in the Commands section at the bottom of the Properties window, you can
click the Property dialog command to open the dialog.
General
Name: Enter a name for the control that is unique within the report. This name is displayed in the Document
Outline and in XML exports.
Tag: Enter a string that you want to persist with the control. If you access this property in code, it is an object,
but in the Properties window or Property dialog, it is a string.
Visible: Clear this check box to hide the control.
DataField: Select a field from the data source to bind to the control.
Text: Enter static text to show in the textbox. If you specify a DataField value, this property is ignored.
Autosize: Clear this check box to prevent the barcode from automatically resizing to fit the control.
Caption
Location: Select a value to indicate whether and where to display a caption for the barcode. You can select from
Above, Below, or None.
Text alignment: Select a value to indicate how to align the caption text. You can select from Center, Near, or
Far.
Barcode Settings
Style: Enter the type of barcode to use. ActiveReports supports all of the most popular symbologies:
Table of all included symbologies
Notes: The RSS and QRCode styles have fixed height-to-width ratios. When you resize the width, the height
is automatically calculated.
When you choose a style that offers supplemental options, the additional options appear below.
RSS14StackedOmnidirectional RSS14StackedOmnidirectional
uses the EAN.UCC information
with omnidirectional scanning as
in the RSS14, but stacked in two
rows for a smaller width.
Bar Height: Enter a value in inches (for example, .25in) for the height of the barcode.
Narrow Bar Width (also known as X dimension): Enter a value in points (for example, 0.8pt) for the width of the
narrowest part of the barcode. Before using an extremely small value for this width, ensure that the scanner can
read it.
Tip: For accurate scanning, the quiet zone should be ten times the Narrow Bar Width value.
Narrow Width Bar Ratio: Enter a value to define the multiple of the ratio between the narrow and wide bars in
symbologies that contain bars in only two widths. For example, if it is a 3 to 1 ratio, this value is 3. Commonly
used values are 2, 2.5, 2.75, and 3.
Quiet Zone
A quiet zone is an area of blank space on either side of a barcode that tells the scanner where the
symbology starts and stops.
Left: Enter a size in inches of blank space to leave to the left of the barcode.
Right: Enter a size in inches of blank space to leave to the right of the barcode.
Top: Enter a size in inches of blank space to leave at the top of the barcode.
Bottom: Enter a size in inches of blank space to leave at the bottom of the barcode.
Note: The units of measure listed for all of these properties are the default units of measure used if
you do not specify. You may also specify cm, mm, in, pt, or pc.
Checksum
A checksum provides greater accuracy for many barcode symbologies.
Compute Checksum: Select whether to automatically calculate a checksum for the barcode.
Note: If the symbology you choose requires a checksum, setting this value to False has no effect.
Code49 Options
Code49 Options are available for the Code49 barcode style.
Use Grouping: Indicates whether to use grouping for the Code49 barcode. The possible values are True
or False.
Group Number: Enter a number between 0 and 8 for the barcode grouping.
DataMatrix Options
DataMatrix Options are available for the DataMatrix barcode style.
EccMode: Select the Ecc mode from the drop-down list. The possible values are ECC000, ECC050,
ECC080, ECC100, ECC140 or ECC200.
Ecc200 Symbol Size: Select the size of the ECC200 symbol from the drop-down list. The default value is
SquareAuto.
Ecc200 Encoding Mode: Select the encoding mode for ECC200 from the drop-down list. The possible
values are Auto, ASCII, C40, Text, X12, EDIFACT or Base256.
Ecc000_140 Symbol Size: Select the size of the ECC000_140 barcode symbol from the drop-down list.
Structured Append: Select whether the barcode symbol is part of the structured append symbols. The
possible values are True or False.
Structure Number: Enter the structure number of the barcode symbol within the structured append
symbols.
File Identifier: Enter the file identifier of a related group of the structured append symbols. If you set the
value to 0, the file identifier symbols are calculated automatically.\
Encoding: Select the barcode encoding from the drop-down list.
EAN128FNC1 Options
EAN128FNC1 Options are available for the EAN128FNC1 barcode style.
DPI: Specify the printer resolution.
Module Size: Enter the horizontal size of the barcode module.
Bar Adjust: Enter the adjustment size by dot units, which affects the size of the module and not the entire
barcode.
GS1Composite Options
MicroPDF417 Options
MicroPDF417 Options are available for the MicroPDF417 barcode style.
Compaction Mode: Select the type of the compaction mode from the drop-down list. The possible values
are Auto, TextCompactionMode, NumericCompactionMode, or ByteCompactionMode.
Version: Select the version from the drop-down box to set the symbol size.
Segment Index: The segment index of the structured append symbol. The valid value is from 0 to 99998,
and less than the value in Segment Count.
Segment Count: The segment count of the structured append symbol. The valid value is from 0 to 99999.
File ID: The file id of the structured append symbol. The valid value is from 0 to 899.
PDF417 Options
PDF417 Options are available for the Pdf417 barcode style.
Columns: Enter column numbers for the barcode.
Rows: Enter row numbers for the barcode.
Error Correction Level: Enter the error correction level for the barcode.
PDF 417 Barcode Type: Select the PDF417 barcode type form the drop-down list. The possible values are
Normal or Simple.
QRCode Options
QRCode Options are available for the QRCode barcode style.
Model: Select the model for the QRCode barcode style from the drop-down list. The possible values
are Model1 or Model2.
ErrorLevel: Select the error correction level for the barcode from the drop-down list. The possible values
are M, L, H or Q.
Version: Enter the version of the QRCode barcode style.
Mask: Select the pattern for the barcode masking form the drop-down list.
Use Connection: Select whether to use the connection for the barcode. The possible values are True or
False.
ConnectionNumber: Enter the connection number for the barcode.
Encoding: Select the barcode encoding from the drop-down list.
RssExpandedStacked Options
RssExpandedStacked Options are available for the RSSExpandedStacked barcode style.
Row Count: Enter the number of the barcode stacked rows.
Caution: It is not a recommended practice to initialize the subreport in the Format event. Doing so creates
a new instance of the subreport each time the section processes. This consumes a lot of memory and
processing time, especially in a report that processes a large amount of data.
Important Properties
Property Description
CanGrow Determines whether ActiveReports increases the height of the control based on its content.
CanShrink Determines whether ActiveReports decreases the height of the control based on its value.
CloseBorder By default, the bottom border of the control does not render until the end of the subreport. Set
this property to True to have it render at the bottom of each page. (Only available in code.)
Report Attaches a report object to the control. (Only available in code.)
SubReport Dialog
With the control selected on the report, in the Commands section at the bottom of the Properties window, you can
click the Property dialog command to open the dialog.
General
Name: Enter a name for the SubReport that is unique within the report. This name is displayed in the Document
Outline and in XML exports.
Tag: Enter a string that you want to persist with the control. If you access this property in code, it is an object,
but in the Properties window or Property dialog, it is a string.
Visible: Clear this check box to hide the control.
ReportName: This property is not used by ActiveReports, but you can use it to store the path or relative path
to an RPX report file that you want to load into a generic report instance in code.
Format
SubReport Height
Can increase to accommodate contents: Clear this check box to set CanGrow to False.
Can decrease to accommodate contents: Clear this check box to set CanShrink to False.
OleObject
The OleObject control is hidden from the toolbox by default, and is only retained for backward compatibility. You
can enable the OleObject control in the Visual Studio toolbox only.
To enable the control in the Visual Studio toolbox, you must change the EnableOleObject property to true. This
property can be found here: C:\Program Files\GrapeCity\ActiveReports 9\Grapecity.ActiveReports.config
Once enabled, you can add the OleObject control to reports. When you drop the control onto your report, the
Insert Object dialog appears. This dialog allows you to create a new object or select one from an existing file.
Note: When you deploy reports that use the OleObject, you must also deploy the
GrapeCity.ActiveReports.Interop.v9.dll, or for 64-bit machines, the GrapeCity.ActiveReports.Interop64.v9.dll.
Caution: The WPF Viewer does not support the OLE object. If you preview a report containing the OLE
object in the WPF Viewer, the OLE object will not be displayed.
Important Properties
Property Description
Create from File allows you to insert the contents of the file as an object into your document so that
you can display it while printing.
ChartControl
In ActiveReports, you can use the ChartControl to present data graphically in a report. The chart offers you 17
core chart types along with all of their variations, plus access to properties that control every aspect of your chart's
appearance.
The ChartControl presents a series of points in different ways depending upon the chart type you choose. Some
chart types display multiple series of data points in a single chart. Add more information to your chart by
configuring data points, axes, titles, and labels. You can modify all of these elements in the Properties Window.
When you first drop a ChartControl onto a report, the Chart Wizard appears, and you can set up your chart type,
appearance, series, titles, axes, and legend on the pages of the wizard. You can specify a data source on
the Series page.
Important Properties
Property Description
BlackAndWhiteMode Gets or sets a value indicating whether the chart is drawn in black and white using hatch
patterns and line dashing to designate colors.
AutoRefresh Gets or sets a value indicating whether the chart is automatically refreshed (redrawn)
after every property change.
Backdrop Gets or sets the chart's background style.
ChartAreas Opens the ChartArea Collection Editor where you can set properties such as axes and wall
ranges, and you can add more chart areas.
ChartBorder Gets or sets the chart's border style.
ColorPalette Gets or sets the chart's color palette.
DataSource Gets or sets the data source for the chart.
Chart Elements
The ActiveReports ChartControl elements help you to easily analyze the visual information and interpret numerical
and relational data. The following image illustrates the elements that make up the ActiveReports ChartControl.
Axis Label
A label along an axis that lets you label the units being shown.
Axis Title
The axis title allows you to provide a title for the information being shown on the axis.
Chart Backdrop
The chart backdrop is the background for the whole chart that is created. You can create your own backdrop using
the different styles and colors available or you can use an image as a backdrop for your chart.
Chart Title
The chart title serves as the title for the chart control.
Footer Title
The footer title allows you to add a secondar title for the chart control along the bottom.
Grid Line
Chart Wizard
The ChartControl features a Chart Wizard which takes you through the basic steps of creating a chart. The Chart
Wizard automatically appears when you first add a chart control to a report. If you prefer not to have the
wizard appear automatically, clear the Auto Run Wizard checkbox at the bottom of the wizard.
The Chart Wizard has the following pages:
Chart Type
In the Chart Wizard that appears, the Chart Type page displays all available 2D and 3D chart types, along with a
preview of the selected chart to the right. You can select the type of chart that you want to create and change the
axes by selecting the Swap Axes checkbox. If you are using a 3D chart, you can also change the projection and
light settings.
Note: See ChartType ('ChartType Enumeration' in the on-line documentation) for more information.
Appearance
The Appearance page has two tabs. The Palette tab allows you to select a color scheme. The Appearance
tab allows you to select individual elements in the chart preview, such as its title, footer, legend, legend title,
backdrop, and the chart itself and select appearance settings for them.
Series
The Series page has two tabs. The Series Settings tab allows you to set the data source for the chart and bind
data fields to X and Y values for each series in the chart, and to add and remove chart series. You can even set
different chart types for each series. The Data Points tab allows you to set static data values when you choose
not to bind the X and Y values to data fields.
Title
The Title Page helps you to set properties for the header and footer titles. You can change the title text, font size
and color, border settings, background color and visibility.
Axes
The Axes page has two tabs, one for Axis X and the other for Axis Y. On these tabs, you can enter titles for the
axes and set the font size and other font properties. This page also allows you to add and format labels, add tick
marks and grid lines, and select whether to show the axis inside or outside the chart area.
Area Chart
Area2D, StackedArea, StackedArea100Pct, and Area3D
Bar Chart
Bar2D and Bar3D
Line Chart
Bezier, Line, LineXY and Line3D
Pie and Doughnut Charts
Doughnut/Pie and Doughnut3D/Pie
Financial Chart
Candle, HiLo, Renko, Point and Figure, Kagi, Stock, StockOpenClose, and Three Line Break
Point and Bubble Charts
Bubble, BubbleXY, Scatter, and PlotXY
Area Chart
The Area Chart displays quantitive data and is based on the Line chart. In Area charts, the space between axis
and line are commonly emphasized with colors, textures and hatchings.
2D Area Charts
Given below is the list of 2D charts that fall under the Area Chart category:
Area Chart
An area chart is used to compare trends over a period of time or across categories.
Chart Information
ChartType Area2D
Number of Y values per data 1
point
Number of Series 1 or more
Marker Support Series or Data Point
Custom Properties None
Chart Information
ChartType Area2D
Number of Y values per data 1
point
Number of Series 1 or more
Marker Support Series or Data Point
Custom Properties None
Chart Information
ChartType Area2D
Number of Y values per data 1
point
Number of Series 1 or more
Marker Support Series or Data Point
Custom Properties None
3D Area Charts
Given below is the list of 3D charts that fall under the Area Chart category:
Area Chart
Use a 3D area chart to compare trends in two or more data series over a period of time or in specific categories, so
that data can be viewed side by side.
Note: To view a chart in 3D, in the ChartAreas property open the ChartArea Collection Editor and set
the ProjectionType property to Orthogonal.
Chart Information
ChartType Area3D
Number of Y values 1
per data point
Number of Series 1 or more
Marker Support Series or Data Point
Custom Properties The LineBackdrop property gets or sets the
backdrop information for the 3D line.
The Thickness property gets or sets the thickness of
the 3D line.
The Width property gets or sets the width of the 3D
line.
Below is an example of how to set the custom chart properties at run time for a 3D area chart as shown for the
first series in the image above.
Visual Basic
C#
this.ChartControl1.Series[0].Properties["LineBackdrop"] = new
GrapeCity.ActiveReports.Chart.Graphics.Backdrop(System.Drawing.Color.Red,
((System.Byte)(150)));
this.ChartControl1.Series[0].Properties["Thickness"] = 5f;
this.ChartControl1.Series[0].Properties["Width"] = 30f;
Chart Information
ChartType Area3D
Number of Y values per data 1
point
Number of Series 1 or more
Marker Support Series or Data Point
Custom Properties The Width property gets or sets the width of the 3D stacked area.
Chart Information
ChartType Area3D
Number of Y values per data 1
point
Number of Series 1 or more
Marker Support 3
Custom Properties The Width property gets or sets the width of the 3D stacked area.
Bar Chart
The Bar Chart is a chart with rectangular bars where the lengths of bars are proportional to the values they
represent. The bars can be plotted vertically or horizontally.
2D Bar Charts
This section describes 2D charts that fall under the Bar Chart category.
3D Bar Charts
This section describes 3D charts that fall under the Bar Chart category.
2D Bar Charts
Given below is the list of 2D charts that falls under the Bar Chart category.
Bar Chart
In a Bar Chart, values are represented by the height of the bar shaped marker as measured by the y-axis.
Category labels are displayed on the x-axis. Use a bar chart to compare values of items across categories.
Chart Information
ChartType Bar2D
Number of Y values per data 1
point
Number of series 1 or more
Marker support Series or Data Point
Custom Properties The Gap property gets or sets the space between the bars of each X axis
value.
Below is an example of how to set the custom chart properties at run time for a bar chart.
Visual Basic
Me.ChartControl1.Series(0).Properties("Gap") = 50.0F
C#
this.ChartControl1.Series[0].Properties["Gap"] = 50f;
Gantt Chart
The Gantt chart is a project management tool used to chart the progress of individual project tasks. The chart
compares project task completion to the task schedule.
Caution: In a Gantt chart, the X and Y axes are reversed. AxisX is vertical and AxisY is horizontal.
Chart Information
ChartType Bar2D
Number of Y values per data 2
point
Number of Series 1 or more
Marker Support Series or Data Point
Custom Properties The Gap property gets or sets the space between the bars of each X axis
value.
Below is an example of how to set the custom chart properties at run time for a Gantt chart.
Visual Basic
C#
this.ChartControl1.Series[0].Properties["Gap"] = 50f;
Chart Information
ChartType Bar2D
Number of Y values per data 1
point
Number of Series 1 or more
Marker Support Series or Data Point
Custom Properties The Gap property gets or sets the space between the bars of each X axis
value.
Below is an example of how to set the custom chart properties at run time for a horizontal bar chart.
Visual Basic
Me.ChartControl1.Series(0).Properties("Gap") = 65.0F
C#
this.ChartControl1.Series[0].Properties["Gap"] = 65f;
Chart Information
ChartType Bar2D
Number of Y values per data 1
point
Number of Series 1 or more
Marker Support Series or Data Point
Below is an example of how to set the custom chart properties at run time for a StackedBar chart.
Visual Basic
Me.ChartControl1.Series(0).Properties("Gap") = 100.0F
C#
this.ChartControl1.Series[0].Properties["Gap"] = 100f;
Chart Information
ChartType Bar2D
Number of Y values per data 1
point
Number of Series 1 or more
Marker Support Series or Data Point
Custom Properties The Gap property gets or sets the space between the bars of each X axis
value
Below is an example of how to set the custom chart properties at run time for a StackedBar100Pct chart.
Visual Basic
Me.ChartControl1.Series(0).Properties("Gap") = 100.0F
C#
this.ChartControl1.Series[0].Properties["Gap"] = 100f;
3D Bar Charts
Given below is the list of 3D charts that fall under the Bar Chart category.
Caution: To view a chart in 3D, open the ChartArea Collection Editor in the ChartAreas property and set
the ProjectionType property to Orthogonal.
Bar Chart
In a Bar Chart, values are represented by the height of the bar shaped marker as measured by the y-axis. Category
labels are displayed on the x-axis. Use a 3D bar chart to compare values of items across categories, allowing the data
to be viewed in a convenient 3D format.
Chart Information
ChartType Bar3D
Number of Y values per data 1
point
Number of Series 1 or more
Marker Support Series or Data Point
Custom Properties The BarTopPercent property gets or sets the percentage of the top of the bar
that is shown for Cone or Custom BarTypes.
The BarType property gets or sets the type of bars that is displayed.Use
BarType enumeration value.
The Gap property gets or sets the space between the bars of each X axis value.
The RotationAngle propertygets or sets the starting horizontal angle for
custom 3D bar shapes. Can only be used with the Custom BarType.
The VertexNumber property gets or sets the number of vertices for the data
point, used to create custom 3D bar shapes. Can only be used with the Custom
BarType. Bars must contain 3 or more vertices.
Gantt Chart
The 3D gantt chart displays a gantt chart in 3D.
Caution: In a 3D Gantt chart the X and Y axes are reversed. AxisX is vertical and AxisY is horizontal.
Chart Information
ChartType Bar3D
Number of Y values per data 2
point
Number of Series 1 or more
Marker Support Series or Data Point
Custom Properties The BarTopPercent property gets or sets the percentage of the top of the bar
that is shown for Cone or Custom BarTypes.
The BarType property gets or sets the type of bars that are displayed. Use
BarType enumeration value.
The Gap property gets or sets the space between the bars of each X axis value.
The VertexNumber property gets or sets the number of vertices for the data
point, used to create custom 3D bar shapes. Can only be used with the Custom
BarType. Bars must contain 3 or more vertices.
Chart Information
ChartType Bar3D
Number of Y values per data 1
point
Number of Series 1 or more
Marker Support Series or Data Point
Custom Properties The BarTopPercent property gets or sets the percentage of the top of the bar
that is shown for Cone or Custom BarTypes.
The BarType propertygets or sets the type of bars that is displayed. Use
BarType enumeration value.
The Gap property gets or sets the space between the bars of each X axis value.
The RotationAngle property gets or sets the starting horizontal angle for
custom 3D bar shapes. Can only be used with the Custom BarType.
The VertexNumber property gets or sets the number of vertices for the data
point, used to create custom 3D bar shapes. Can only be used with the Custom
BarType. Bars must contain 3 or more vertices.
Below is an example of how to set the custom chart properties at run time for a horizontal 3D bar chart as shown
above.
Visual Basic
Me.ChartControl1.Series(0).Properties("BarTopPercent") = 80.0F
Me.ChartControl1.Series(0).Properties("BarType") =
GrapeCity.ActiveReports.Chart.BarType.Custom
Me.ChartControl1.Series(0).Properties("Gap") = 65.0F
Me.ChartControl1.Series(0).Properties("PointBarDepth") = 100.0F
Me.ChartControl1.Series(0).Properties("RotationAngle") = 0.0F
Me.ChartControl1.Series(0).Properties("VertexNumber") = 6
C#
this.ChartControl1.Series[0].Properties["BarTopPercent"] = 80f;
this.ChartControl1.Series[0].Properties["BarType"] =
GrapeCity.ActiveReports.Chart.BarType.Custom;
this.ChartControl1.Series[0].Properties["Gap"] = 65f;
this.ChartControl1.Series[0].Properties["PointBarDepth"] = 100.0f;
this.ChartControl1.Series[0].Properties["RotationAngle"] = 0f;
this.ChartControl1.Series[0].Properties["VertexNumber"] = 6;
Chart Information
ChartType Bar3D
Number of Y values per data 1
point
Number of Series 1 or more
Marker Support Series or Data Point
Custom Properties The BarTopPercent property gets or sets the percentage of the top of the bar
that is shown for Cone or Custom BarTypes.
The BarType property gets or sets the type of bars that are displayed. Use
BarType enumeration value.
The Gap property gets or sets the space between the bars of each X axis value.
The VertexNumber property gets or sets the number of vertices for the data
point, used to create custom 3D bar shapes. Can only be used with the Custom
BarType. Bars must contain 3 or more vertices.
Below is an example of how to set the custom chart properties at run time for a StackedBar3D chart.
Visual Basic
Me.ChartControl1.Series(0).Properties("BarTopPercent") = 80.0F
Me.ChartControl1.Series(0).Properties("BarType") =
GrapeCity.ActiveReports.Chart.BarType.Custom
Me.ChartControl1.Series(0).Properties("Gap") = 65.0F
Me.ChartControl1.Series(0).Properties("VertexNumber") = 6
C#
this.ChartControl1.Series[0].Properties["BarTopPercent"] = 100f;
this.ChartControl1.Series[0].Properties["BarType"] =
GrapeCity.ActiveReports.Chart.BarType.Custom;
this.ChartControl1.Series[0].Properties["Gap"] = 65f;
this.ChartControl1.Series[0].Properties["VertexNumber"] = 6
Chart Information
ChartType Bar3D
Number of Y values per data 1
point
Below is an example of how to set the custom chart properties at run time for a StackedBar3D100Pct chart.
Visual Basic
Me.ChartControl1.Series(0).Properties("BarTopPercent") = 80.0F
Me.ChartControl1.Series(0).Properties("BarType") =
GrapeCity.ActiveReports.Chart.BarType.Custom
Me.ChartControl1.Series(0).Properties("Gap") = 65.0F
Me.ChartControl1.Series(0).Properties("VertexNumber") = 6
C#
this.ChartControl1.Series[0].Properties["BarTopPercent"] = 100f;
this.ChartControl1.Series[0].Properties["BarType"] =
GrapeCity.ActiveReports.Chart.BarType.Custom;
this.ChartControl1.Series[0].Properties["Gap"] = 65f;
this.ChartControl1.Series[0].Properties["VertexNumber"] = 6
Bar/Cylinder Chart
It is almost similar to a bar chart and values are represented by the height of the bar shaped marker as measured by
the y-axis. Category labels are displayed on the x-axis. The only difference is that in a Bar/Cylinder Chart the data is
represented through cylindrical shaped markers.
Chart Information
ChartType Bar3D
Number of Y values per data 1
point
Number of Series 1 or more
Marker Support Series or Data Point
Custom Properties The BarTopPercent property gets or sets the percentage of the top of the bar
that is shown for Cone or Custom BarTypes.
The BarType property gets or sets the type of bars that is displayed. Use
BarType enumeration value.
The Gap property gets or sets the space between the bars of each X axis value.
The RotationAngle property gets or sets the starting horizontal angle for
custom 3D bar shapes. Can only be used with the Custom BarType.
The VertexNumber property gets or sets the number of vertices for the data
point, used to create custom 3D bar shapes. Can only be used with the Custom
BarType. Bars must contain 3 or more vertices.
Bar/Pyramid Chart
In a Bar/Pyramid Chart the data is represented through pyramid shaped bars and values are represented by the
height of the bars as measured by the y-axis. Category labels are displayed on the x-axis.
Chart Information
ChartType Bar3D
Chart Information
ChartType Bar3D
Number of Y values per data 1
point
Number of Series 1 or more
Marker Support Series or Data Point
Custom Properties The BarTopPercent property gets or sets the percentage of the top of the bar
that is shown for Cone or Custom BarTypes.
The BarType property gets or sets the type of bars that are displayed. Use
BarType enumeration value.
The Gap property gets or sets the space between the bars of each X axis value.
The RotationAngle property gets or sets the starting horizontal angle for
custom 3D bar shapes. Can only be used with the Custom BarType.
The VertexNumber property gets or sets the number of vertices for the data
point, used to create custom 3D bar shapes. Can only be used with the Custom
BarType. Bars must contain 3 or more vertices.
Below is an example of how to set the custom chart properties at run time for a 3D clustered bar chart as shown
above.
Visual Basic
' set the custom properties for series 1.
Me.ChartControl1.Series(0).Properties("BarTopPercent") = 50.0F
Me.ChartControl1.Series(0).Properties("BarType") =
GrapeCity.ActiveReports.Chart.BarType.Custom
Me.ChartControl1.Series(0).Properties("Gap") = 300.0F
Me.ChartControl1.Series(0).Properties("RotationAngle") = 0.0F
Me.ChartControl1.Series(0).Properties("VertexNumber") = 6
C#
// set the custom properties for series 1.
this.ChartControl1.Series[0].Properties["BarTopPercent"] = 50f;
this.ChartControl1.Series[0].Properties["BarType"] =
GrapeCity.ActiveReports.Chart.BarType.Custom;
this.ChartControl1.Series[0].Properties["RotationAngle"] = 0f;
this.ChartControl1.Series[0].Properties["VertexNumber"] = 6;
Line Chart
The Line Chart is a type of chart that displays information as a series of data points, connected by straight line
segments.
2D Line Charts
This section describes 2D charts that fall under the Line Chart category.
3D Line Charts
This section describes 3D charts that fall under the Line Chart category.
2D Line Charts
Given below is the list of 2D charts that fall under the Line Chart category.
Bezier Chart
Use a Bezier or spline chart to compare trends over a period of time or across categories. It is a line chart that
plots curves through the data points in a series.
Chart Information
ChartType Line2D
Number of Y values per data 1
point
Number of Series 1 or more
Marker Support Series or Data Point
Custom Properties The Line property gets or sets the line element. Used to set color, thickness
and shape of a line.
The Tension property gets or sets the tension of the curved lines.
Chart Information
ChartType Line2D
Custom Properties The Line property gets or sets the line element. Used to set color, thickness
and shape of a line.
The Tension property gets or sets the tension of the curved lines.
Line Chart
Use a 2D line chart to compare trends over a period of time or in certain categories in a 2D format.
Chart Information
ChartType Line2D
Number of Y values per data 1
point
Number of Series 1 or more
Marker Support Series or Data Point
Custom Properties The Line property gets or sets the line element. Used to set color, thickness
and shape of a line.
The LineJoin property sets the type of join to draw when two lines connect.
Line XY Chart
A line XY chart plots points on the X and Y axes as one series and uses a line to connect points to each other.
Chart Information
ChartType Line2D
Custom Properties The Line property gets or sets line elements. Used for setting color, thickness
and shape of a line.
The LineJoin property gets or sets the type of join to draw when two lines
connect.
3D Line Charts
Given below is the list of 3D charts that fall under the Line Chart category.
Bezier Chart
Render a Bezier or Spline chart in 3D format.
Chart Information
ChartType Line3D
Number of Y values per data 1
point
Number of Series 1 or more
Marker Support Series or Data Point
Custom Properties The LineBackdrop property gets or sets the backdrop information for the 3D
curved line.
The Tension property gets or sets the tension of the curved lines.
The Width property gets or sets the width of the 3D curved line.
Line Chart
Use a 3D line chart to compare trends over a period of time or in certain categories in a 3D format.
Caution: To view a chart in 3D, open the ChartArea Collection Editor in the ChartAreas property and set
the ProjectionType property to Orthogonal.
Chart Information
ChartType Line3D
Number of Y values per data 1
point
Number of Series 1or more
Marker Support Series or Data Point
Custom Properties The LineBackdrop property gets or sets the backdrop information for the 3D
line.
The Thickness property gets or sets the thickness of the 3D line.
The Width property gets or sets the width of the 3D line.
Below is an example of how to set the custom chart properties at run time for a horizontal 3D bar chart as shown
above.
Visual Basic
C#
this.chartControl1.Series[0].Properties["LineBackdrop"] = new
Backdrop(Color.GreenYellow);
this.chartControl1.Series[0].Properties["Thickness"] = 8f;
this.chartControl1.Series[0].Properties["Width"] = 40f;
2D Pie/Doughnut Charts
Given below is the list of 2D charts that fall under the Pie/Doughnut Chart category.
Doughnut Chart
A doughnut chart shows how the percentage of each data item contributes to the total.
In order to show each section of the pie in a different color, set the Background property for each data
point.
Chart Information
ChartType Pie/Doughnut 2D
Number of Y values per data 1
point
Number of Series 1 or more
Marker Support Series or Data Point
Custom Properties The Clockwise property gets or sets a value indicating whether to display
the data in clockwise order.
The ExplodeFactor property gets or sets the amount of separation between
data point values.
The HoleSize property gets or sets the inner radius of the chart.
The OutsideLabels property gets or sets a value indicating whether the data
point labels appear outside the chart.
The StartAngle property gets or sets the horizontal start angle for the
series.
Visual Basic
Me.ChartControl1.Series(0).Properties("ExplodeFactor") = 0.0F
Me.ChartControl1.Series(0).Properties("HoleSize") = 0.25F
Me.ChartControl1.Series(0).Properties("OutsideLabels") = False
Me.ChartControl1.Series(0).Properties("Radius") = 2.0F
Me.ChartControl1.Series(0).Properties("StartAngle") = 0.0F
C#
this.ChartControl1.Series[0].Properties["ExplodeFactor"] = 0f;
this.ChartControl1.Series[0].Properties["HoleSize"] = 0.25f;
this.ChartControl1.Series[0].Properties["OutsideLabels"] = false;
this.ChartControl1.Series[0].Properties["Radius"] = 2.0f;
this.ChartControl1.Series[0].Properties["StartAngle"] = 0f;
Funnel Chart
A funnel chart shows how the percentage of each data item contributes as a whole.
Chart Information
ChartType Pie/Doughnut 2D
Number of Y 1
values per
data points
Number of 1 or more
Series
Marker Series or Data Point
Support
Custom The CalloutLine property gets or sets the style for a line connecting the marker label to its
Properties corresponding funnel section. The default value is a black one-point line.
The FunnelStyle property gets or sets the Y value for the series points to the width or
height of the funnel. The default value is YIsHeight.
The MinPointHeight property gets or sets the minimum height allowed for a data point in
the funnel chart. The height is measured in relative coordinates.
The NeckHeight property gets or sets the neck height for the funnel chart. This property
can only be used with the FunnelStyle property set to YIsHeight. The default value is 5.
The NeckWidth property gets or sets the neck width for the funnel chart. This property can
only be used with the FunnelStyle property set to YIsHeight. The default value is 5.
The OutsideLabels property gets or sets a value indicating whether the labels are placed
outside of the funnel chart. The default value is True.
The OutsideLabelsPlacement property gets or sets a value indicating whether the data
point labels appear on the left or right side of the funnel. This property can only be used
with the OutsideLabels property set to True.
The PointGapPct property gets or sets the amount of space between the data points of the
funnel chart. The PointGapPct is measured in relative coordinates. The default value is 0,
and valid values range from 0 to 100.
Pyramid Chart
A Pyramid chart shows how the percentage of each data item contributes as a whole.
Chart Information
ChartType Pie/Doughnut 2D
Number of Y 1
values per
data point
3D Pie/Doughnut Charts
Given below is the list of 3D charts that fall under the Pie/Doughnut Chart category.
Caution: To view a chart in 3D, open the ChartArea Collection Editor in the ChartAreas property and set the
ProjectionType property to Orthogonal.
Doughnut Chart
A 3D doughnut chart shows how the percentage of each data item contributes to a total percentage, allowing the data to
be viewed in a 3D format.
Chart Information
ChartType Pie/Doughnut 3D
Number of Y values per data 1
point
Number of Series 1 or more
Marker Support Series or Data Point
Custom Properties The Clockwise property gets or sets a value indicating whether to display the
data in clockwise order.
The ExplodeFactor property gets or sets the amount of separation between data
point values. The value must be less than or equal to 1. To explode one section of
the doughnut chart, set ExplodeFactor to the data point instead of the series.
The HoleSize property gets or sets the inner radius of the chart. If set to 0, the
chart looks like a pie chart. The value must be less than or equal to 1.
The OutsideLabels property gets or sets a value indicating whether the data
point labels appear outside the chart.
The Radius property gets or sets the size of the doughnut within the chart area.
The StartAngle property gets or sets the horizontal start angle for the series data
points.
Below is an example of how to set the custom chart properties at run time for a 3D doughnut chart as shown in the
image above.
To write the code in Visual Basic.NET
Visual Basic
Me.ChartControl1.Series(0).Properties("ExplodeFactor") = 0.0F
C#
this.chartControl1.Series[0].Properties["ExplodeFactor"] = 0f;
this.chartControl1.Series[0].Properties["HoleSize"] = .33f;
this.chartControl1.Series[0].Properties["OutsideLabels"] = false;
this.chartControl1.Series[0].Properties["StartAngle"] = 50f;
Funnel Chart
A 3D funnel chart shows how the percentage of each data item contributes to the whole, allowing the data to be viewed
in a 3D format.
Chart Information
ChartType Pie/Doughnut 3D
Number of Y 1
values per
data points
Number of 1 or more
Series
Marker Series or Data Point
Support
Custom The BaseStyle property gets or sets a circular or square base drawing style for the 3D funnel chart.
Properties The CalloutLine property gets or sets the style for a line connecting the marker label to its
corresponding funnel section. The default value is a black one-point line.
The FunnelStyle property gets or sets the Y value for the series points to the width or height of the
funnel. The default value is YIsHeight.
The MinPointHeight property gets or sets the minimum height allowed for a data point in the
funnel chart. The height is measured in relative coordinates.
The NeckHeight property gets or sets the neck height for the funnel chart. This property can only
be used with the FunnelStyle property set to YIsHeight. The default value is 5.
The NeckWidth property gets or sets the neck width for the funnel chart. This property can only be
used with the FunnelStyle property set to YIsHeight. The default value is 5.
The OutsideLabels property gets or sets a value indicating whether the labels are placed outside of
the funnel chart. The default value is True.
The OutsideLabelsPlacement property gets or sets a value indicating whether the data point
labels appear on the left or right side of the funnel. This property can only be used with the
OutsideLabels property set to True.
The PointGapPct property gets or sets the amount of space between the data points of the funnel
chart. The PointGapPct is measured in relative coordinates. The default value is 0, and valid values
range from 0 to 100.
The RotationAngle property gets or sets the left-to-right rotation angle of the funnel. The valid
values range from -180 to 180 degrees. This property is only effective with the Projection property
set to Orthogonal and the BaseStyle property set to SquareBase.
Below is an example of how to set the custom chart properties at run time for a 3D funnel chart.
To write the code in Visual Basic.NET
Visual Basic
Visual Basic
With Me.ChartControl1.Series(0)
.Properties("BaseStyle") = BaseStyle.SquareBase
.Properties("CalloutLine") = New Line(Color.Black, 2, LineStyle.Dot)
.Properties("FunnelStyle") = FunnelStyle.YIsWidth
.Properties("MinPointHeight") = 10.0F
.Properties("NeckWidth") = 20.0F
.Properties("NeckHeight") = 5.0F
.Properties("OutsideLabels") = True
.Properties("OutsideLabelsPlacement") = LabelsPlacement.Right
.Properties("PointGapPct") = 3.0F
.Properties("RotationAngle") = 3.0F
End With
C#
this.ChartControl1.Series[0].Properties["BaseStyle"] = BaseStyle.SquareBase;
this.ChartControl1.Series[0].Properties["CalloutLine"] = new Line(Color.Black, 2,
LineStyle.Dot);
this.ChartControl1.Series[0].Properties["FunnelStyle"] = FunnelStyle.YIsWidth;
this.ChartControl1.Series[0].Properties["MinPointHeight"] = 10f;
this.ChartControl1.Series[0].Properties["NeckWidth"] = 20f;
this.ChartControl1.Series[0].Properties["NeckHeight"] = 5f;
this.ChartControl1.Series[0].Properties["OutsideLabels"] = true;
this.ChartControl1.Series[0].Properties["OutsideLabelsPlacement"] = LabelsPlacement.Right;
this.ChartControl1.Series[0].Properties["PointGapPct"] = 3f;
this.ChartControl1.Series[0].Properties["RotationAngle"] = 3f;
Pyramid Chart
A 3D Pyramid chart shows how the percentage of each data item contributes to the whole, allowing the data to be viewed
in a 3D format.
Chart Information
ChartType Pie/Doughnut 3D
Number of 1
Y values per
data point
Number of 1 or more
Series
Marker Series or Data Points
Support
Custom The BaseStyle property gets or sets a circular or square base drawing style for the 3D pyramid chart.
Properties The CalloutLine property gets or sets the style for a line connecting the marker label to its
corresponding pyramid section. The default value is a black one-point line.
Below is an example of how to set the custom chart properties at run time for a Pyramid chart.
To write the code in Visual Basic.NET
Visual Basic
Imports GrapeCity.ActiveReports.Chart
Imports GrapeCity.ActiveReports.Chart.Graphics
Visual Basic
With Me.ChartControl1.Series(0)
.Properties("BaseStyle") = BaseStyle.SquareBase
.Properties("MinPointHeight") = 10.0F
.Properties("OutsideLabels") = True
.Properties("OutsideLabelsPlacement") = LabelsPlacement.Right
.Properties("PointGapPct") = 3.0F
.Properties("RotationAngle") = 3.0F
End With
C#
this.ChartControl1.Series[0].Properties["BaseStyle"] = BaseStyle.SquareBase;
this.ChartControl1.Series[0].Properties["MinPointHeight"] = 10f;
this.ChartControl1.Series[0].Properties["OutsideLabels"] = true;
this.ChartControl1.Series[0].Properties["OutsideLabelsPlacement"] = LabelsPlacement.Right;
this.ChartControl1.Series[0].Properties["PointGapPct"] = 3f;
this.ChartControl1.Series[0].Properties["RotationAngle"] = 3f;
Pie Chart
This type of chart displays the contribution of each value to a total.
Chart Information
ChartType Pie/Doughnut 3D
Number of Y values per data 1
point
Number of Series 1 or more
Marker Support Series or Data Point
Ring Chart
This chart type uses rings (inner and outer) to represent data.
Chart Information
ChartType Pie/Doughnut 3D
Number of Y values per data 1
point
Number of Series 1 or more
Marker Support Series or Data Point
Custom Properties
Financial Chart
Financial charts are those which are specific to representing data related to financial activities. The ActiveReports
Chart control can draw a number of financial chart types:
Candle, High Low, High Low Open Close
Kagi, Renko
Point and Figure, Three Line Break
2D Financial Charts
This section describes 2D charts that fall under the Financial Chart category.
3D Financial Charts
This section describes 3D charts that fall under the Financial Chart category.
2D Financial Charts
Given below is the list of 2D charts that fall under the Financial Chart category.
Candle Stick Chart
A candle chart displays stock information, using High, Low, Open and Close values. The size of the wick line is determined by the High and Low values,
while the size of the bar is determined by the Open and Close values. The bar is displayed using different colors, depending on whether the price of the
stock has gone up or down.
Chart Information
ChartType Financial2D
Number of Y values 4 (The first value is the high figure, the second is the low figure, the third is the opening figure, and the fourth is the
per data point closing figure.)
Number of Series 1 or more
Marker Support Series or Data Point. Marker labels use the first Y value as the default value.
Custom Properties The BodyDownswingBackdrop property gets or sets the backdrop information used to fill the rectangle for data points
in which the closing figure is lower than the opening figure.
The BodyUpswingBackdrop property gets or sets the backdrop information used to fill the rectangle for data points in
which the closing figure is higher than the opening figure.
The BodyWidth property gets or sets the width of the rectangle used to show upswing or downswing.
The WickLine property gets or sets the line information for the wick line.
Below is an example of how to set the custom chart properties at run time for a candle chart as shown in the image above.
To write the code in Visual Basic.NET
Visual Basic
Visual Basic
With Me.ChartControl1.Series(0)
.Properties("BodyDownswingBackdrop") = New Chart.Graphics.Backdrop(Color.FromArgb(255, 192, 255))
.Properties("BodyUpswingBackdrop") = New Chart.Graphics.Backdrop(Color.FromArgb(192, 192, 255))
.Properties("WickLine") = New Chart.Graphics.Line(Color.Indigo)
.Properties("BodyWidth") = 7.0F
End With
C# Code
this.ChartControl1.Series[0].Properties["BodyDownswingBackdrop"]= new Chart.Graphics.Backdrop
(Color.FromArgb(255, 192, 255));
this.ChartControl1.Series[0].Properties["BodyUpswingBackdrop"] = new Chart.Graphics.Backdrop
(Color.FromArgb(192, 192, 255));
this.ChartControl1.Series(0).Properties("WickLine") = new Chart.Graphics.Line(Color.Indigo);
this.ChartControl1.Series[0].Properties["BodyWidth"] = 7f;
HiLo Chart
A HiLo chart displays stock information using High and Low, or Open and Close, values. The length of the HiLo line is determined by the High and Low
values, or the Open and Close values.
Chart Information
ChartType Financial2D
Marker Support Series or Data Point. Marker labels use the first Y value as the default value.
Custom Properties The HiloLine property gets or sets the line information for the HiLo line.
Below is an example of how to set the custom chart properties at run time for a HiLo chart as shown in the image above.
To write the code in Visual Basic.NET
Visual Basic
Me.ChartControl1.Series(0).Properties("HiloLine") = New
GrapeCity.ActiveReports.Chart.Graphics.Line(Color.DeepSkyBlue, 4)
Chart Information
ChartType Financial2D
Number of Y values per data 2
point
Number of Series 1 or more
Marker Support Series or Data Points
Custom Properties The BoxSize property gets or sets the amount a price must change in order to create another X or O.
The DownswingLine property gets or sets the style and color settings for the downswing O's.
The ReversalAmount property gets or sets the amount that a price must shift in order for a new column to be
added.
The UpswingLine property gets or sets the style and color settings for the upswing X's.
Below is an example of how to set the custom chart properties at run time for a Point and Figure chart.
To write the code in Visual Basic.NET
Visual Basic
Imports GrapeCity.ActiveReports.Chart.Graphics
Visual Basic
With Me.ChartControl1.Series(0)
.Properties("DownswingLine") = New Chart.Graphics.Line(Color.Red)
.Properties("UpswingLine") = New Chart.Graphics.Line(Color.Blue)
.Properties("BoxSize") = 3.0F
End With
C#
this.ChartControl1.Series[0].Properties["DownswingLine"] = new Chart.Graphics.Line(Color.Red);
this.ChartControl1.Series[0].Properties["UpswingLine"] = new Chart.Graphics.Line(Color.Blue);
this.ChartControl1.Series[0].Properties["BoxSize"] = 3f;
Renko Chart
The Renko chart uses bricks of uniform size to chart price movement. When a price moves to a greater or lesser value than the preset BoxSize value
required to draw a new brick, a new brick is drawn in the succeeding column. The change in box color and direction signifies a trend reversal.
Chart Information
ChartType Financial2D
Number of Y values per data 1
point
Number of Series 1 or more
Marker Support Series or Data Points
Custom Properties The BodyDownswingBackdrop property gets or sets the style and color settings for the downswing bricks.
The BodyUpswingBackdrop property gets or sets the style and color settings for the upswing bricks.
The BoxSize property gets or sets the amount a price must change in order to create another brick.
Below is an example of how to set the custom chart properties at run time for a Renko chart.
To write the code in Visual Basic.NET
Visual Basic
With Me.ChartControl1.Series(0)
.Properties("BodyDownswingBackdrop") = New Backdrop(Color.BlueViolet)
.Properties("BodyUpswingBackdrop") = New Backdrop(Color.Navy)
.Properties("BoxSize") = 3.0F
End With
CS
this.ChartControl1.Series[0].Properties["BodyDownswingBackdrop"] = new Backdrop(Color.BlueViolet);
this.ChartControl1.Series[0].Properties["BodyUpswingBackdrop"] = new Backdrop(Color.Navy);
this.ChartControl1.Series[0].Properties["BoxSize"] = 3f;
Kagi Chart
A Kagi chart displays supply and demand trends using a sequence of linked vertical lines. The thickness and direction of the lines vary depending on
the price movement. If closing prices go in the direction of the previous Kagi line, then that Kagi line is extended. However, if the closing price
reverses by the preset reversal amount, a new Kagi line is charted in the next column in the opposite direction. Thin lines indicate that the price breaks
the previous low (supply) while thick lines indicate that the price breaks the previous high (demand).
Chart Information
ChartType Financial2D
Number of Y values per data point 1
Number of Series 1
Marker Support Series or Data Points
Custom Properties The DownswingLine property gets or sets the style and color settings to
use for a Kagi line which charts a price decrease.
The ReversalAmount property gets or sets the amount that a price must
shift in order for the Kagi line to change direction.
The UpswingLine property gets or sets the style and color settings to use
for a Kagi line which charts a price increase.
Below is an example of how to set the custom chart properties at run time for a Kagi chart.
To write code in Visual Basic.NET
Visual Basic
Imports GrapeCity.ActiveReports.Chart.Graphics
Visual Basic
With Me.ChartControl1.Series(0)
.Properties("BodyDownswingBackdrop") = New Backdrop(Color.Red)
.Properties("BodyUpswingBackdrop") = New Backdrop(Color.Blue)
.Properties("DownswingLine") = New Chart.Graphics.Line(Color.DarkRed)
.Properties("ReversalAmount") = "25"
.Properties("UpswingLine") = New Chart.Graphics.Line(Color.DarkBlue)
.Properties("Width") = 50.0F
End With
To write code in C#
C#
using GrapeCity.ActiveReports.Chart.Graphics;
C#
this.ChartControl1.Series[0].Properties["BodyDownswingBackdrop"] = new Backdrop(Color.Red);
this.ChartControl1.Series[0].Properties["BodyUpswingBackdrop"] = new Backdrop(Color.Blue);
this.ChartControl1.Series[0].Properties["DownswingLine"] = new Chart.Graphics.Line(Color.DarkRed);
this.ChartControl1.Series[0].Properties["ReversalAmount"] = "25";
this.ChartControl1.Series[0].Properties["UpswingLine"] = new Chart.Graphics.Line(Color.DarkBlue);
Stock Chart
In a stock chart, series are displayed as a set of lines with markers for high, low, close, and open values. Values are represented by the height of the
marker as measured by the y-axis. Category labels are displayed on the x-axis.
Stock chart is a visual representation of data related to the stock market. It may be used to represent data like stock prices and stock activities.
Chart Information
ChartType Financial2D
Number of Y values per data point 4
Number of Series 1 or more
Marker Support Series or Data Point
Custom Properties The CloseLine property gets or sets the information for the close value line.
The HiLoLine property gets or sets the line information for the HiLo line.
The OpenLine property property gets or sets the information for the open value line.
The TickLen property property gets or sets the tick length for the close value and open value lines.
Chart Information
ChartType Financial2D
Number of Y values per data point 4
Number of Series 1 or more
Marker Support Series or Data Point
Custom Properties The CloseLine property gets or sets the information for the close value line.
The HiLoLine property gets or sets the line information for the HiLo line.
The OpenLine property property gets or sets the information for the open value line.
The TickLen property property gets or sets the tick length for the close value and open value lines.
Chart Information
ChartType Financial2D
Number of Y values per data point 4
Number of Series 3
Marker Support Series or Data Point
Custom Properties The CloseLine property gets or sets the information for the close value line.
The HiLoLine property gets or sets the line information for the HiLo line.
The OpenLine property property gets or sets the information for the open value line.
The TickLen property property gets or sets the tick length for the close value and open value lines.
Chart Information
ChartType Financial2D
Number of Y values per 1
data point
Number of Series 1
Marker Support Series or Data Points
Chart-Specific Properties The BodyDownswingBackdrop property gets or sets the style and color settings for the downswing boxes.
The BodyUpswingBackdrop property gets or sets the style and color settings for the upswing boxes.
Below is an example of how to set the custom chart properties at run time for a Three Line Break chart.
To write code in Visual Basic.NET
Visual Basic
Imports GrapeCity.ActiveReports.Chart.Graphics
Visual Basic
With Me.ChartControl1.Series(0)
.Properties("BodyDownswingBackdrop") = New Backdrop(Color.Red)
.Properties("BodyUpswingBackdrop") = New Backdrop(Color.Black)
.Properties("NewLineBreak") = 3
End With
To write code in C#
C#
using GrapeCity.ActiveReports.Chart.Graphics;
C#
this.ChartControl1.Series[0].Properties["BodyDownswingBackdrop"] = new Backdrop(Color.Red);
this.ChartControl1.Series[0].Properties["BodyUpswingBackdrop"] = new Backdrop(Color.Black);
this.ChartControl1.Series[0].Properties["NewLineBreak"] = 3;
3D Financial Charts
Given below is the list of 3D charts that fall under the Financial Chart category.
Kagi Chart
A Kagi chart displays supply and demand trends using a sequence of linked vertical lines. The thickness and
direction of the lines vary depending on the price movement. If closing prices go in the direction of the previous
Kagi line, then that Kagi line is extended. However, if the closing price reverses by the preset reversal amount, a
new Kagi line is charted in the next column in the opposite direction. Thin lines indicate that the price breaks the
previous low (supply) while thick lines indicate that the price breaks the previous high (demand).
Chart Information
ChartType Financial3D
Number of 1
Y values
per data
point
Number of 1
Series
Custom The BodyDownswingBackdrop property gets or sets the style and color settings for the
Properties three-dimensional side view of downswing Kagi lines. This property is only available with the
Kagi 3D chart type, and is only effective when the Width property is set to a value higher than
25.
The BodyUpswingBackdrop property gets or sets the style and color settings for the three-
dimensional side view of upswing Kagi lines. This property is only available with the Kagi 3D
chart type, and is only effective when the Width property is set to a value higher than 25.
The DownswingLine property gets or sets the style and color settings to use for a Kagi line
which charts a price decrease.
The ReversalAmount property gets or sets the amount that a price must shift in order for the
Kagi line to change direction.
The UpswingLine property gets or sets the style and color settings to use for a Kagi line which
charts a price increase.
The Width property gets or sets the width of the three-dimensional side view of the Kagi
Below is an example of how to set the custom chart properties at run time for a Kagi chart.
To write code in Visual Basic.NET
Visual Basic
Imports GrapeCity.ActiveReports.Chart.Graphics
Visual Basic
With Me.ChartControl1.Series(0)
.Properties("BodyDownswingBackdrop") = New Backdrop(Color.Red)
.Properties("BodyUpswingBackdrop") = New Backdrop(Color.Blue)
.Properties("DownswingLine") = New Chart.Graphics.Line(Color.DarkRed)
.Properties("ReversalAmount") = "25"
.Properties("UpswingLine") = New Chart.Graphics.Line(Color.DarkBlue)
.Properties("Width") = 50.0F
End With
To write code in C#
C#
using GrapeCity.ActiveReports.Chart.Graphics;
C#
this.ChartControl1.Series[0].Properties["BodyDownswingBackdrop"] = new
Backdrop(Color.Red);
this.ChartControl1.Series[0].Properties["BodyUpswingBackdrop"] = new
Backdrop(Color.Blue);
this.ChartControl1.Series[0].Properties["DownswingLine"] = new
Chart.Graphics.Line(Color.DarkRed);
this.ChartControl1.Series[0].Properties["ReversalAmount"] = "25";
this.ChartControl1.Series[0].Properties["UpswingLine"] = new
Chart.Graphics.Line(Color.DarkBlue);
this.ChartControl1.Series[0].Properties["Width"] = 50f;
Renko Chart
The Renko chart uses bricks of uniform size to chart price movement. When a price moves to a greater or lesser
value than the preset BoxSize value required to draw a new brick, a new brick is drawn in the succeeding column.
The change in box color and direction signifies a trend reversal.
Chart Information
ChartType Financial3D
Custom Properties The BodyUpswingBackdrop property gets or sets the style and color settings
for the upswing bricks.
BodyDownswingBackdrop Gets or sets the style and color settings for the
downswing bricks.
The BoxSize property gets or sets the amount a price must change in order to
create another brick.
Below is an example of how to set the custom chart properties at run time for a Renko chart.
Visual Basic
Imports GrapeCity.ActiveReports.Chart.Graphics
Visual Basic
With Me.ChartControl1.Series(0)
.Properties("BodyDownswingBackdrop") = New Backdrop(Color.Red)
.Properties("BodyUpswingBackdrop") = New Backdrop(Color.Blue)
.Properties("BoxSize") = 3.0F
End With
To write code in C#
CS
using GrapeCity.ActiveReports.Chart.Graphics;
C#
this.ChartControl1.Series[0].Properties["BodyDownswingBackdrop"] = new
Backdrop(Color.Red);
this.ChartControl1.Series[0].Properties["BodyUpswingBackdrop"] = new
Backdrop(Color.Blue);
this.ChartControl1.Series[0].Properties["BoxSize"] = 3f;
Chart Information
ChartType Financial3D
Number of Y 1
values per data
point
Number of Series 1
Custom The BodyDownswingBackdrop property gets or sets the style and color settings for
Properties the downswing boxes.
The BodyUpswingBackdrop property gets or sets the style and color settings for the
upswing boxes.
The NewLineBreak property gets or sets the number of previous boxes/lines that
must be compared before a new box/line is drawn. The default value is 3.
2D Point/Bubble Charts
Chart Information
ChartType Point/Bubble2D
Number of Y values per data 2
point
Number of Series 1 or more
Marker Support Series or Data Point. Marker labels use the second Y value as the default value.
Custom Properties The MaxSizeFactor property gets or sets the maximum size of the bubble radius.
Values must be less than or equal to 1. Default is .25.
The MaxValue property gets or sets the bubble size that is used as the
maximum.
The MinValue property gets or sets the bubble size that is used as the minimum.
The Shape property gets or sets the shape of the bubbles. Uses or returns a valid
MarkerStyle enumeration value.
Below is an example of setting the custom chart properties at run time for a bubble chart as shown in the image above.
To write code in Visual Basic.NET
Visual Basic
Me.ChartControl1.Series(0).Properties("MaxSizeFactor") = 0.25F
Me.ChartControl1.Series(0).Properties("MaxValue") = 55.0R
Me.ChartControl1.Series(0).Properties("MinValue") = 5.0R
Me.ChartControl1.Series(0).Properties("Shape") =
GrapeCity.ActiveReports.Chart.MarkerStyle.Circle
To write code in C#
C#
this.ChartControl1.Series[0].Properties["MaxSizeFactor"] = .25f;
this.ChartControl1.Series[0].Properties["MaxValue"] = 55D;
this.ChartControl1.Series[0].Properties["MinValue"] = 5D;
this.ChartControl1.Series[0].Properties["Shape"] =
GrapeCity.ActiveReports.Chart.MarkerStyle.Circle;
Bubble XY Chart
The Bubble XY chart is an XY chart in which bubbles represent data points. The BubbleXY uses a numerical X axis and
plots the x values and first set of Y values on the chart. The second Y value is used to set the size of the bubble.
Chart Information
ChartType Point/Bubble2D
Number of Y values 2
per data point
Number of Series 1 or more
Marker Support Series or Data Point. Marker labels use the second Y value as the default value.
Below is an example of setting the custom chart properties at run time for a bubble XY chart as shown in the image
above.
To write code in Visual Basic.NET
Visual Basic
Me.ChartControl1.Series(0).Properties("MaxSizeFactor") = 0.25F
Me.ChartControl1.Series(0).Properties("MaxValue") = 50.0R
Me.ChartControl1.Series(0).Properties("MinValue") = 0.0R
Me.ChartControl1.Series(0).Properties("Shape") =
GrapeCity.ActiveReports.Chart.MarkerStyle.InvTriangle
To write code in C#
C#
this.ChartControl1.Series[0].Properties["MaxSizeFactor"] = .25f;
this.ChartControl1.Series[0].Properties["MinValue"] = 0D;
this.ChartControl1.Series[0].Properties["MaxValue"] = 50D;
this.ChartControl1.Series[0].Properties["Shape"] =
GrapeCity.ActiveReports.Chart.MarkerStyle.InvTriangle;
Plot XY Chart
A plot XY chart shows the relationships between numeric values in two or more series sets of XY values.
Chart Information
ChartType Point/Bubble2D
Scatter Chart
Use a scatter chart to compare values across categories.
Chart Information
Chart Series
A chart series is the key to showing data in a chart. All data is plotted in a chart as a series and all charts contain
at least one series. The bars in the image below depict two series in a simple bar chart.
Each series is made up of a set of data points consisting of an X value that determines where on the X axis the
data is plotted, and one or more Y values. Most charts use one Y value but a few charts such as the Bubble,
BubbleXY, and the financial charts take multiple Y values.
When you bind data to a series, the X value is bound using the ValueMembersX property on the Series object, and
the Y value is bound using the ValueMembersY property.
The Series object also contains properties for each individual series, including chart type, custom chart properties,
annotations, containing chart area, and more. Each chart type in the ActiveReports Chart control contains series-
specific properties that apply to it. You can set the chart type and these series-specific properties in the Series
Collection Editor dialog, which opens when you click the ellipsis button next to the Series (Collection) property in
the Visual Studio Properties window.
You can manipulate each data point in the DataPoint Collection dialog box. You can access the dialog from the
Series Collection Editor by clicking the ellipsis button next to the Points (Collection) property.
When you set a property on the Series object, it is applied to all data point objects in the series unless a different
value for the property is set on a specific data point. In that case, the data point property setting overrides the
series property setting for that particular data point. Note that for charts bound to a data source, you do not have
access to the DataPoint collection in the dialog.
If you specify the value for any of the custom properties, this value is not cleared when you change the ChartType.
Although this will show properties that do not apply to certain ChartTypes, it has the advantage of keeping
your settings in case you accidentally change the ChartType.
To set custom properties for a chart on the data points object programmatically, reference the series by name or
index, reference the data point by index, and use the string Properties attribute name you wish to set.
The following code samples set the explode factor on a doughnut chart for the second point in the series.
To write code in Visual Basic.Net
Chart Appearance
The following section explains in what ways you can modify the chart appearance.
Chart Effects
This section describes the visual effects that are available for the ChartControl.
Chart Control Items
This section describes the chart elements that you can use to customize the ChartControl.
Chart Axes and Walls
Chart Effects
These topics introduce some basic information on the visual effects of the ChartControl.
Colors
Learn about the different ways you can change the color and gradients to enhance the visual appearance of a
chart.
3D Effect
This section describes 3D effects that you can use to customize the chart.
Alpha Blending
This section explains about alpha blending property of the chart.
Lightning
Learn about directional light ratio, line type and line source of the chart.
Colors
In the ChartControl, colors can be used in different ways to enhance the chart's appearance, distinguish different
series, point out or draw attention to data information such as averages, and more.
Color Palettes
The ChartControl includes several pre-defined color palettes that can be used to automatically set the colors for
data values in a series. The pre-defined palettes are as follows.
Default The default palette.
Cascade A cascade of eight cool colors ranging from deep teal down through pale orchid.
Springtime The colors of spring, in deep green, two vivid colors and five pastels.
Iceberg A range of the soft blues and greys found in an iceberg.
Confetti A sprinkling of bright and pastel colors.
Greens A palette of greens.
Berries The colors of berries.
Autumn A quiet palette of autumn colors.
Murphy A range of the soft blues and greens.
These enumerated values are accessed through the Series class with code like the following.
To write code in Visual Basic.NET
Visual Basic
Me.ChartControl1.Series(0).ColorPalette = Chart.ColorPalette.Iceberg
To write code in C#
C#
this.ChartControl1.Series[0].ColorPalette =
GrapeCity.ActiveReports.Chart.ColorPalette.Iceberg;
Gradients
Gradients can be used in object backdrops to enhance the visual appearance of various chart items. Gradients can
be used in the following chart sections:
Chart
Chart area
Wall
Title
Visual Basic
Dim bItem As New GrapeCity.ActiveReports.Chart.BackdropItem
bItem.Style = Chart.Graphics.BackdropStyle.Gradient
bItem.Gradient = Chart.Graphics.GradientType.Vertical
bItem.Color = Color.Purple
bItem.Color2 = Color.White
Me.ChartControl1.Backdrop = bItem
To write code in C#
C#
using GrapeCity.ActiveReports.Chart.Graphics;
C#
GrapeCity.ActiveReports.Chart.BackdropItem bItem = new
GrapeCity.ActiveReports.Chart.BackdropItem();
bItem.Style = GrapeCity.ActiveReports.Chart.Graphics.BackdropStyle.Gradient;
bItem.Gradient = GrapeCity.ActiveReports.Chart.Graphics.GradientType.Vertical;
bItem.Color = System.Drawing.Color.Purple;
bItem.Color2 = System.Drawing.Color.White;
this.ChartControl1.Backdrop = bItem;
3D Effects
Using the projection and viewpoint settings, you can display your 3D chart at any angle to provide the desired
view or call attention to a specific chart section.
Projection
Determine the projection for a 3D chart using the following properties.
Alpha Blending
The Backdrop class in the Chart control has an Alpha property which employs GDI+, and is used to set the
transparency level of each object's backdrop. GDI+ uses 32 bits overall and 8 bits per alpha, red, green, and blue
channels respectively to indicate the transparency and color of an object. Like a color channel's levels of color, the
alpha channel represents 256 levels of transparency.
The default value of the Alpha property is 255, which represents a fully opaque color. For a fully transparent color,
set this value to 0. To blend the color of the object's backdrop with the background color, use a setting between 0
and 255.
In the Chart control, you can use the Color.FromArgb method provided by standard Color constructor of .NET
Framework class library to set the alpha and color levels for a particular chart element.
The following example shows how you can use the method to set the alpha and color values for the chart
backdrop.
To write code in Visual Basic.NET
Visual Basic
Me.ChartControl1.Backdrop = New
GrapeCity.ActiveReports.Chart.BackdropItem(Color.FromArgb(100, 0, 11, 220))
To write code in C#
C#
this.ChartControl1.Backdrop = new
GrapeCity.ActiveReports.Chart.BackdropItem(System.Drawing.Color.FromArgb(100, 0, 11,
220));
Changing the alpha level of a chart element reveals other items that are beneath the object. Because you can set
the alpha level for any chart element that supports color, you can also create custom effects for any chart. For
example, you can use alpha blending to combine background images with a semi-transparent chart backdrop to
create a watermark look.
Lighting
The Chart control allows you to completely customize lighting options for 3D charts.
Light Source
You can also set the Source property to a Point3d object, which controls the location of the light source.
Chart Annotations
The Chart control offers a built-in annotation tool to allow you to include floating text bars or images in your charts
or call attention to specific items or values in your charts using the line and text bar controls included in the
Annotations Collection Editor. You can find the Annotations Collection Editor under the Series properties of the
Chart Designer.
The following properties are important while setting up annotations for your chart:
StartPoint Sets the starting point (X and Y axis values) for an annotation line.
EndPoint Sets the end point (X and Y axis values) for an annotation line.
AnchorPlacement Sets the position of the anchor point for the text bar on the chart surface.
AnchorPoint Sets the point (X and Y axis values) where the text bar will be anchored based on the
anchor placement selected.
The following code demonstrates creating annotation lines and annotation text, setting their properties, and adding
Visual Basic
' create the annotation lines and text bar.
Dim aLine1 As New GrapeCity.ActiveReports.Chart.Annotations.AnnotationLine
Dim aLine2 As New GrapeCity.ActiveReports.Chart.Annotations.AnnotationLine
Dim aText1 As New GrapeCity.ActiveReports.Chart.Annotations.AnnotationTextBar
Dim aText2 As New GrapeCity.ActiveReports.Chart.Annotations.AnnotationTextBar
' set the properties for each line and text bar.
With aLine1
.EndPoint = New GrapeCity.ActiveReports.Chart.Graphics.Point2d(1.5F, 30.0F)
.Line = New
GrapeCity.ActiveReports.Chart.Graphics.Line(System.Drawing.Color.Red, 2)
.StartPoint = New GrapeCity.ActiveReports.Chart.Graphics.Point2d(1.5F, 15.0F)
End With
With aLine2
.EndPoint = New GrapeCity.ActiveReports.Chart.Graphics.Point2d(4.6F, 47.0F)
.Line = New
GrapeCity.ActiveReports.Chart.Graphics.Line(System.Drawing.Color.Red, 2)
.StartPoint = New GrapeCity.ActiveReports.Chart.Graphics.Point2d(3.6F, 45.0F)
End With
With aText1
.AnchorPlacement =
GrapeCity.ActiveReports.Chart.Annotations.AnchorPlacementType.Bottom
.AnchorPoint = New GrapeCity.ActiveReports.Chart.Graphics.Point2d(1.5F, 31.0F)
.Height = 25.0F
.Line = New
GrapeCity.ActiveReports.Chart.Graphics.Line(System.Drawing.Color.Red, 2)
.Text = "Min Value"
.Width = 100.0F
End With
With aText2
.AnchorPlacement =
GrapeCity.ActiveReports.Chart.Annotations.AnchorPlacementType.Left
.AnchorPoint = New GrapeCity.ActiveReports.Chart.Graphics.Point2d(4.7F, 47.0F)
.Height = 25.0F
.Line = New
GrapeCity.ActiveReports.Chart.Graphics.Line(System.Drawing.Color.Red, 2)
.Text = "Max Value"
.Width = 100.0F
End With
' add the annotation lines and text bars to the annotations collection for the series
Me.ChartControl1.Series(0).Annotations.AddRange(New
GrapeCity.ActiveReports.Chart.Annotations.Annotation() {aLine1, aLine2, aText1,
aText2})
To write code in C#
C#
// create the annotation lines and text bar.
GrapeCity.ActiveReports.Chart.Annotations.AnnotationLine aLine1 = new
GrapeCity.ActiveReports.Chart.Annotations.AnnotationLine();
GrapeCity.ActiveReports.Chart.Annotations.AnnotationLine aLine2 = new
GrapeCity.ActiveReports.Chart.Annotations.AnnotationLine();
GrapeCity.ActiveReports.Chart.Annotations.AnnotationTextBar aText1 = new
GrapeCity.ActiveReports.Chart.Annotations.AnnotationTextBar();
GrapeCity.ActiveReports.Chart.Annotations.AnnotationTextBar aText2 = new
// add the annotation lines and text bars to the annotations collection for the series
this.ChartControl1.Series[0].Annotations.AddRange(
new GrapeCity.ActiveReports.Chart.Annotations.Annotation[] {aLine1, aLine2, aText1,
aText2});
The following code demonstrates creating header and footer titles, setting their properties, and adding them to the
titles collection at run time.
1. In design view of the report, double-click the section where you placed your chart. This creates a Format
event handling method for the section.
2. Add code to the handler to create header and footer titles.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the section Format event.
' create the header and footer titles
Dim tHeader As New GrapeCity.ActiveReports.Chart.Title
Dim tFooter As New GrapeCity.ActiveReports.Chart.Title
' add the header and footer titles to the titles collection
Me.ChartControl1.Titles.AddRange(New GrapeCity.ActiveReports.Chart.Title() {tHeader,
tFooter})
Legends
The Chart control automatically creates a legend item for each series added to a chart at design time and sets the Legend property for each series by default. However, the legend's Visible property must be set to
True for getting it displayed with the chart. The text for legend caption is taken from the Name property on the series.
Note: Each Series displayed in the Legend must have a Name. If the Name property is not set, the Series does not show up in the Legend.
The following code demonstrates how to create a legend at run time, add it to the Legends collection of the Chart object and set the legend property of the series to the new legend, resulting in the legend shown
above.
To write code in Visual Basic.NET
' set the properties for the legend and add it to the legends collection
legend1.Alignment = GrapeCity.ActiveReports.Chart.Alignment.TopRight
legend1.Backdrop = New GrapeCity.ActiveReports.Chart.BackdropItem(Chart.Graphics.BackdropStyle.Transparent, _Color.Gray, Color.White,
Chart.Graphics.GradientType.Vertical, Drawing2D.HatchStyle.DottedGrid, Nothing, _Chart.Graphics.PicturePutStyle.Stretched)
legend1.Border = New GrapeCity.ActiveReports.Chart.Border(New Chart.Graphics.Line(Color.Navy, 2), _0, Color.Black)
legend1.DockArea = Me.ChartControl1.ChartAreas(0)
legend1.LabelsFont = New GrapeCity.ActiveReports.Chart.FontInfo(Color.White, New System.Drawing.Font("Arial", 9.0F))
legend1.Header = lHeader
legend1.MarginX = 5
legend1.MarginY = 5
Me.ChartControl1.Legends.Add(legend1)
' Set the legend property of the series to the legend you created
Me.ChartControl1.Series(0).Legend = legend1
Me.ChartControl1.Series(1).Legend = legend1
Me.ChartControl1.Series(2).Legend = legend1
To write code in C#
// set the legend property of the series to the legend you created.
this.ChartControl1.Series[0].Legend = legend1;
this.ChartControl1.Series[1].Legend = legend1;
this.ChartControl1.Series[2].Legend = legend1;
Markers
Use markers to show specific data series values in a chart. Markers are created by setting the Marker property of the series.
The following code demonstrates how to create a marker object at run time and assign it to the Marker property of the Series object. The results
are shown in the image above.
To write code in Visual Basic.NET
Visual Basic code. Paste INSIDE the section Format event
' create the marker object
Dim marker1 As New GrapeCity.ActiveReports.Chart.Marker
To write code in C#
Label Symbols
You can use Labels in Chart markers or legends.
By default, marker labels display Y value of data points, whereas legend labels display series name or data name.
Setting Strings
You can change a string (format string) displayed in a marker or legend label.
To change a string in a marker label
1. Display the Series collection editor of properties window.
2. Select the series that sets marker. (By default the first series (Series1) gets selected.
3. Expand the Properties property.
4. Expand the Marker property.
5. Expand the Label property.
6. Set the string to display in the Format property.
To change a string in a legend label
Display the Series collection editor of properties window.
1. Set the string you want to set in legend label using the LegendText property.
When the LegendItemMode property of Series is set to Series, series are displayed in legend. Data point will be
displayed when set to Point. By default, in each graph the common setting will get displayed. For example, in case
of bar chart it is series and in case of pie chart it is data point that gets displayed in legends.
Symbols
It is possible to easily display constant strings by simply performing the above mentioned settings. To display
data, you need to embed the section (placeholder) that displays the value within format string at runtime.
A placeholder is a particular symbol enclosed within brackets {}.
The following symbols can be used. The sections enclosed within {} are changed by values.
Value
Data Value(Y value)
Pct
Percentage within series
PPct
Percentage having 100% as sum of multiple series for data points.
Name
X value of data
Sample Image
The following image displays a bar chart with the following values.
String displayed below the image is a string set in Label.Format property of marker.
Value={Value}
Pct={Pct:0.0}
PPct={PPct:0.0}
Name={Name}
Total={Total}
PTotal={PTotal}
{Name}:{Value}
In case you wish to add a line break in between, as it is not possible to add a line break from Series collection
editor, the following format string needs to be set at runtime.
To write code in Visual Basic.NET
Visual Basic
Private Sub rptLabelSymbol4_ReportStart(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.ReportStart
Dim m As GrapeCity.ActiveReports.Chart.Marker
m = CType(Me.ChartControl1.Series(0).Properties("Marker"),
GrapeCity.ActiveReports.Chart.Marker)
m.Label.Format = "{Name}" & vbCrLf & "{Value}"
End Sub
To write code in C#
C#
private void NewActiveReport1_ReportStart(object sender, EventArgs e)
{
GrapeCity.ActiveReports.Chart.Marker m;
m = (GrapeCity.ActiveReports.Chart.Marker)
this.ChartControl1.Series[0].Properties["Marker"];
m.Label.Format = "{Name}\n{Value}";
}
Specific symbols
The specific symbols that are used according to the chart type.
Bubble Charts
Value
Y2 value
Value0
Y value
Bubble XY Chart
Value0
X value
Value1
Y value
Value2
Y2 value
Note: The Chart control does not aggregate average values. Please aggregate the average values
beforehand and then render the line.
Important properties
StartValue Sets the start value on the primary axis for the wall range.
EndValue Sets the end value on the primary axis for the wall range.
PrimaryAxis Sets the axis on which the wall range appears.
The following code demonstrates how to create wall ranges, set their properties, and assign them to a chart area
at run time. The results are shown in the image above.
To write code in Visual Basic.NET
Visual Basic code. Paste INSIDE the section Format event
' Create the WallRange objects
Dim wallRange1 As New GrapeCity.ActiveReports.Chart.WallRange
Dim wallRange2 As New GrapeCity.ActiveReports.Chart.WallRange
Dim wallRange3 As New GrapeCity.ActiveReports.Chart.WallRange
' Add the WallRange to the chart area and set wall and Z axis properties to show lines.
With ChartControl1.ChartAreas(0)
.WallRanges.AddRange(New GrapeCity.ActiveReports.Chart.WallRange() {wallRange1,
wallRange2, wallRange3})
.WallXY.Backdrop.Alpha = 100
.WallXZ.Backdrop.Alpha = 100
.WallYZ.Backdrop.Alpha = 100
.Axes(4).MajorTick.Step = 20
.Axes(4).Max = 60
.Axes(4).Min = 0
.Axes(4).Visible = True
End With
To write code in C#
C# code. Paste INSIDE the section Format event
// Create the WallRange objects
GrapeCity.ActiveReports.Chart.WallRange wallRange1 = new
GrapeCity.ActiveReports.Chart.WallRange();
GrapeCity.ActiveReports.Chart.WallRange wallRange2 = new
GrapeCity.ActiveReports.Chart.WallRange();
GrapeCity.ActiveReports.Chart.WallRange wallRange3 = new
GrapeCity.ActiveReports.Chart.WallRange();
// Add the WallRange to the chart area and set wall and Z axis properties to show
lines.
this.ChartControl1.ChartAreas[0].WallRanges.AddRange(
new GrapeCity.ActiveReports.Chart.WallRange[] {wallRange1,wallRange2,wallRange3});
this.ChartControl1.ChartAreas[0].WallXY.Backdrop.Alpha = 100;
this.ChartControl1.ChartAreas[0].WallXZ.Backdrop.Alpha = 100;
this.ChartControl1.ChartAreas[0].WallYZ.Backdrop.Alpha = 100;
this.ChartControl1.ChartAreas[0].Axes[4].MajorTick.Step = 20;
this.ChartControl1.ChartAreas[0].Axes[4].Max = 60;
this.ChartControl1.ChartAreas[0].Axes[4].Min = 0;
this.ChartControl1.ChartAreas[0].Axes[4].Visible = true;
Standard Axes
The Chart control provides the means to change axis settings at design time or at run time. Chart axes make it
possible to view and understand the data plotted in a graph.
Axis Types
Most 2D charts contain a numerical axis (AxisY) and a categorical axis (AxisX). 3D charts include another
numerical axis (AxisZ). These axes are accessible at run time from the ChartArea object and allow you to control
the settings for each, including scaling, labels, and various formatting properties. For any of the scaling or labeling
properties you set to show up at run time, you will need to set the Visible property of the axis to True.
To write code in C#
C# code. Paste INSIDE the section Format event
this.ChartControl1.ChartAreas[0].Axes["AxisY"].Max = 100;
this.ChartControl1.ChartAreas[0].Axes["AxisY"].Min = 0;
this.ChartControl1.ChartAreas[0].Axes["AxisY"].MajorTick.Step = 10;
The Chart control also supports logarithmic scaling which allows you to show the vertical spacing between two
points that corresponds to the percentage of change between those numbers. You can set your numeric axis to
scale logarithmically by setting the IsLogarithmic property on the axis to True and setting the Max and Min
properties of the axis.
Labeling
To show labels on an axis, you will need to specify the value for the LabelsGap property, set your LabelsFont
properties, and set LabelsVisible to True. These properties can be set in the AxisBase Collection editor, which is
accessed at design time by clicking the ellipsis button next to the ChartAreas (Collection) property, then the
Axes (Collection) property of the ChartArea.
Tip: Labels render first, and then the chart fills in the remaining area, so be sure to make the chart large
enough if you use angled labels.
You can specify strings to be used for the labels instead of numerical values on an axis by using the Labels
collection property at design time or assigning a string array to the Labels property at run time. You can also
specify whether you want your axis labels to appear on the outside or inside of the axis line using the
LabelsInside property. By default, labels appear outside the axis line.
Tip: To set a specific tick interval using the LabelFormat property, the SmartLabels property should be set
to False.
Secondary Axes
By default, a Chart object includes secondary X and Y axes (AxisX2 and AxisY2). At design time or run time, you
can specify a secondary axis to plot data against by setting all of the appropriate properties for AxisX2 or AxisY2,
including the Visible property.For example, if you want to use two axes to show the same data as it appears on
two different scales, you can set the primary axis to show the actual data value scale, for example, and set the
secondary axis to show a logarithmic scale.
To write code in Visual Basic.NET
Visual Basic code. Paste INSIDE the section Format event
' set properties for AxisY (primary axis)
With Me.ChartControl1.ChartAreas(0).Axes("AxisY")
.Max = 25
.Min = 0
.MajorTick.Step = 5
End With
To write code in C#
The following code sample demonstrates creating a custom axis, adding it to the Axes collection for the ChartArea,
and setting its properties.
To write code in Visual Basic.NET
Visual Basic code. Paste INSIDE the section Format event
' create the custom axis and add it to the ChartArea's Axes collection
Dim customAxisY As New GrapeCity.ActiveReports.Chart.CustomAxis
Me.ChartControl1.ChartAreas(0).Axes.Add(customAxisY)
To write code in C#
Types
There are two kinds of gridlines and tick marks in the Chart control: major and minor. The properties for the major
gridlines and tick marks are set on the MajorTick object of the particular axis and the properties for minor gridlines
and ticks are set on the MinorTick object of the axis. The location for any labels shown for the axis are determined
by the Step property of the MajorTick object.
Tip: To set a specific tick interval using the Step property, you should set the SmartLabels property to
False.
ReportInfo
In ActiveReports, the ReportInfo control allows you to quickly display page numbers, page counts, and report
dates. The ReportInfo control is a text box with a selection of preset FormatString options. You can set page
counts to count the pages for the entire report, or for a specified group.
You can customize the preset values by editing the string after you select it. For example, if you want to display
the total number of pages in the ReportHeader section, you can enter a value like:
Total of {PageCount} pages.
Caution: With large reports using the CacheToDisk property, placing page counts in header sections may
have an adverse effect on memory as well as rendering speed. Since the rendering of the header is delayed
until ActiveReports determines the page count of the following sections, CacheToDisk is unable to perform
any optimization. For more information on this concept, see Optimizing Section Reports.
For more information on creating formatting strings, see the Date, Time, and Number Formatting topic.
Important Properties
Property Description
FormatString Gets or sets the string used to display formatted page numbering or report date and time
values in the control.
Style Gets or sets the style string for the control. This property reflects any settings you choose in
the Font and ForeColor properties.
SummaryGroup Gets or sets the name of the GroupHeader section that is used to reset the number of pages
when displaying group page numbering.
ReportInfo Dialog
With the control selected on the report, in the Commands section at the bottom of the Properties window, you can
click the Property dialog command to open the dialog.
General
Name: Enter a name for the control that is unique within the report. This name is displayed in the Document
Outline and in XML exports.
Tag: Enter a string that you want to persist with the control. If you access this property in code, it is an object,
but in the Properties window or Property dialog, it is a string.
Visible: Clear this check box to hide the control.
DataField: Select a field name from the data source to which to bind the control.
Appearance
Background Color: Select a color to use for the background of the control.
ReportInfo height
Can increase to accommodate contents: Select this check box to set CanGrow to True.
Can decrease to accommodate contents: Select this check box to set CanShrink to True.
Text direction
RightToLeft: Select this check box to reverse the text direction.
Alignment
Vertical alignment: Choose Top, Middle, or Bottom.
Horizontal alignment: Choose Left, Center, Right, or Justify.
Wrap mode: Choose NoWrap, WordWrap, or CharWrap to select whether to wrap words or characters to the
next line.
Summary
SummaryGroup: Select a GroupHeader section in the report to display the number of pages in each group when
using the PageCount.
SummaryRunning: Select None, Group, or All to display a summarized value.
The CrossSectionLine control draws a vertical line from a header section to the corresponding footer section. At
runtime, this vertical line stretches through any intervening sections. You can change the appearance of
CrossSectionLine by changing the following properties.
Property Description
LineColor Allows you to get or set color of the line.
LineStyle Allows you to select the line style from solid, dash or dotted.
LineWeight Allows you to specify the thickness of the line in pixel units.
CrossSectionBox
The CrossSectionBox control draws a rectangle from a header section to its corresponding footer section. To
change the appearance of the rectangle, you can use the following properties in addition to the ones mentioned
above.
Property Description
Radius Sets the radius of each corner for the RoundRect shape type. You can select Default, TopLeft,
TopRight, BottomLeft or BottomRight. Selecting Default sets the radius of all the corners of the
CrossSectionBox control to a specified percentage. Default value = 0 (point).
BackColor Sets the back color.
Note: At run time, the BackColor property renders first and the LineColor property renders last.
Caution: The CrossSectionBox and CrossSectionLine controls do not render properly in multi-column
reports, that is, those in which a GroupHeader section has the ColumnLayout property set to True.
CrossSectionLine Dialog
With the control selected on the report, in the Commands section at the bottom of the Properties window, you can
click the Property dialog command to open the dialog.
General
Name: Enter a name for the control that is unique within the report. This name is displayed in the Document
Outline and in XML exports.
CrossSectionBox Dialog
With the control selected on the report, in the Commands section at the bottom of the Properties window, you can
click the Property dialog command to open the dialog.
General
Name: Enter a name for the control that is unique within the report. This name is displayed in the Document
Outline and in XML exports.
Tag: Enter a string that you want to persist with the control. If you access this property in code, it is an object,
but in the Properties window or Property dialog, it is a string.
Visible: Clear this check box to hide the control.
Appearance
Line style: Select a line style to use for the border line. You can set it to Transparent, Solid, Dash, Dot, DashDot,
or DashDotDot.
Line weight: Enter the width in pixels for the border line.
Line color: Select a color to use for the border line.
Background color: Select a color to use for the background of the picture control.
Rounded Rectangle: Specify the radius for each corner of the CrossSectionBox individually. Drag the handlers
available at each corner of the CrossSectionBox to set the value of the radius at each corner.
Note: To enable specific corners, check the CheckBox available near each corner of the CrossSectionBox
control.
Use the same radius on specified corners: Select this option to apply the same radius to all selected
corners of the CorssSectionBox.
Use different radius on specified corners: Select this option to apply a different radius to each
selected corner of the CorssSectionBox.
Report Header
A report can have one report header section that prints at the beginning of the report. You generally use this
section to print a report title, a summary table, a chart or any information that only needs to appear once at the
report's start. This section has a NewPage ('NewPage Property' in the on-line documentation) property that
you can use to add a new page before or after it renders.
The Report Header does not appear on a section report by default. In order to add this section, right-click the
report and select Insert > Report Header/Footer to add a Report Header and Footer pair.
Page Header
A report can have one page header section that prints at the top of each page. Unless the page contains a report
header section, the page header is the first section that prints on the page. You can use the page header to print
column headers, page numbers, a page title, or any information that needs to appear at the top of each page.
Group Header
A report can include single or nested groups, with each group having its own header and footer sections. You can
insert and print the header section immediately before the detail section. For more information on grouping, see
Grouping Data in Section Reports.
In Columnar Reports, you can use ColumnGroupKeepTogether, and select whether to start a NewColumn before or
after a group.
You can also specify whether to print a NewPage before or after the section, and have the section print on every
page until the group details complete with the RepeatStyle property. The UnderlayNext property allows you to
show group header information inside the group details, so long as you keep the BackColor property of the Detail
section set to Transparent.
See GroupHeader ('GroupHeader Class' in the on-line documentation) for further information on properties.
Detail
A report has one detail section. The detail section is the body of the report and one instance of the section is
created for each record in the report. You can set the CanShrink property to True to eliminate white space after
controls, and you can set up Columnar Reports using ColumnCount, ColumnDirection, ColumnSpacing and
NewColumn properties.
The KeepTogether property attempts to keep the section together on a single page, and the RepeatToFill
('RepeatToFill Property' in the on-line documentation) property allows you to fill each page with the same
number of formatted rows, regardless of whether there is enough data to fill them. This is especially useful for
reports such as invoices in which you want consistent formatting like lines or green bars or back colors to fill each
page down to the Footer section at the bottom.
See Detail ('Detail Class' in the on-line documentation) for further information on properties.
Note: You cannot use the RepeatToFill property if you are using the PageBreak or SubReport control in the
Detail section, or if you have set the NewPage or NewColumn property to any value other than None. When
you use this property in a report where two groups are present, the ReportFooter section prints on the next
page. This property processes correctly only with single grouping.
Group Footer
A report can include single or nested groups, with each group having its own header and footer sections. You can
insert and print the footer section immediately after the detail section. For more information on grouping, see
Grouping Data in Section Reports.
Page Footer
Note: If the report contains a Page Footer on the last page, the Report Footer appears above the Page
Footer.
Single-Occurrence Events
The following events are all of the events that are raised only once during a Section report's processing. These
events are raised at the beginning or at the end of the report processing cycle.
Events raised once
ReportStart
Use this event to initialize any objects or variables needed while running a report. This event is also used to set
any Subreport control objects to a new instance of the report assigned to the Subreport control.
Caution: Be sure to add dynamic items to the report before this event finishes.
DataInitialize
This event is raised after ReportStart. Use it to add custom fields to the report's Fields collection. Custom fields can
be added to a bound report (one that uses a Data Control to connect and retrieve records) or an unbound report
(one that does not depend on a data control to get its records). In a bound report the dataset is opened and the
dataset fields are added to the custom fields collection, then the DataInitialize event is raised so new custom fields
can be added. The DataInitialize event can also be used to make adjustments to the DataSource or to set up
database connectivity.
ReportEnd
This event is raised after the report finishes processing. Use this event to close or free any objects that you were
using while running a report in unbound mode, or to display information or messages to the end user. This event
can also be used to export reports.
Multiple-Occurrence Events
The following events are raised multiple times during a Section report's processing.
Events raised more than once
FetchData
This event is raised every time a new record is processed. The FetchData has an EOF parameter indicating whether
the FetchData event should be raised. This parameter is not the same as the Recordset's EOF property and is
defaulted to True. When working with bound reports (reports using a DataControl), the EOF parameter is
automatically set by the report; however, when working with unbound reports this parameter needs to be
controlled manually.
Use the FetchData event with unbound reports to set the values of custom fields that were added in the
DataInitialize event or with bound reports to perform special functions, such as combining fields together or
performing calculations. The FetchData event should not have any references to controls on the report.
If you need to use a value from a Dataset with a control in the Detail section, set a variable in the FetchData event
PageStart
This event fires before a page is rendered. Use this event to initialize any variables needed for each page when
running an unbound report.
PageEnd
This event is raised after each page in the report is rendered. Use this event to update any variables needed for
each page when running an unbound report.
Important: Never reference the report's Fields collection in these section events. Only reference the Fields
collection in theDataInitialize and FetchData events.
Format
ActiveReports raises this event after the data is loaded and bound to the controls contained in a section, but before
the section is rendered to a page.
The Format event is the only event in which you can change the section's height. Use this section to set or change
the properties of any controls or the section itself.
Also use the Format event to pass information, such as an SQL String, to a Subreport.
If the CanGrow or CanShrink property is True for the section or any control within the section, all of the growing
and shrinking takes place in the Format event. Because of this, you cannot obtain information about a control or
section's height in this event.
Because a section's height is unknown until the Format event finishes, it is possible for a section's Format event to
be raised while the report is on a page to which the section is not rendered. For example, the Detail Format event
is raised but the section is too large to fit on the page. This causes the PageFooter events and the PageEnd event
to be raised on the current page, and the PageStart, any other Header events, and possibly the FetchData event to
be raised before the section is rendered to the canvas on the next page.
BeforePrint
ActiveReports raises this event before the section is rendered to the page.
The growing and shrinking of the section and its controls have already taken place. Therefore, you can use this
event to get an accurate height of the section and its controls. You can modify values and resize controls in the
BeforePrint event, but you cannot modify the height of the section itself.
Note: If a section contains the SubReport control that occupies more than one page, the SubReport gets split
into smaller parts at rendering. In this case, you can use the BeforePrint event - it will fire multiple times to
get the height of each part of the rendered SubReport.
AfterPrint
ActiveReports raises this event after the section is rendered to the page.
Although AfterPrint was an important event prior to ActiveReports Version 1 Service Pack 3, it is rarely used in any
of the newer builds of ActiveReports. This event is still useful, however, if you want to draw on the page after text
has already been rendered to it.
Event Sequence
Multi-threaded, single-pass processing enables Section reports to surpass other reports in processing and output
generation speed. ActiveReports processes and renders each page as soon as the page is ready. If a page has
unknown data elements or its layout is not final, it places the page in cache until the data is available.
Sequence of Events
Summary fields and KeepTogether constraints are two reasons why a page might not render immediately. The
summary field is not complete until all the data needed for calculation is read from the data source. When a
summary field such as a grand total is placed ahead of its completion level, such as in the report header, the
report header and all following sections are delayed until all of the data is read.
There are ten report events in the code behind a Section report, or seven in a ActiveReport script.
Because there are so many ways in which you can customize your reports, not all reports execute in the same
way. However, when you run a report, this is generally what happens:
1. ActiveReports raises the ReportStart event. The report validates any changes made to the report structure
in ReportStart. In some cases, data source properties raise the DataInitialize event.
2. Printer settings are applied. If none are specified, the local machine's default printer settings are used.
3. If the DataInitialize event was not already raised, ActiveReports raises it and opens the data source.
4. If the data source contains Parameters with unset values and the ShowParameterUI property is set
to True, ActiveReports displays a parameters dialog to request values from the user.
5. Closing the dialog raises the ParameterUIClosed event. If the report is a subreport that requires
parameters, ActiveReports binds the subreport parameters to any fields in the parent report.
6. ActiveReports raises the FetchData event.
7. If there is no data, the NoData event is raised.
8. The PageStart event raises, and then raises again after each PageEnd event until the final page.
9. Group sections are bound and sections begin rendering on pages.
10. ActiveReports raises Section Events to process sections in (roughly) the following order:
DataSourceChanged
This event occurs if the report's data source is changed. This is mainly useful with the end-user designer control.
NoData
This event occurs if the report's data source returns no records.
ParameterUIClosed
This event occurs when the user closes the parameter dialog.
PrintAborted
This event occurs when the user cancels a print job.
PrintProgress
This event occurs once for each page while the report document is printing.
Script Editor
To access the script editor, click the script tab below the report design surface. The script tab contains two drop-downs (Object and Event).
Object: Drop down the list and select one of the report sections, or the report itself.
Event: Drop down the list and select from the list of events generated based on your selection in the Object drop down. If you select a report section as the Object, there are three events:
Format, BeforePrint, and AfterPrint. If you select ActiveReport as the Object, there are seven events. See Section Report Events for further information.
Add script to the events in the same way that you add code to events in the code view of the report. When you select an event, the script editor generates a method stub for the event.
Using the ScriptLanguage ('ScriptLanguage Property' in the on-line documentation) property of the report, you can set the script language that you want to use.
Caution: Since the RPX file can be read with any text editor, use the AddCode ('AddCode Method' in the on-line documentation) or AddNamedItem ('AddNamedItem Method' in the
on-line documentation) method to add secure information such as a connection string.
Note: The basic approach of using the "this/Me" and "rpt" keywords is as follows - use "this/Me" to access the properties and controls added to the sections of the report, whereas use
"rpt" within the instance of the ActiveReports class only to access its public properties, public events and public methods.
Use Run-time error handling: When run-time errors occur, a corresponding error message is displayed in the Preview tab stating the problem.
Note: A declared variable is not static by default. Use the static keyword to declare static variables.
Page Setup
On the Page Setup page, you can make changes to the report margins (left, right, top, and bottom), specify a
gutter, and select the Mirror margins option. This page also shows a preview of how each setting appears on the
report page.
Top margin: Set the Top margin for report pages.
Bottom margin: Set the Bottom margin for report pages.
Left margin: Set the Left margin for report pages.
Right margin: Set the Right margin for report pages.
Gutter: Set Gutter to give extra space between the edge of the page and the margins. This allows
Important: For items set to Printer Default, default printer settings are used from the printer installed on
the environment where the report is being created. The paper size might also change based on the runtime
environment so in case the paper size of your report is fixed, please specify it beforehand.
Styles
On the Styles page, you can change the appearance of text associated with controls, either by creating a new style
sheet, or by modifying and applying an existing style.
New: Use this button to create a new style.
Delete: Use this button to delete an existing style.
Export styles to file: Use this button to export an existing style to an external XML *.reportstyle file.
Import styles from file: Use this button to import styles a *.reportstyle file.
Font name: Set or modify the font in your new or existing style.
Font size: Set or modify the font size in your new or existing style.
Bold: Enable or disable Bold text for your new or existing style.
Italic: Enable or disable Italic text in your new or existing style.
Underline: Enable or disable Underlined text in your new or existing style.
Strikethrough: Enable or disable Strikethrough text in your new or existing style.
BackColor: Set the Backcolor to use in your new or existing style.
ForeColor: Set the Forecolor to use in your new or existing style.
Horizontal Alignment: Set the horizontal alignment to Left, Center, Right, Justify for your new or
existing style.
Vertical Alignment: Set the vertical alignment to Top, Middle, Bottom for your new or existing style.
Script: Select the script to use in your new or existing style.
Global Settings
On the Global Settings page, you can change the design layout of your report.
Snap Lines: Select whether to use snap lines at design time or not.
Snap to Grid: Select whether the control moves from one snap line to another at design time.
Show Grid: Select whether to show or hide the grid at design time.
Grid Columns: Set the count of columns in a grid.
Grid Rows: Set the count of rows in a grid.
Dimension Lines: Set whether to use dimension lines at design time or not.
Grid Mode: Select whether to show gridlines as Dots or Lines.
Show Delete Prompt: Select this option to get a warning when you try to delete a parameter or
calculated field from the Report Explorer.
Ruler Units: Set the ruler units in Inches or Centimeters.
Preview Pages: Set the number of pages to display in the Preview tab. Minimum values is 1 and
maximum is 10000 pages. By default, the Preview tab displays 10 pages.
Note: This property allows you to set number of pages to display in the Preview tab only. To set
Caution: You cannot add a header section without a corresponding footer section. If you try to do so in code, the
results are unstable.
You can set the properties for the GroupHeader and GroupFooter sections in their corresponding dialogs. Following is a
list of properties you can set through the options in these dialogs. Each option in the GroupHeader dialog corresponds to
a property in the properties window. To access the properties directly, select the section and open the properties window.
See the associated property names in parenthesis with each dialog option below.
GroupHeader Dialog
To access the GroupHeader dialog, right click the group header and in the Properties window under the properties list
where the commands are displayed, click the Property dialog link. See Properties Window for further information on
commands.
General
Name (Name): Indicates the name of the GroupHeader in code. It is unique for a report.
Tag (Tag): Indicates the user-defined information persisted with the GroupHeader section.
Visible (Visible): Checkbox to specify the visibility of the GroupHeader section.
DataField (DataField): Field or expression on which you group the data.
Appearance
Background color (BackColor): Dropdown list to set the background color of the GroupHeader section.
Layout
Insert new page (NewPage): Dropdown list to determine whether a new page is inserted before and/or after
displaying the GroupHeader section.
Insert new column (NewColumn): Dropdown list to determine whether a new column (in a multi-column
report) appears before and/or after displaying the GroupHeader section.
Repeat section (RepeatStyle): Dropdown list to specify whether the GroupHeader section appears with every
column or page that the Detail section or associated footer appears on.
Keep section and its footer on a single page (GroupKeepTogether): Dropdown list to specify whether the
GroupHeader section and its footer appear as a single block on the same page or not.
Keep section on a single page (KeepTogether): Checkbox to specify whether the GroupHeader
section appears on a single page.
Keep section and its footer in a single column (ColumnGroupKeepTogether): Checkbox to specify whether
the GroupHeader section and its footer appear as a single block in the same column.
Keep section underneath the following section (UnderlayNext): Checkbox to specify whether the
GroupHeader section appears in the following section or not. It allows you to show group header information
inside the group details, so long as you keep the BackColor property of the Detail section set to Transparent.
Use column layout (ColumnLayout): Checkbox to determine whether the GroupHeader section uses the same
GroupFooter Dialog
To access the GroupFooter dialog, right click the group footer and in the Properties window under the properties
list where the commands are displayed, click the Property dialog link. See Properties Window for further information on
commands.
General
Name (Name): Indicates the name of the GroupFooter in code. It is unique for a report.
Tag (Tag): Indicates the user-defined information persisted with the GroupFooter section.
Visible (Visible): Checkbox to specify the visibility of the GroupFooter section.
Appearance
Background color (BackColor): Dropdown list to set the background color of the GroupFooter section.
Layout
Insert new page (NewPage): Dropdown list to determine whether a new page is inserted before and/or after
displaying the GroupFooter section.
Insert new column (NewColumn): Dropdown list to determine whether a new column (in a multi-column
report) appears before and/or after displaying the GroupFooter section.
Keep section on a single page (KeepTogether): Checkbox to determine whether the GroupFooter
section appears on a single page.
Use column layout (ColumnLayout): Checkbox to specify whether the GroupFooter section uses the same
column layout as the Detail section.
Print at the bottom of page (PrintAtBottom): Checkbox to specify whether the GroupFooter section is
printed at the bottom of the page immediately before the PageFooter section.
Can increase to accommodate contents (CanGrow): Checkbox to specify whether the height of the
GroupFooter section can grow when its controls extend beyond its original height.
Can decrease to accommodate contents (CanShrink): Checkbox to specify whether the height of the
GroupFooter section can adjust to the total height of controls placed in it.
When you run the report, it renders the group header, followed by all related instances of the detail section, and then the
group footer. It renders a new group header section for each instance of the grouping field.
Controls in the group header render once for each instance of the group, so you can place the column header labels to
describe the data in the detail fields here.
Multiple Grouping
In a section report, you can nest group header and footer pairs and group each on a different field. You can add up to 32
groupings in one report.
Note: As with any group header and footer pair, group your data on the fields that you specify in the DataField
('DataField Property' in the on-line documentation) property of the group header, but in the order of your
groups. For example:
SELECT * FROM Customers ORDER BY GroupHeader1DataField, GroupHeader2DataField, GroupHeader3DataField
When you run a report with multiple groupings like the one above, the sections print in the following order:
1. ReportHeader1 prints once and does not repeat.
2. PageHeader1 prints once at the top of each page.
3. GroupHeader1 prints once for the first value its DataField returns.
4. GroupHeader2 prints once for the first value its DataField returns within the context of GroupHeader1's
DataField value.
5. GroupHeader3 prints once for the first value its DataField returns within the context of GroupHeader2's
DataField value.
6. Detail1 prints once for each record that falls within the context of GroupHeader3's DataField value.
7. GroupFooter3 prints once at the end of the records that fall within the context of GroupHeader3's DataField
value.
8. GroupHeader3 may print again, if more values return within the context of GroupHeader2's DataField value.
9. Each time GroupHeader3 prints again, it is followed by Detail1 (once for each related record) and GroupFooter3.
10. GroupFooter2 prints once after GroupFooter3.
11. GroupHeader2 may print again, if more values return within the context of GroupHeader1's DataField value.
12. Each time GroupHeader2 prints again, it is followed by Detail1 (once for each related record) and GroupFooter2.
13. GroupFooter1 prints once after GroupFooter2.
14. GroupHeader1 prints once for the second value its DataField returns, followed by GroupHeader2, and so on in a
pattern similar to the one above.
15. ReportFooter1 prints once on the last page where the data displayed in the report ends.
16. PageFooter1 prints once at the bottom of each page. Also, its position within groups varies.
Note: At design time, although the PageFooter section is located above the ReportFooter section, at
runtime it appears after the ReportFooter section on the last page.
With many groupings, you might find the need to rearrange the order of your groups. If your report has more than one
group, you can right-click the report surface, and select Reorder Groups. This opens the Group Order dialog, where
you can drag the groups and set them in any order you want.
Alternatively, you can also click the Reorder Groups button in the ActiveReports toolbar, to open the Group Order
dialog. See Toolbar for further information.
Note: The ReportInfo control has many preformatted options in the FormatString property for
RunDateTime and Page Numbers. For more information, see Display Page Numbers and Report Dates.
Caution:
The format from the OutputFormat property is applied to the value set in the DataField property of
the Value property. It is not applied when a string is set in the Text property.
OutputFormat property settings are valid only for Double or DateTime type values. In case of a
String or when no data type is set, the format is automatically applied to only those values that
can be converted to Double or DateTime, otherwise no format is applied.
The OutputFormat property allows four sections delimited by a semicolon. Each section contains the format
specifications for a different type of number:
The first section provides the format for positive numbers.
The second section provides the format for negative numbers.
The third section provides the format for Zero values.
The fourth section provides the format for Null or System.DBNull values.
For example: $#,#00.00; ($#,#00.00_); $0.00; #
Dates:
dddd, MMMM d, yyyy = Saturday, December 25, 2012
dd/MM/yyyy = 25/12/2012
d or dd = day in number format
ddd = day in short string format (for example, Sat for Saturday)
dddd = day in string format (for example, Saturday)
MM = month in number format
MMM = month in short string format (for example, Dec for December)
MMMM = month in string format (for example, December)
y or yy = year in two digit format (for example, 12 for 2012)
yyyy or yyyy = year in four digit format (for example, 2012)
Times:
hh:mm tt = 09:00 AM
HH:mm = 21:00 (twenty-four hour clock)
HH = hours in 24 hour clock
hh = hours in 12 hour clock
mm = minutes
ss = seconds
tt = AM or PM
Note: Underscore (_) keycode can be used in OutputFormat property to skip the width of the next
character. This code is commonly used as _) to leave space for a closing parenthesis in a positive number
format when the negative number format includes parentheses. This allows both positive and negative values
to line up at the decimal point.
To release a report in C#
C# code.
rpt.Document.Dispose();
rpt.Dispose();
rpt = null;
Speed Considerations
Image: An image repeated on every page of a very long report is stored only once to improve memory,
but the comparison necessary to detect duplicate images slows performance. This is not only the case
with the report document itself, but also with the Excel, PDF, and HTML exports as they perform their
own comparisons.
Summaries: Placing summaries (primarily page count and report totals) in header sections will slow
Isolated Storage
If you use the CacheToDisk property without setting a CacheToDiskLocation, the default location in which it caches
resources is IsolatedStorage, so you must have IsolatedStorageFilePermission in order to use it. The cache
capacity for IsolatedStorage may depend on your configuration, but does not exceed 3 GB.
Important: Temporary files and folders created in IsolatedStorage are not deleted automatically.
Exporting
ActiveReports provides three independent ways to export a report to different formats:
Rendering Extensions: You can use the Render method in Rendering Extensions of the PageDocument
class to render a page report and RDL Report to Image, Html, Pdf, Xml, Word and Excel formats.
Export Filters: You can use the Export method of the corresponding ExportFilter class to export a section
report, page report and RDL Reports. Exporting in Section Report is only possible through Export Filters.
Transformation Device: You can use the Render method in Rendering Extensions of Page Document
class using ExcelTransformationDevice to render an RDL report to Excel format.
The following table illustrates the supported export formats for section, page and an RDL report.
Click the ✓ mark to see the implementation of the corresponding Export format.
Rtf: Export reports to RTF, RichText Format that opens in Microsoft Word, and is ✓ ✓ ✓
native to WordPad.
Word: Export reports to DOC, a Word HTML (.doc) ✘ ✓ ✓
format that opens in Microsoft Word.
Text: Export reports to TXT, plain text format that opens in Notepad or any text ✓ ✓ ✓
editor. Export reports to CSV, comma separated values, a format that you can open
in Microsoft Excel.
Image: Export reports to BMP, EMF, GIF, JPEG, TIFF, and PNG image formats ✘ ✓ ✓
Tiff: Export reports to TIFF image format for optical archiving and faxing. ✓ ✓ ✓
Note: When exporting to Excel, use Rendering Extensions when the purpose of export is to get greater
layout accuracy and use Transformation Device when the focus is on exporting data.
Rendering Extensions
In ActiveReports, you can use the Render method in Rendering Extensions of the PageDocument class to render in
any one of the following formats. Each exporting format provides it's own set of properties to control how the
report is rendered.
Rendering to HTML
Rendering to PDF
Rendering to Image
Rendering to XML
Rendering to Excel
Rendering to Word
Rendering to HTML
HTML, or hypertext markup language, is a format that opens in a Web browser. You can export your reports to
HTML or MHT formats. It is a good format for delivering content because virtually all users have an HTML browser.
You can use the HTMLRenderingExtension ('HtmlRenderingExtension Class' in the on-line
documentation) to render your report in this format.
In order to render your report in HTML, add reference to the following assemblies in the project:
GrapeCity.ActiveReports.Export.Html.v9.dll
GrapeCity.ActiveReports.Extensibility.v9.dll
Note: Rendering to HTML requires the .NET Framework full profile version. To ensure you are using the full
profile version, go to the Visual Studio Project menu > Properties > Compile tab > Advanced Compile
Options (for Visual Basic projects) or to the Project menu > Properties > Application tab (for C#
projects) and under Target framework select a full profile version.
// Create a directory
System.IO.DirectoryInfo outputDirectory = new
System.IO.DirectoryInfo(@"C:\MyHTML");
outputDirectory.Create();
Property Description
Limitations
HTML is not the best format for printing. Use the PDF rendering extension instead.
Vertical-align style is always Top for text boxes in HTML reports. If Bottom or Middle vertical alignment
is an essential style element in your report, it is recommended to use any format other than HTML.
TextIndent property and FillCharacter property of the TableOfContents control's Level setting are not
supported.
Interactivity
Reports rendered in HTML support a number of interactive features. Hyperlinks, Bookmarks and Drill through links
can be rendered to HTML. However, Document Maps are not available in this format. For a drill down report, make
sure that the data you want to display is expanded before rendering, otherwise it renders in the hidden state.
Rendering to PDF
Portable Document Format (PDF), is a format recommended for printing and exports. You can use the
PDFRenderingExtension ('PdfRenderingExtension Class' in the on-line documentation) to render your
report in this format. With the PDF rendering extension, you can use features such as font linking, digital
signatures and end-user defined characters (EUDC). These features are only available in the Professional Edition of
ActiveReports.
In order to render your report in PDF, add reference to the following assemblies in the project:
GrapeCity.ActiveReports.Export.Pdf.v9.dll
Property Description
Application Set the value that appears for application in the Document Properties dialog of
('Application the PDF viewer application.
Interactivity
PDF is considered as the best format for printing and it also supports interactive features like Document Map,
Bookmarks and Hyperlinks. However, in case you have any data hidden (like in a drill-down report) at the time of
rendering, it does not show up in the output. Therefore, it is recommended to expand all toggle items prior to
rendering.
Rendering to Images
Image is the format that converts your report to an image file. You can use the ImageRenderingExtension ('ImageRenderingExtension
Class' in the on-line documentation) to your render you report in this format. Make sure that you select an ImageType ('ImageType
Property' in the on-line documentation) to any of the six different image formats available: BMP, EMF, GIF, JPEG, TIFF, and PNG.
In order to render your report as an Image, add reference to the following assemblies in the project:
GrapeCity.ActiveReports.Export.Image.v9.dll
GrapeCity.ActiveReports.Extensibility.v9.dll
Note: By default, the image rendering extension creates a separate file for each page in a report and adds an index to each
corresponding file name (for example, image001.PNG, image002.PNG, etc).
To render the entire report as a single image, set the Pagination ('Pagination Property' in the on-line documentation) setting to
False.
Property Description
Compression Sets or returns a value which specifies the compression to be used when exporting.
('Compression Property'
in the on-line
documentation)
Dither ('Dither Property' Specifies whether the image should be dithered when saving to a black and white output format, like CCITT3 or
in the on-line Rle. This property has no effect if the CompressionScheme property is set to Lzw or None(represents color
documentation) output).
DpiX ('DpiX Property' in Adjust the horizontal resolution of rendered images. The default value is 96.
the on-line
documentation)
DpiY ('DpiY Property' in Adjust the vertical resolution of rendered images.
the on-line
documentation)
EndPage ('EndPage The default value of 0 in this property renders all of the report pages. Otherwise, set this value to the number
Property' in the on-line of the last page to render. Please note that if the StartPage property is set to 0, all of the pages of the report
documentation) render. In order to use the EndPage property, you must set the StartPage property to a valid non-zero
number.
ImageType ('ImageType Select the type of image to which you want to render the report. Supported types are BMP, EMF, GIF, JPEG,
Property' in the on-line TIFF, and PNG.
documentation)
MarginBottom Set the value in inches to use for the bottom margin of the image. The format is an integer or decimal with "in"
Quality ('Quality Gets or sets the quality of the report to be rendered as an image.
Property' in the on-line
documentation)
SizeToFit ('SizeToFit By default, rendered report pages are not resized to fit within the selected image size. Set this value to True to
Property' in the on-line resize the report pages.
documentation)
Start Page ('StartPage The default value of zero in this and the EndPage properties render all of the report pages to images.
Property' in the on-line Otherwise, set this value to the number of the first page to render.
documentation)
WatermarkAngle Specify the degree of angle for the watermark text on the image. Valid values range from 0 to 359, where 0 is
('WatermarkAngle horizontal, left to right.
Property' in the on-line
documentation)
WatermarkColor Select a color for the watermark text on the image. The default value for the watermark color is gray, but you
('WatermarkColor can select any Web, System, or Custom color.
Property' in the on-line
documentation)
WatermarkFont Set the font to use for the watermark to any valid System.Drawing.Font.
('WatermarkFont
Property' in the on-line
documentation)
WatermarkTitle Sets text (i.e. CONFIDENTIAL) to use as the watermark on the image.
('WatermarkTitle
Property' in the on-line
documentation)
Interactivity
Reports rendered as images do not support any of the interactive features of Data Dynamics Reports. Any data hidden at the time of export is
hidden in the image. To display all data in a drill-down report, expand all toggle items prior to exporting.
Rendering to XML
XML is a useful format for delivering data to other applications as the resulting XML file opens in an internet browser. You can use
the XmlRenderingExtension ('XmlRenderingExtension Class' in the on-line documentation) to render your report in this format.
XML is a good format for delivering data to other applications. The resulting XML file opens in an internet browser
In order to render your report in XML, add reference to the following assemblies in the project:
GrapeCity.ActiveReports.Export.Xml.v9.dll
Property Description
Encoding Select the encoding schema to use in the XML transformation.
('Encoding
Property' in the
on-line
documentation)
XslStylesheet Select the existing XSL Stylesheet file to use to transform the resulting XML file. Note: When using the
('XslStylesheet XslStylesheet option, be sure to save the file in the correct file format, such as HTML.
Property' in the
on-line
documentation)
Interactivity
XML format does not support interactive features except that when rendering a report to XML, complete drill-down data is shown regardless
of whether the data is rendered in expanded state or not.
Rendering to Excel
Microsoft Excel is one of the formats to which you can render your report using ExcelRenderingExtension
('ExcelRenderingExtension Class' in the on-line documentation). You can export excel files in two formats,
i.e. Xls and Xlsx.
In order to render your report to Excel, add reference to the following assemblies in the project:
GrapeCity.ActiveReports.Export.Excel.v9.dll
GrapeCity.ActiveReports.Extensibility.v9.dll
The following steps provide an example of rendering a report in the Microsoft Excel format.
1. In Visual Studio, create a new WindowsForms application or open an existing one.
2. On the Form.cs or Form.vb that opens, double-click the title bar to create the Form_Load event.
3. Add the following code inside the Form_Load event.
Visual Basic.NET code. Paste INSIDE the Form Load event.
' Provide the page report you want to render.
Dim report As New GrapeCity.ActiveReports.PageReport(New
System.IO.FileInfo("C:\Sample_PageReport.rdlx"))
Dim reportDocument As New GrapeCity.ActiveReports.Document.PageDocument(report)
Property Description
PageSettings ('PageSettings Returns an ExcelRenderingExtensionPageSettings
Property' in the on-line ('ExcelRenderingExtensionPageSettings Class' in the on-line
documentation) documentation) object for initializing Excel file print setting.
Pagination ('Pagination Forces pagination or galley report layout mode.
Property' in the on-line
documentation)
Security ('Security Property' in Returns an ExcelRenderingExtensionSecurity
the on-line documentation) ('ExcelRenderingExtensionSecurity Class' in the on-line
documentation) object for initializing document security.
UseDefaultPalette Indicates whether to export the document with the default Excel palette.
('UseDefaultPalette Property'
in the on-line documentation)
FileFormat ('FileFormat Specifies the output format of the Excel document, i.e. Xls or Xlsx.
Property' in the on-line
documentation)
OpenXmlStandard Specifies the level of Open XML document conformance on exporting in
('OpenXmlStandard Property' Xlsx file format. You can choose between Strict and Transitional value.
in the on-line documentation)
MultiSheet ('MultiSheet Indicates whether to generate a single-sheet or multi-sheet Excel
Property' in the on-line document.
documentation)
Interactivity
Reports rendered in Excel support a number of interactive features like Bookmarks and Hyperlinks. However, in
case you have any data hidden at the time of rendering (like in a drill-down report), it does not show up in the
output. It is recommended that you expand all toggle items prior to rendering.
Limitations
BackgroundImage, overlapping controls, rounded corners (for Shape and Container) are not exported.
Rendering to Word
MS Word is one of the formats to which you can export ActiveReports from the Viewer. You can use
the WordRenderingExtension ('WordRenderingExtension Class' in the on-line documentation) to render
your report in Microsoft® Word 2003 and 2007 formats.
In order to render your report in MS Word, add reference to the following assemblies in the project:
GrapeCity.ActiveReports.Export.Word.v9.dll
GrapeCity.ActiveReports.Extensibility.v9.dll
The following steps provide an example of rendering a report in the Word format.
1. In Visual Studio, create a new Windows Forms Application or open an existing one.
2. On the Form.cs or Form.vb that opens, double-click the title bar to create the Form_Load event.
3. Add the following code inside the Form_Load event.
Property Description
Author ('Author Property' in Enter the name of the author to appear in the File Properties dialog of the
the on-line documentation) Microsoft® Word application on the Summary tab in the Author field.
BaseUrl ('BaseUrl Property' Enter a base URL for any relative hyperlinks used in the report. This value
in the on-line appears in the File Properties dialog of the Microsoft® Word application on the
documentation) Summary tab in the Hyperlink base field.
Generator ('Generator Set the identity of the document generator in a meta-data file stamp. The
Property' in the on-line default value is "Created using ActiveReports."
documentation)
PageHeight ('PageHeight Enter a value in inches (i.e. 11 in) to set the height of the report's pages. This
Property' in the on-line value overrides the report's original settings.
documentation)
PageWidth ('PageWidth Enter a value in inches (i.e. 8.5 in) to set the width of the report's pages. This
Property' in the on-line value overrides the report's original settings.
documentation)
Title ('Title Property' in the Enter the document’s title. This value appears in the File Properties dialog of
on-line documentation) the Microsoft® Word application on the Summary tab in the Title field.
UseMhtOutput Set True or False value to indicate whether Mht output is to be used for the
('UseMhtOutput Property' in resultant Word document or not.
the on-line documentation)
Limitations
Although background colors for controls export to Word documents, background colors for sections such as Body
and Page Header or Footer do not.
Interactivity
Reports rendered in a Word format supports both Bookmarks and Hyperlinks. However, if visibility toggling (like in
a drill-down report) is essential to your report, it is recommended to use the HTML rendering extension. And If a
Document map is essential to your report, it is recommended to use the PDF rendering extension.
Export Filters
ActiveReports provides custom components for exporting reports into six formats. Each export format has special
features, however, not all formats support all of the features that you can use in your reports. Here are the unique
usage possibilities of each format, along with any limitations inherent in each.
HTML Export
PDF Export
Text Export
HTML Export
HTML, or hypertext markup language, is a format that opens in a Web browser. The HTML export filter has a
number of useful properties that allow you to control your output. You can set the properties either in code using
the HTMLExport ('HtmlExport Class' in the on-line documentation) object after adding reference to the
following assembly in your project, or by selecting the object in the toolbox and adding it to the component tray
below the Form which automatically adds this assembly to the project:
GrapeCity.ActiveReports.Export.Html.v9.dll
Note: HTML Export requires the .NET Framework full profile version. To ensure you are using the full profile
version, go to the Visual Studio Project menu > Properties > Compile tab > Advanced Compile Options
(for Visual Basic projects) or to the Project menu > Properties > Application tab (for C# projects)
and under Target framework select a full profile version.
PDF Export
PDF, or portable document format, opens in the Adobe Reader. The PDF export filter has a number of useful
properties that allow you to control your output. You can set the properties either in code using the PDFExport
('PdfExport Class' in the on-line documentation) object after adding reference to the following assembly in
your project, or by selecting the object in the toolbox and adding it to the component tray below the Form which
automatically adds this assembly to the project:
GrapeCity.ActiveReports.Export.Pdf.v9.dll
With the PDF export filter, you can use the feature Font Linking.
Note: These features are only available in the Professional Edition of ActiveReports.
DisplayTitle ('DisplayTitle True or False Set to True to use the Title string entered in the Title
Property' in the on-line (default) property below. Otherwise, the file name is used.
documentation)
FitWindow ('FitWindow True or False Set to True to expand the window to fit the size of the first
Property' in the on-line (default) displayed page.
documentation)
HideMenubar True or False Set to True to hide the menu in the Adobe Reader when
('HideMenubar Property' in (default) the document is first opened.
the on-line
documentation)
HideToolbar ('HideToolbar True or False Set to True to hide the toolbars in the Adobe Reader when
Property' in the on-line (default) the document is first opened.
documentation)
HideWindowUI True or False Set to True to hide the scrollbars and navigation controls
('HideWindowUI Property' (default) in the Adobe Reader when the document is first opened,
in the on-line displaying only the document.
documentation)
Keywords ('Keywords String Enter keywords to display in the Adobe Document
Property' in the on-line Properties dialog, Description tab, Keywords field.
documentation)
OnlyForPrint True or False Set to indicate whether the PDF is only for print.
('OnlyForPrint Property' in (default)
the on-line
documentation)
Subject ('Subject Property' String Enter a subject to display in the Adobe Document
in the on-line Properties dialog, Description tab, Subject field.
documentation)
Title ('Title Property' in the String Enter a title to display in the Adobe Document Properties
on-line documentation) dialog, Description tab, Title field.
Text Export
Plain Text is a format that opens in Notepad or Microsoft Excel depending on the file extension you use in the
filePath parameter of the Export ('Export Method' in the on-line documentation) method. Use the extension
.txt to open files in Notepad, or use .csv to open comma separated value files in Excel. The Text export filter has
a number of useful properties that allow you to control your output. You can set the properties either in code using
the TextExport ('TextExport Class' in the on-line documentation) object after adding reference to the
following assembly in your project, or by selecting the object in the toolbox and adding it to the component tray
below the Form which automatically adds this assembly to the project:
GrapeCity.ActiveReports.Export.Xml.v9.dll
Text Export Properties
Text
Usage:
Create plain text files
Create comma (or other character) delimited text files
Feed raw data to spreadsheets or databases
Open in Notepad or Excel (comma delimited)
Does not support anything but plain fields and labels:
Supports plain text only with no formatting other than simple delimiters
Supports encoding for foreign language support
RTF Export
RTF, or RichText format, opens in Microsoft Word, and is native to WordPad. This export does not render reports
exactly as they appear in the Viewer due to inherent differences in the formats.
You can set the property either in code using the RTFExport ('RtfExport Class' in the on-line documentation)
object after adding reference to the following assembly in your project, or by selecting the object in the toolbox
and adding it to the component tray below the Form which automatically adds this assembly to the project:
GrapeCity.ActiveReports.Export.Word.v9.dll
Usage:
Create word-processing files
Open in Word or WordPad
Does not support:
Section or Page back colors
Angled text
Excel Export
XLSX is a format that opens in Microsoft Excel as a spreadsheet. This export does not render reports exactly as
they appear in the Viewer due to inherent differences in the formats. The XLSX export filter has a number of useful
properties that allow you to control your output. You can set the properties either in code using the XLSExport
('XlsExport Class' in the on-line documentation) object after adding reference to the following assembly in
your project, or by selecting the object in the toolbox and adding it to the component tray below the Form which
automatically adds this assembly to the project:
GrapeCity.ActiveReports.Export.Excel.v9.dll
Excel Export Properties
MinRowHeight Single Set the number of inches that is the smallest height for a row in the
('MinRowHeight (VB) or exported spreadsheet.
Property' in the on-line float
documentation) (C#) Tip: Larger values force the export to place more controls on a single
line by reducing the number of rows added to match blank space. Set
this value to .25 inches or more to get rid of small empty rows.
MultiSheet True or Set to True to export each page of your report to a separate sheet
('MultiSheet Property' False within the Excel file. This can increase performance and output quality at
in the on-line (default) the cost of memory consumption for reports with complex pages and a
documentation) lot of deviation between page layouts.
In general, use False for reports with more than 30 pages.
RemoveVerticalSpace True or Set to True to remove vertical empty spaces from the spreadsheet. This
('RemoveVerticalSpace False may improve pagination for printing.
Property' in the on-line (default)
documentation)
Security ('Security Set a password and username to protect the excel spreadsheet.
Property' in the on-line
documentation)
UseCellMerging True or Set to True to merge cells where applicable.
('UseCellMerging False
Property' in the on-line (default)
documentation)
UseDefaultPalette True or Set to True to export document with Excel default palette.
('UseDefaultPalette False
Property' in the on-line (default)
documentation)
Usage:
Create spreadsheets
Open in Microsoft Excel
Does not support:
Line control
Shapes (other than filled rectangles)
CrossSectionBox and CrossSectionLine controls
Overlapping controls
Borders on controls with angled text
Angled text
CheckBox control (only its text element is exported)
Dither ('Dither True or False (default) Set to True to dither the image when
Property' in the on- you save it to a black and white
line documentation) format (Ccitt3, Ccitt4 or Rle). This
property has no effect if the
CompressionScheme is set to Lzw or
None.
DpiX ('DpiX Property' Integer (VB) or int (C#) greater than 0 Set the horizontal resolution of a
in the on-line report when exporting to TIFF format.
documentation) The default value is 200.
Setting the DpiX or DpiY property to
large values can cause the rendered
image to be too large and not enough
memory in system can be allocated to
the bitmap.
DpiY ('DpiY Property' Integer (VB) or int (C#) greater than 0 Set the vertical resolution of a report
in the on-line when exporting to TIFF format. The
documentation) default value is 196.
Setting the DpiX or DpiY property to
large values can cause the rendered
image to be too large and not enough
memory in system can be allocated to
the bitmap.
Usage:
Create optical archive reports
Send reports via fax machines
Open in image viewers
Generates an image of each page. 100% WYSIWYG.
Note: HTML Export requires the .NET Framework full profile version. To ensure you are using the full profile version, go to the Visual Studio
Project menu > Properties > Compile tab > Advanced Compile Options (for Visual Basic projects) or to the Project menu > Properties >
Application tab (for C# projects) and under Target framework select a full profile version.
Note: In ActiveReports, by default, the assemblies are located in the ...\Common Files\GrapeCity\ActiveReports 9 folder.
Use the following steps to export reports through export filters. These steps assume that you have already created a Windows Application and added
the export controls to your Visual Studio toolbox. For more information, see Adding ActiveReports Controls.
To export a report
1. In your project's Bin>Debug folder, place the report.rpx (Section Report) or report.rdlx (Page/Rdl Report).
2. In the Solution Explorer, right-click the References node and select Add Reference.
3. In the Add Reference dialog that appears, select the following references and click OK to add them to your project.
GrapeCity.ActiveReports.Export.Excel.v9
GrapeCity.ActiveReports.Export.Html.v9
GrapeCity.ActiveReports.Export.Image.v9
GrapeCity.ActiveReports.Export.Pdf.v9
GrapeCity.ActiveReports.Export.Word.v9
GrapeCity.ActiveReports.Export.Xml.v9
4. On the Form.cs or Form.vb, double-click the title bar to create the Form_Load event.
5. In Form_Load event, add the following code to add a report to your project.
To add Page/Rdl report to your project
Visual Basic.NET code. Paste INSIDE the Form_Load event.
' Create a page/Rdl report.
Dim rpt As New GrapeCity.ActiveReports.PageReport()
' Load the report you want to export.
' For the code to work, this report must be stored in the bin\debug folder of your project.
rpt.Load(New System.IO.FileInfo ("report.rdlx"))
Dim MyDocument As New GrapeCity.ActiveReports.Document.PageDocument (rpt)
6. Add the following code to export Page, Rdl and Section Reports to multiple format.
Note: When exporting a report to .MHT file by Export filters use htmlExport.Export(Document doc, Stream outputStream);
For more information, see HTML Export Method ('Export Method' in the on-line documentation).
7. Press F5 to run the application. The exported files are saved in the bin\debug folder.
Font Linking
Font linking helps resolve the situation when fonts on a deployment machine do not have the glyphs that are used
in a development environment. When you find such a glyph mismatch, there is a possibility that the PDF output on
development and deployment machines may be different.
Note: Please make the required changes for the font that you wish to use. In case of the following sample
code, create a Font folder and copy the required font files (arial.ttf, tahoma.ttf, msgothic.ttc, simsun.ttc,
gulim.ttc, mingliu.ttc, micross.ttf).
XML code. Paste between configSections and appSettings tags of the web.config file.
<ActiveReports.PdfExport>
<FontFactory Mode="File">
<AddFolder VirtualPath="~/Fonts" Recurse="true"/>
<Substitute Font="Helv" To="Helvetica"/>
Note: For the Azure worker role project, use an absolute path instead of a virtual path in the code
above: <AddFolder Path="~/Fonts" Recurse="true"/>.
Configuration settings
FontFactory
Description: This is the main font factory node to which you can add fonts.
Attributes
Element Description
Mode Setting the Mode attribute to File allows to use a file based factory, or remove the
attribute for a Windows GDI factory.
Child Elements
None.
Parent Elements
Element Description
ActiveReports.PdfExport The assembly that contains the PdfExport namespace (PDF export, document
options, and security classes).
Example
<FontFactory Mode="File">
AddFolder
Description: Adds all TrueType fonts (.ttc, .ttf) from the specified folder.
Attributes
Element Description
Path Specifies the absolute path to the folder.
Child Elements
None.
Parent Elements
Example
<AddFolder VirtualPath="~/Fonts" Recurse="true"/>
Substitute
Description: Maps an alternate name of fonts to their official names.
Attributes
Element Description
Font Specifies the abbreviated font name (e.g. "Helv").
Child Elements
None.
Parent Elements
Element Description
FontFactory This is the main font factory node to which you can add fonts.
Example
<Substitute Font="Helv" To="Helvetica"/>
Attributes
Element Description
Font Specifies the font name.
Child Elements
None.
Parent Elements
Element Description
FontFactory This is the main font factory node to which you can add fonts.
Example
<SetFallbackFont Font="Arial"/>
Attributes
Element Description
Font Specifies the font used in the reports.
List Specifies the comma-separated list of fonts to be used in case the glyph is not
found.
Caution: The character style of the link won't be outputted in case
the alternate font file does not exist in the specified folder of
the AddFolder setting.
IsDefault When set to True, indicates to use the specified list for any fonts that do not
have their own font links.
Child Elements
None.
Parent Elements
Element Description
FontFactory This is the main font factory node to which you can add fonts.
Example
<AddFontLink Font="Tahoma" List="MS UI Gothic,SimSun,gulim,PMingLiU"/>
Note: You need to have Microsoft Internet Explorer 9 or higher installed on the system to run the Visual Query Designer.
See the graphic below to understand how a simple SQL query is generated in the Visual Query Designer.
Limitations
1. Queries for XML, Object, DataSet Provider or any other specific data providers cannot be created in Visual Query
Designer.
2. Unions, nested queries and stored procedures are not supported in Design Tab.
3. Crosses, full joins, provider-specific joins, and other SQL-specific implementation capabilities are not supported in the
Design Tab.
This opens the Visual Query Designer in a Page Report or Rdl Report.
In a Section Report
1. Connect a Section Report to a data source through the Report Data Source dialog. The Query Designer button is
disabled until the report connects to a data source. For more information see, Bind Reports to a Data Source.
Database View
Database View contains the structure of a database including namespaces, tables, views and columns. You can drag and drop or
double click the elements in the Database View to add them to the Design tab. Alternatively, you can double click the crossed
arrows icon on the right hand side of each element in the Database View to add it to the Design tab.
This is the first step in query building through the Visual Query Designer. A SQL query is generated as you add the database
elements to the Design tab.
Query Tools
The Visual Query Designer provides several tools to generate a query. The Query Tools section is divided into three major areas:
Option Description
Output Checkbox to determine whether the field is included in the result set. The
checkbox is selected by default when a field is added to the Selected Fields panel. You
can clear this checkbox if you do not want the field to be displayed in the Results panel.
Table Displays the name of the table the selected field belongs to.
Alias Allows the user to provide an alternative name for the field.
Total Applies grouping or aggregates on a field. Total (expression) is used to perform a
calculation, retrieve the value of a control, define regulations, create calculated fields, and
define a group level for a report.
Expression - Allows selection of fields from a table. Custom expressions can also
be specified here.
GroupBy - Groups data based on the selected field.
Count - Returns the number of items in a group. Implements the SQL COUNT
aggregate.
Avg - Returns the average of the values in a group. Implements the SQL AVG
aggregate.
Sum - Returns the sum of all the values in the group. Implements the SQL SUM
aggregate.
Min - Returns the minimum value in a group. Implements the SQL MIN aggregate.
Max - Returns the maximum value in a group. Implements the SQL MAX
aggregate.
StDev - Returns the statistical standard deviation of all values in a group.
Implements the SQL STDEV aggregate.
Var - Returns the statistical variance of all values in the group. Implements the
SQL VAR aggregate.
Note: When you add a table to the Selected Fields panel, all the fields in that table are added to the query. In
effect you get a query like Select * from Customers.
Tables and Relationships panel provides the following options for each table:
Option Description
Table Displays the names of all the tables with fields in the Selected Fields panel.
Alias Allows the user to provide an alternative name for the table.
SQL Tab
The SQL Tab displays the SQL statement for the current query. Users can edit the query directly in the SQL Tab.
When you switch to the SQL Tab, the Visual Query Designer automatically formats your query in the correct syntax with
highlighted keywords.
In the SQL Tab you can:
Option Description
Distinct Checkbox Distinct Checkbox is used to remove duplicates from the result set of a SELECT statement. If checked,
it allows users to display only distinct values.
Execute Allows users to execute their query and display the result in Results panel.
Save Allows users to save the query to a DataSet dialog.
Clear Allows users to clear all the panels in the Visual Query Designer and the SQL tab along with it.
The Query Tools section also has a dropdown on the top right corner with two options:
1. Toggle Panels: To expand or collapse the Selected Fields and the Tables and Relationships panel.
2. Show Hints: To show or hide hints on how to use the Visual Query Designer effectively.
Example: "Double click the table or field name in the database view or drag and drop it here." appears at the top of the
Selected Fields panel.
Result panel
Displays the result of the query set in the Visual Query Designer.
This panel is populated when you click the Execute button on the Visual Query Designer toolbar after adding the required fields
or tables in the Selected Fields panel.
Go to Top
Note: This topic uses the Reels database. By default, the Reels.mdb file is located in the [User Documents
2. Add another field, Movie.Title from the same table, to the Selected Fields panel.
3. On the Toolbar of the Visual Query Designer, click the Execute button.
Preview a Query
Go to Top
When you have finished designing your query, you can execute it and then preview the result in the Visual Query
Designer.
1. In the Query Tools section of the Visual Query Designer, go to the Toolbar.
You can preview the result in the Results panel at the bottom of the Visual Query Designer dialog.
Note: When previewing a query, Visual Query Designer shows only a part of the data from the database.
Save a Query
Go to Top
Page Report/Rdl Report
Once a query is created in the Visual Query Designer, the Save button allows you to save the query into the
DataSet dialog.
1. Once your query is created in Visual Query Designer, in the Query Tools section of the Visual Query
Designer, go to the Toolbar.
2. Click the button. Your query appears in Query field of the Query page in the DataSet dialog.
3. Click OK to close the dialog.
Your data set and queried fields appear as nodes in the Report Explorer.
Section Report
Once a query is created in the Visual Query Designer, the Save button allows you to save the query into the
Report Data Source dialog.
1. Once the query is created in Visual Query Designer, in the Query Tools section of the Visual Query
Designer, go to the Toolbar.
Clear a Query
Go to Top
Once a query is created, the Selected Fields panel is populated with fields and Tables and Relationship panel
displays the tables to which the fields used in the query belong.
1. In the Query Tools section of the Visual Query Designer, go to the Toolbar.
This clears the Query Tools section completely including Selected Fields and Tables and Relationships
panel. It also removes the SQL query from the SQL tab and any data appearing in the Results panel.
Edit a Query
Go to Top
There are two ways to edit a query in the Visual Query Designer:
Edit a query created in the Visual Query Designer directly in the SQL tab.
Follow the steps below to edit a query created in the Visual Query Designer manually in the SQL:
1. From the Movie table in Database view, drag and drop the fields MovieID and Title onto the Selected
Fields panel.
2. Under Query Tools, switch to the SQL tab to edit the query manually.
4. On the Toolbar of the Visual Query Designer, click the Execute button.
This approach has some limitations based on the type of queries that can be handled in the Visual Query
Assuming that a query like the following already exists in the Data Set dialog of a Page/Rdl Report or
the Report Data Source dialog of a Section Report, follow the steps below to edit it in the Visual Query
Designer.
SQL Query
select Movie.MovieID, Movie.Title
from Movie
1. Open the Visual Query Designer and under Query Tools, go to the SQL tab. Notice that the SQL query is
already present in the this tab.
2. Go to the Design tab and notice that the Selected Fields panel already contains the fields MovieID and
Title.
3. From the Database view, drag and drop a field, Length from the Movie table onto the Selected Fields
panel.
4. Go to the SQL tab again and see that the query now appears as follows:
SQL Query
select Movie.MovieID, Movie.Title, Movie.Length
from Movie
5. On the Toolbar of the Visual Query Designer, click the Execute button.
Delete a field
Go to Top
You can delete any field from a query in the Visual Query Designer. When you delete a field from a query, the field
remains in the database, but is no longer used in the query.
1. From the Movie table in the Database view, drag and drop the fields MovieID, Country and Title onto the
Selected Fields panel.
2. Hover your mouse over the MovieID field in Selected Fields panel to display the Delete icon.
3. Click the Delete icon to delete the field.
Please note that once you delete a field, it is also removed from the SQL query in the SQL tab.
Sort data
Go to Top
You can sort the records in a table, query, form, or a report on one or more fields in the Visual Query Designer.
For example, you can sort the Movie table by Title in ascending order and Country in descending order. In case
multiple fields are being sorted, you can also determine which field is sorted first and which is sorted later.
2. In the Toolbar of the Visual Query Designer, check the checkbox to display unique values
from the YearReleased field.
3. Click the Execute button.
5. In the Toolbar of the Visual Query Designer, click the Execute button.
The data for the Country field does not appear in the in the Results panel anymore.
Rows which have either have MovieID = 1 or MovieID = 2 are displayed in the Result set.
4. In the Toolbar of the Visual Query Designer, click the Execute button.
As an example of a simple parameterized query, you can create a query parameter that prompts a user for a
Movie ID and displays the Title, UserRating and Length of the movie based on the ID entered.
Query Result in SQL
SQL Query
select Movie.MovieID, Movie.Title, Movie.Country, Movie.UserRating
from Movie
where Movie.Country = ?
3. In the Toolbar of the Visual Query Designer, click the Execute button. The Parameters dialog
automatically appears on the screen.
4. Enter the parameter value USA in the dialog box and click OK.
Go to Top
Visual Illustration
SQL Inner Join returns the records where table1 and table2 intersect.
2. Left Outer Join (left join) - Left Outer Join allows users to select rows that match from both the left and
right tables, plus all the rows from the left table (table 1). This means only those rows from table2 that
intersect with table1 appear in the result set.
Visual Illustration
SQL Left Outer Join returns the records from table1 and only those records from table2 that intersect with
table1.
3. Right Outer Join (right join) - Right outer join allows users to select rows that match from the both the
left and right tables, plus all the rows from right table (table 2). This means that only those rows from table
1 that intersect with table 2. appear in the result set
Visual Illustration
SQL Right Outer Join returns the records from table 2 and only those records from table 1 that intersect
with table2.
Option Description
Join Type Enables selection of an appropriate Join type out of Inner Join, Left Outer Join and
Right Outer Join.
Example: Inner Join tab is highlighted in the image above.
<Table Name> Field Displays the name of the field that is common between tables i.e. the foreign key
name in the second table.
Example: "Products" Field contains the 'Category ID' field in the image above.
Related Table Displays the name of the table to which the relationship has been set up.
Example: 'Categories' table is listed in the image above.
Related Table's Field Displays the name of the field from the table to which the relationship has been set
up.
Example: 'Category ID' is the field from the Categories tables listed in the image
above.
Delete Icon adjacent to the Related Table's Field to delete the currently added relation.
Add Relation Button that allows users to add another relationship to the table.
Cancel Closes the Tables relations window.
OK Saves the relationship between tables as a SQL query in the SQL tab.
Go to Top
Create a Query
Visual Query Designer provides you with an interface to reference multiple tables, set up relationships, sort the
data and add parameters to your query.
Follow the steps below to create a query like the following using the Visual Query Designer.
Query Result in SQL
SQL Query
select Products.ProductName, Products.UnitPrice, Categories.CategoryName
from Products inner join Categories on Products.CategoryID = Categories.CategoryID
where Categories.CategoryName = ?
order by Products.UnitPrice desc
7. In the Selected Fields panel, go to the UnitPrice field and set the Sort option to descending. This sorts the
data in descending order on UnitPrice.
8. On the Toolbar of the Visual Query Designer, click the Execute button. A Parameters dialog appears on
the screen.
9. Enter any parameter value, for example, Produce in the dialog box and click OK.
Save a Query
1. Once your query is created in Visual Query Designer, go to the Toolbar in the Query Tools section of the
Visual Query Designer.
2. Click the button. Your query appears in the Query field of the Query page in the DataSet
dialog.
Note: On clicking the Save button, your query is automatically validated by the Visual Query
Designer.
OR
Open the report in the Viewer to view the report with the Parameters panel displayed in the sidebar. See
Using the Viewer for further information.
Note:
You cannot save or open code-based Section reports in ActiveReports Server.
You must be connected to ActiveReports Server to access Open from server or Save to server
dialogs. For more details, see Connecting to ActiveReports Server.
The Open report from server dialog consists of the following elements:
Elements Description
Elements Description
URL Enter the server URL (Uniform Resource Locator) to access the reports saved on ActiveReports
Server. The server URL is specified as "http://<ServerName>:<PortNumber>/" where the
ServerName is the name of the machine on which ActiveReports Server is installed and
PortNumber is the port on IIS where the server is installed. Example: http:\\1.x.x.x:8080\
Username Enter the username to access reports on ActiveReports Server.
Password Enter the password to login to ActiveReports Server.
Connect Connects ActiveReports Designer to ActiveReports Server.
Connection Displays the connection status information.
Status
Breadcrumb Indicates the current location in the category folder hierarchy. Example: \\ActiveTunes\Invoice,
where Invoice is the sub-category of ActiveTunes folder.
Refresh Allows users to refresh the list of reports on ActiveReports Server.
Up one Allows users to move up by one folder level.
level
Name Displays a list of report names, categories, and sub categories which are stored on ActiveReports
Server. For more details, see Report Categories.
Revision Displays the most recent revision number of the report.
Modification Displays the date when the report was last updated.
Date
Modified By Displays the name of the author who recently modified the report.
Comment Displays the most recent revision comment entered by the user while saving the report.
Report Allows users to enter a name for the report to be saved on ActiveReports Server.
Name
Description Allows users to type a short description about their report.
Note: In the following steps, Open from server and Save to server options are accessed using the File menu of the
Stand-alone Designer. However, you can also access these dialogs from the Report menu of the Visual Studio designer.
See Accessing Save and Open from Server Options for details.
2. In the Open report from server dialog that appears, type the Server URL (Uniform Resource Locator).
3. Enter the Username and Password and then click the Connect button for connecting the ActiveReports Designer
to ActiveReports Server. Check the Connection status to make sure you are connected to the server.
4. In the Choose a report section, double-click to navigate through the categories or sub categories folder and then select
the report that you want to open.
2. In the Open report revision dialog that appears, select any revision of the report that you want to work on and click
the Open button.
2. In the Save report to server dialog that appears, type the Server URL (Uniform Resource Locator).
3. Enter the Username and Password and then click the Connect button for connecting the ActiveReports Designer
to ActiveReports Server. Check the Connection status to make sure you are connected to the server.
4. In the Choose a report section, double-click to navigate through the categories or sub categories folders and
then select a location where you want save the report.
5. Enter the Report name and add a brief description of the report in the Description section. Entering the Report name
and Description is only required when saving the report for the first time on ActiveReports Server. When modifying a
report that is already on ActiveReports Server, the Report name and Description fields are already filled in.
6. In the Comment section, enter a revision comment to explain the type of changes made to the report. See Report
Versions for further information.
7. Click the Save button to save the report under the selected category on ActiveReports Server.
Interactive Features
ActiveReports supports features like parameters, filters, drill-down, links, document map and sorting to provide an
interactive look to your report at run-time.
Parameters
ActiveReports allows you to set parameters in your report to filter the data displayed. Parameters make navigation
of the report easier for the user at runtime. See Parameters for further details.
Filters
The filtering feature is only available with page layout reports. By using filters in your page report or RDL report
you can limit the information you want to display on your report. See Filtering for further details.
Drill-Down Reports
When you open a report with drill-down features, part of the data is hidden so that you only see high-level data
until you request more detail. See Drill-Down Reports for more information.
Document Map
The Document Map (Table of Contents) feature allows you to navigate to a particular item in a report. See
Document Map for further details.
Sorting
The sorting feature allows you to organize your data and present it in a logical order at run-time. Using this
feature you can sort the data alphabetically or numerically in ascending or descending order. See Sorting for
further details.
Note: You cannot use the interactive features in the following cases:
With Adobe Acrobat Reader and RawHTML types of the WebViewer.
With reports that use the collation feature, i.e. reports that have two or more themes.
With the ViewerType of WebViewer control set to FlashViewer, you can only use hyperlinks and
document map interactive features.
Annotations
The annotations feature allows you to add floating text bars or images to call attention to specific items or values
or to add notes and special instructions directly to the reports. These annotations are accessible through the
Annotation button present on the Viewer toolbar which is hidden by default. Annotations added via the viewer's
toolbar are temporary and are destroyed when the report closes. See Annotations for further details.
Parameters
ActiveReports allows you to use parameters to filter or add the data to display in reports at runtime. You can either prompt users for parameters so that they control the output, or supply
the parameters behind the scenes.
OracleDB :ParameterName SELECT * FROM Customer WHERE CustomerID = :CustomerID AND AccountNumber = :AccountNumber
However, if you would like to do it manually, you must enter each parameter in three locations: the Report Parameters dialog (for filtering data at run time), the Parameters page of the
DataSet dialog, and the Query page of the DataSet dialog.
Report - Parameters dialog
The Report - Parameters dialog allows you to control how and whether a user interface is presented to your users for each parameter. You have to set the following properties in the dialog
to create a parameter:
Enter a report parameter name. Each report parameter in the collection must have a unique name, and the name must match the name you call in the Parameters page of the
DataSet dialog. In the example above, the name is MPAA.
Set the data type, the text used to prompt the user, whether to allow null, blank, multiple values or multiline text, and whether to hide the user interface.
Select the default value or populate a list of available values from which users can choose.
Parameter values are collected in the order they appear in the Report Parameters collection. You can change the order using the arrows in the Report - Parameters dialog.
General Tab
Name: Set the name for the parameter in this field. The value you supply here appears in the parameters list and must match the corresponding query parameter.
Data type: Set the data type for your parameter which must match the data type of the field that it filters. The interface presented might also differ depending on the data type.
Note: In the Available Values tab , the Value is what is passed to the query parameter, and the Label is what is shown to the user. For example, if the Value is an Employee
Number, you might want to supply a more user-friendly Label showing Employee Names.
If you want to run a report without prompting the user for a value at runtime, you need to set a default value for each parameter and the Hidden check box should be selected in the
Report - Parameters dialog, General tab.
Subreport parameters are also considered as hidden parameters as a user can easily synchronize a subreport's data with that of the parent report . See Subreports in RDL Reports for
further details.
Drill-Through parameters are also hidden parameters as drill-through links are used to navigate from one report to another. When you select Jump to report for the action, the
parameters list is enabled.
Section Report
In section report, you can use the Parameters collection to pass values directly into a control at runtime, or you can also use it to display a subset of data in a particular instance of a
report.
There are several ways for setting up parameters in a report:
You can enter syntax like the following in your SQL query to filter the data displayed in a report at runtime:
<%Name | PromptString | DefaultValue | DataType | PromptUser%>
You can add parameters through the Report Explorer and place them on the report as TextBox controls to pass values in them at runtime.
You can also add parameters through the code behind the report, inside the ReportStart event. See Add Parameters for more information.
Prompting for Parameter Values
In order to prompt the user for parameter values, all of the following must be in place:
At least one parameter should exist in the Parameters collection of the report.
The PromptUser property for at least one parameter must be set to True.
On the report object, the ShowParameterUI property must be set to True.
When there are parameters in the collection and the ShowParameterUI property is set to True, the user prompt automatically displays when the report is run. When the user enters the
requested values and clicks the OK button, the report gets displayed using the specified values.
Values of a parameter added through the Report Explorer can be applied to a parameter in the SQL query by specifying the param: prefix for a parameter in the SQL query. This prefix
relates the current parameter to the one in the Report Explorer.
For e.g., select * from CUSTOMERS where CustomerName = '<%param:Parameter1%>'. In this case, the parameter with the param: prefix in the SQL query is updated with values of the
corresponding parameter in the Report Explorer.
Note: Within the same report, you can prompt users for some parameters and not for others by setting the PromptUser property to True on some and False on others. However,
if the report object's ShowParameterUI property is set to False, the user prompt does not display for any parameters regardless of its PromptUser setting.
SQL Query.
SELECT * FROM Products
INNER JOIN Categories ON Products.CategoryID = Categories.CategoryID
You can also create a parameterized query from the Visual Query Desinger. See Query Building With Visual Query Designer for further information on how to create a parameterized query
using the interactive query designer.
There are five values in the parameter syntax, separated by the pipe character: |
Only the first value (Name) is required, but if you do not specify the third value (DefaultValue), the field list is not populated at design time. You can provide only the Name value and no
pipes, or if you wish to provide some, but not all of the values, simply provide pipes with no space between them for the missing values. For example, <%ProductID||||False%>
Name: This is the unique name of the parameter, and corresponds to the Key property in parameters entered via code.
PromptString: This string is displayed in the user prompt to let the user know what sort of value to enter.
DefaultValue: Providing a default value to use for the parameter allows ActiveReports to populate the bound fields list while you are designing your report, enabling you to drag fields
onto the report. It also populates the user prompt so that the user can simply click the OK button to accept the default value.
DataType: This value, which defaults to S for string, tells ActiveReports what type of data the parameter represents. It also dictates the type of control used in the user prompt. The type
can be one of three values.
S (string) provides a textbox into which the user can enter the string.
Depending on your data source, you may need to put apostrophes (single quotes) or quotation marks around the parameter syntax for string values.
For example, '<%MyStringParameter%>'
Also, if you provide a default value for a string parameter that is enclosed in apostrophes or quotation marks, ActiveReports sends the apostrophes or quotation marks along
with the string to SQL.
For example, <%MyStringParameter||"DefaultValue"|S|False%>
D (date) provides a drop-down calendar control from which the user can select a date.
Depending on your data source, you may need to put number signs around the parameter syntax.
For example, #<%MyDateParameter%>#
B (Boolean) provides a checkbox which the user can select or clear.
If you provide a default value of True or False, or 0 or 1 for a Boolean parameter, ActiveReports sends it to SQL in that format.
Note: With Microsoft Access databases, the values for Boolean parameters are specified as -1 (true) or 0 (false).
PromptUser: This Boolean allows you to tell ActiveReports whether to prompt the user for a value. This can be set to True for some parameters and False for others. If you set the
report's ShowParameterUI property to False, users are not prompted for any parameters, regardless of the PromptUser value set for any parameter in the report.
Filtering
In page layout, ActiveReports allows you to set filters on a large set of data that has already been retrieved from
the data source and use them with datasets or data regions to limit the information you want to display on your
report.
Although not as efficient performance-wise as query parameters which filter data at the source, there are still
scenarios which demand filters. The obvious case is when the data source does not support query parameters.
Another case for using filters is when users who require different sets of data view the same report.
You can set filters on a Filters page or a tab similar to the one in the following image.
Filtering Operators
Filter Description
Drill-Down Reports
The drill-down feature helps in temporarily hiding a part of your report. That hidden part can be controls, groups,
columns or rows. When you open a drill-down report, part of the data is hidden so that you can only see high-level
data until you request for more detail. In such reports you find an expand icon (plus-sign image) next to the
toggle item in the report. Clicking the toggle image, or plus sign, expands hidden content into view and the
expand icon changes to a collapse icon (minus-sign). When you click the minus-sign image, it hides the content
and returns the report to its previous state.
To create a drill-down report, use the Visibility properties of controls, groups, columns, or rows. Simply set the
Visibility-hidden property to True and set the toggle item to the name of another item in the report, usually a text
box in the group containing the hidden item. At run time, this puts a plus sign next to the toggle item which the
user can click to display the hidden data.
If you export a drill-down report or render it through rendering extensions, any content which is hidden at the time
of export remains hidden in the exported file. If you want all of the content to appear in the exported file, you
must first expand all hidden data.
Only when you render a report using the XML using the XmlRenderingExtension ('XmlRenderingExtension
Class' in the on-line documentation), all hidden data is exported regardless of whether it is hidden at the time
of export.
Linking in Reports
You can enhance the interactivity in your report by adding different types of links to it. ActiveReports provides the
ability to add bookmarks, hyperlinks, drill-through links to reports.
Hyperlinks
Hyperlinks take you to a web page that opens in the default browser of the system. You can set hyperlinks in the
Textbox and Image controls to access a Web page from your report. See Add Hyperlinks for further information.
Hyperlinks are displayed when you preview a page report or a RDL report in the Viewer, export a report in HTML ,
PDF, RTF and Excel formats. You can also see hyperlinks in Word, HTML and PDF formats when you render reports
using rendering extensions.
Bookmarks
A bookmark link is similar to a hyperlink, except that it moves the viewer to another area in the report instead of
linking to a web page. You can create these links on a control using a Bookmark ID that connects to another target
control. See Adding Bookmarks for further information.
Bookmarks are displayed when you preview a page report/RDL report in the Viewer or render a report through
rendering extensions in Word, HTML and PDF formats.
Note: While rendering a report to HTML, drill-through links are broken unless the target report is also
exported to the same directory with the same name as the original.
Section Layout
Hyperlinks
Hyperlinks take you to a web page that opens in the default browser of the system. You can set the HyperLink
property available with the Label, Textbox, Picture and OleObject controls that allow you to add hyperlinks that
connect to a Web page. You can also use the HyperLink property to open an e-mail or jump to a bookmark. See
Add Hyperlinks for further details.
Hyperlinks are supported when you preview a section report in the Viewer, export a report in HTML , PDF, RTF and
Excel formats.
Bookmarks
Bookmark links take you to a location where the bookmark is set on your report. Unlike hyperlinks, these links
take you within the report. Bookmarks and nested bookmarks appear in the document map for fields, groups and
subreports. You can also add special bookmarks at run-time. You can use hyperlinks for simulating a drill through
like feature similar to Page Layout. See Add Bookmarks for further details.
Bookmarks are supported when you preview a section report in the Viewer, export a report in HTML and PDF
formats.
Note: When you export a report to HTML, a*.TOC file is created in the folder where you export the report.
Use this file to reach the bookmarked locations.
Document Map
When you click an item in the document map, the viewer jumps to that item in the report.
A document map functions as a table of contents for a page report or a RDL report and as a bookmarks panel for a
Section Reports
In a section report, when you add a bookmark on any control it appears in the document map while viewing the
report. In order to navigate to a bookmark you need to open the document map and click that bookmark.
See Add Bookmarks for more information.
2. At the bottom of the sidebar pane, click the Document map button to display the document map.
If there is no document map associated with the report, the button does not appear at the bottom of the
sidebar pane.
3. In the Document map that appears, click the item you want to view in the report.
Note: You can also access the Document map from the Toggle sidebar button on the preview tab toolbar.
In a page report or a RDL report, if you use rendering extensions to export your report, the document map is not
available in any rendering type except PDF where it appears in the bookmarks panel.
Note: For printing and rendering purposes use TableOfContents control in your page report and RDL report.
Sorting
Interactive Sorting
You can add interactive sorting on a TextBox control to allow users to sort columns of data within a data region on
a published report.
The interactive sorting feature is set through the Interactive Sort page which available in the TextBox dialog.
Once you set interactive sorting on a TextBox control, while viewing the report in the Viewer or in the Preview Tab
the textbox control displays a sort icon inside it. A user can sort data that appears inside the textbox in ascending
or descending order by clicking the icons.
On the Interactive Sort page of the TextBox dialog you can find following fields available for entering values:
Sort Expression: An expression specifying the sort value for data contained in the column.
Data region or group to sort: Select the grouping level or data region within the report to sort. The
default value is Current scope, but you may also choose an alternate data region or grouping.
Evaluate sort expression in this scope: Select the grouping level within the report on which to
evaluate an aggregate sorting expression. The default value is Current scope, but you may also choose
an alternate data region or grouping.
See Allow Users to Sort Data in the Viewer for more information.
Annotations
Annotations are floating text bars or images to call attention to specific items or values or to add notes and special
instructions directly to the reports. Annotations added via the viewer's toolbar are temporary and are destroyed
when the report closes.
These annotations are accessible through the Annotation button present on the Viewer toolbar which is hidden by
default. You can make the Annotations toolbar visible by setting the AnnotationToolbarVisible Property (on-
line documentation) to True in the viewer's properties window.
Available Annotations
Each annotation type allows you to change the colors, transparency, border, font, and alignment, plus other
properties specific to the type of annotation. Available annotations include:
3. Run the report application and select the annotation you want use from the Annotation toolbar on the
Viewer.
4. Drag the annotation to the desired location on the report design surface. The annotation appears with a
Delete and a Properties button on the top left corner.
5. Inside the annotation, click the Properties button to view its properties in the Properties Window and use
those properties to enter text, change color or transparency, set border or font, alignment etc.
6. Close the Properties Window to apply changes to the annotation.
7. Drag the corners to resize the annotation as needed. You can also select entire annotation to move it to
another location on the report.
8. Right-click the annotation to display the annotation context menu. The context menu includes
the Properties and Delete commands.
Note: You can print a page, RDL or section report that contains annotations. In a section report, you can also
save a report with annotations in RDF format. See Add and Save Annotations for further details.
Text Justification
The TextJustify Property (on-line documentation) of a Textbox control provides you justification options for
aligning your text within a control. It is important that the TextAlign property (Alignment property in a Section
Report) must be set to Justify' for TextJustify property to affect the text layout.
Note: In section layout, the TextJustify property is also available in the Label control.
You can choose from the following values of the TextJustify property:
Auto
Results in Standard MSWord like justification where space at the end of a line is spread across other words in that
line. This is the default value.
Distribute
Spaces individual characters within a word, except for the last line.
DistributeAllLines
Spaces individual characters within words and also justifies the last line according to the length of others lines.
Note: In edit mode, scrollbars appear automatically to fit multiline content within a control. However, these
are not displayed in the preview tab, so you may need to adjust the Size property of the control to display all
of the text.
Section Report
TextBox
Label
Note: You can also set the CharacterSpacing and LineSpacing property directly in the Properties Window.
Line and character spacing is supported when you preview a report in the Viewer, print a report or export a section
report in HTML , PDF and TIFF formats.
In page reports and RDL reports, it is also supported while rendering a report through rendering extensions in
Word, HTML, PDF and Image formats. See Rendering Extensions for further information on rendering extensions.
ToolStrip
TheToolStrip contains the following ToolStripItems by index number.
0 Toggle sidebar
1 Separator
2 Print
3 Galley mode
4 Separator
5 Copy
6 Find
7 Separator
8 Zoom out
9 Zoom In
10 Current Zoom
11 Separator
12 Fit width
13 Fit page
14 Separator
15 Single page
16 Continuous mode
17 Multipage mode
18 Separator
19 First page
20 Previous page
21 Current
22 Next page
23 Last page
24 Separator
25 History back
26 History forward
27 Separator
28 Back to parent
29 Separator
ToolStrip Implementation
When you add a new item to a ToolStrip, you need to add an ItemClicked event handler and an ItemClicked event
for the ToolStrip with the new item. At run time, when a user clicks the new ToolStrip item, they raise the
ItemClicked event of the ToolStrip containing the item
Add the event handler to the Load event of the Form that contains the Viewer control, and use the IntelliSense
Generate Method Stub feature to create the related event. For examples of the code to create an event hander,
see the Customize the Viewer Control topic, and the Custom Preview sample that is located in
...\Documents\GrapeCity Samples\ActiveReports 9\Section Reports\C#\CustomPreview.
Note: You cannot host the ActiveReports Designer control in the Web application and Web site project types.
You can use other text formatting properties in combination with the ShrinkToFit property.
Caution: When both CanGrow and ShrinkToFit are set to True, CanGrow setting is ignored and only
ShrinkToFit is applied to the report.
Stand-alone designer
Stand-alone viewer refers to the GrapeCity.ActiveReports.Viewer.exe application installed with ActiveReports. This
is a Windows Forms application with an ActiveReports Viewer control and a menu bar.
You can open a .rdlx or .rpx report in the stand-alone viewer application, by going to the File menu > Open menu
option and selecting a report to load in the viewer.
This application is compiled with the basic code to load reports. Please note that any additional features activated
through code like the annotation toolbar, are not available in the stand-alone viewer application. See Using the
Viewer for more information on how to implement these features in the Viewer control.
This application is compiled with the basic code to load reports. Please note that features like customizing
the toolbar through code, are not implemented in the stand-alone WPF Viewer application. See Using the WPF
Viewer for more information on how to implement these features in the Viewer control.
Localization
ActiveReports uses the Hub and Spoke model for localizing resources. The hub is the main executing assembly and
the spokes are the satellite DLLs that contain localized resources for the application.
For example, if you want to localize the Viewer Control, the hub is GrapeCity.ActiveReports.Viewer.Win.v9.dll and
the spoke is GrapeCity.ActiveReports.Viewer.Win.v9.resources.dll.
In your Program Files folder, the Localization folder is in a path like ....\GrapeCity\ActiveReports
9\Localization, and contains all of the ActiveReports components that you can localize.
There are 16 ActiveReports components in the Localization folder and most have two files.
A .bat file that is used to set the Cultures to which you want to localize. (The Flash viewer does not have
Note: Before you can distribute or put your localization in the Global Assembly Cache (GAC), you must first
send the localized GrapeCity.ActiveReports.AssemblyName.v9.resources.dll file to GrapeCity support and get
it signed with a strong name. Once you receive the signed DLL file, you can drag the language subfolder with
the signed DLL file into C:\WINDOWS\ASSEMBLY, or distribute it with your solution.
When the main executing assembly needs a resource, it uses a ResourceManager object to load the required
resource. The ResourceManager uses the thread's CurrentUICulture property.
The common language runtime sets the CurrentUICulture property or you can set it in code to force a certain UI
Culture so that you can test whether your satellite DLL is loading properly. The ResourceManager class uses the
CurrentUICulture property to locate subdirectories that contain a satellite DLL for the current culture. If no
subdirectory exists, the ResourceManager uses the resource that is embedded in the assembly. US English ("en-
US") is the default culture for ActiveReports.
Tip: For more detailed information about how the Framework locates satellite DLLs, please refer to the help
system in Visual Studio® or the book Developing International Software, 2nd edition by MS Press that
contains information on localizing applications using the .NET Framework.
Cultures
For your convenience, here is a list of predefined System.Globalization cultures. (Source: MSDN.) For
ActiveReports localization purposes, use the Culture and Language Name value in the first column.
Summary
Accessibility Summary:
All major features of ActiveReports software are accessible via keyboard navigation.
DISCLAIMER:
GRAPECITY MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. The following information
reflects the general accessibility features of GrapeCity software components as related to the Section 508
standards. If you find that the information is not accurate, or if you have specific accessibility needs that our
products do not meet, please contact us and we will attempt to rectify the problem, although we cannot guarantee
that we will be able to do so in every case.
Performance Criteria
Section 1194.31
How To
Learn to perform common tasks with ActiveReports with quick how-to topics.
2. In the Report Data Source dialog that appears, select the General page and enter the name of the data
source. By default, the data source name is set to Data Source1. This name appears as a child node to the
Data Sources node in the Report Explorer.
3. Under Type, select the type of data source you want to use.
4. Under Connection, enter a Connection String. If you select SQL, OleDB, or Oracle as the data source Type
value, Connection Properties, Connection String and Advanced Settings pages appear under Connection.
See Report Data Source Dialog for further details.
Note: When you select an XML Provider under Type, the connection string must include XmlDoc or
XmlData. Use of TransformationDoc is optional. See details of each of these connection string types
below:
Connection String
XmlDoc: Refers to a specific XML file located on either the file system or at a web-
accessible location. For example, XmlDoc=C:\MyXmlFile.xml;
XmlData: Provides specific XML data in the Connection String itself. For example,
XmlData=<people>
5. Click the Validate Data Source icon to confirm the connection string. This icon becomes inactive to
indicate success, while an error message indicates an invalid connection string.
6. On the Credentials page, you can specify password, credentials, or Windows authentication.
7. Click the OK button on the lower right corner to close the dialog. You have successfully connected the
report to a data source.
In ActiveReports, you can connect to most data sources with these steps. However, you need to follow the
instructions below to connect to a Shared Data Source.
Connect to a Shared Data Source
1. In the Report Explorer, right-click the Data Sources node and select the Add Data Source option or select
Data Source from the Add button.
2. In the Report Data Source dialog that appears, select the General page and enter the name of the data
source. This name appears as a child node to the Data Sources node in the Report Explorer.
3. Check the Shared Reference checkbox on.
4. Under Reference, click the Browse button and from the Shared Data Source File dialog that appears, go to
the folder where your shared data source file is located and select it. A file path appears in the field
adjacent to the Browse button.
5. Click the OK button on the lower right corner to close the dialog. A shared data source node appears in the
Report Explorer.
Add a Dataset
In a page report or a RDL report, once you connect your report to a data source, in order to get a list of fields to
use in the report, you need to add a dataset. Use the following instructions to add a dataset to the report.
These steps assume that you have already added a Page Report/RDL Report template and connected it to a data
source. See Adding an ActiveReport to a Project and Connect to a Data Source for further information.
1. In the Report Explorer, right-click the data source node (DataSource1 by default) and select the Add Data
Set option or select Data Set... from the Add button.
Text - Allows the user to enter a SQL query or XML path in the Query box. See Visual Query
Designer for further information on how to create a query using the interactive query designer.
StoredProcedure - Allows the user to enter the name of the stored procedure in the Query
box.
TableDirect - Allows the user to enter the name of the table in the Query box.
4. Click the Validate DataSet icon at the top right hand corner above the Query box to validate the query.
5. The fields are automatically added to the Fields page in the DataSet dialog. For XML data, manually enter
fields on the Fields page using valid XPath expressions.
6. You can also set parameters, filters, and data options on the other pages of the dialog.
7. Click the OK button to close the dialog. Your data set and queried fields appear as nodes in the Report
Explorer.
Note: In case you are using an XML data source provider, you have to provide an XML path on the Query
page and generate fields using XPath expressions on the Fields page of the DataSet dialog. See the following
example for details.
Query and Field settings for XML Data
The XML provider supports the use of XPath 1.0 in building queries and selecting Fields. Following is an
example of how the query string and fields are set with an XMLData connection string.
Connection String
Example of an XmlData connection string.
XmlData=<people>
<person>
<name>
<given>John</given>
<family>Doe</family>
</name>
</person>
<person>
<name>
<given>Jane</given>
<family>Smith</family>
</name>
</person>
</people>;
Query String
Set the query like /people/person/name
Fields
Once the query is set, build the Fields collection with two fields that contain the following name and value
pairs:
Name: Given; Value: given
Name: Family; Value: family
See Use Fields in Reports to understand fields further.
4. In the Report Data Source dialog that appears, go to the General page and set the following properties
to create a connection to an OleDb data source.
Name: Any Name
Type: Microsoft OleDB Provider
Under Connection, go to the Connection Properties tab and set:
OLE DB Provider: Microsoft.Jet.OLEDB.4.0
Server or file Name: Your .mdb file location
5. In the Report Data Source dialog, click the OK button to close the dialog. A data source node appears in
the Report Explorer.
6. In the Report Explorer, right-click the data source and select Share Data Source.
7. In the Save Shared Data Source File dialog that appears, enter the file name and click the Save button
to save the file in RDSX format. Notice that the data source icon changes to show sharing.
2. In the Report Data Source dialog that appears, edit the data connection information.
Note: You can use the code example below for the SQL, Odbc, OleDB or Oracle data source binding. To do
that, modify the Data Provider Type and Connection String according to the data source.
1. From the Visual Studio toolbox, drag and drop a Table data region onto the design surface of the report.
Note: Ambiguity can occur if a field and a relation have the same name. This is not supported.
End Class
Note: The DataSetDataSource sample provides context on how to create the DataLayer class, used
in the code below. The DataSetDataSource sample is included in the ActiveReports installation and is
located in the [UserDocumentFolder]\GrapeCity Samples\ActiveReports 9\Page Reports\RDL\API
folder.
12. Double-click the title bar of the Windows Form to create an event-handling method for the Form_Load
Visual Basic.NET code. Paste INSIDE the class declaration of the form.
Dim WithEvents runtime As GrapeCity.ActiveReports.Document.PageDocument
'ActiveReports raises this event when it cannot locate a report's data source in
the usual ways.
Private Sub runtime_LocateDataSource(ByVal sender As Object, ByVal args As
GrapeCity.ActiveReports.LocateDataSourceEventArgs) Handles
Runtime.LocateDataSource
Dim dl = New DataLayer
args.Data = dl.DataSetData.Tables("Products")
End Sub
{
System.IO.FileInfo rptPath = new
System.IO.FileInfo("..\\..\\YourReportName.rdlx");
//Create a report definition that loads an existing report.
GrapeCity.ActiveReports.PageReport definition = new
GrapeCity.ActiveReports.PageReport(rptPath);
//Load the report definition into a new page document.
GrapeCity.ActiveReports.Document.PageDocument runtime = new
GrapeCity.ActiveReports.Document.PageDocument(definition);
//Attach the runtime to an event. This line of code creates the event shell
below.
runtime.LocateDataSource += new
GrapeCity.ActiveReports.LocateDataSourceEventHandler(runtime_LocateDataSource);
viewer1.LoadDocument(runtime);
}
//ActiveReports raises this event when it cannot locate a report's data source in
the usual ways.
private void runtime_LocateDataSource(object sender,
GrapeCity.ActiveReports.LocateDataSourceEventArgs args)
{
Object Provider
Use the API to bind a report data source to a collection of objects. To bind the Object provider to a report, set up
a report definition and a page document, and attach the page document to a LocateDataSourceEventHandler.
Create a public class which sets up a property name to which the data field can bind.
The Object provider data source must have a dataset with the Query left blank and fields that correspond to the
fields of your Object provider data source. Add these fields manually in the DataSet Dialog under Fields.
When using the Object provider, always leave the report's ConnectionString blank because it uses the
LocateDataSource event to bind to an Object. Set the Query to one of these values:
To use the Object Provider
These steps assume that you have already added a Page Report template and placed a Viewer control on a
Windows Form in your Visual Studio project. See Adding an ActiveReport to a Project and Using the Viewer for
further information.
1. In the Report Explorer, go to the DataSources node and right-click to select Add Data Source.
2. In the Report Data Source dialog that appears, set Type to ObjectProvider and close the dialog. A data
source node appears in the ReportExplorer.
3. Right-click the data source node and in the DataSet dialog that appears select the Fields page.
4. In the Fields page, add a field like =Fields!name.Value and click ok to close the dialog. A node with the
field name appears under the dataset name.
5. From the Visual Studio toolbox ActiveReports 9 Page Report tab, drag a Table data region onto the design
surface of the report.
6. From the ReportExplorer, add the newly added field onto a cell in the detail row of the Table.
7. Save the report as DogReport.rdlx.
8. In the Solution Explorer, right-click the Form and select View Code to open the Code View.
9. In the Code View of the form, paste the following code inside the class declaration.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the class declaration of the form.
' Create a class from which to call a property.
Public Class dog
Private _name As String
Public Property name() As String
Get
Return _name
End Get
Set(ByVal value As String)
_name = Value
End Set
End Property
End Class
' Create an array to contain the data.
Dim dogArray As System.Collections.ArrayList
' Create a method to populate the data array.
Private Sub LoadData()
dogArray = New System.Collections.ArrayList()
Dim dog1 As New dog()
dog1.name = "border collie"
dogArray.Add(dog1)
dog1 = New dog()
dog1.name = "cocker spaniel"
dogArray.Add(dog1)
dog1 = New dog()
dog1.name = "golden retriever"
dogArray.Add(dog1)
dog1 = New dog()
dog1.name = "shar pei"
10. Set up the report and add a handler for the LocateDataSource event.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the Form_Load event.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
' Create file info with a path to the report in your project.
Dim fi As New System.IO.FileInfo("..\\..\\DogReport.rdlx")
' Create a report definition using the file info.
Dim repDef As New GrapeCity.ActiveReports.PageReport(fi)
' Create a page document using the report definition.
Dim runt As New GrapeCity.ActiveReports.Document.PageDocument(repDef)
' Create a LocateDataSource event for the runtime.
AddHandler runt.LocateDataSource, AddressOf runt_LocateDataSource
' Display the report in the viewer. The title can be any text.
Viewer1.LoadDocument(runt)
End Sub
11. Use the LocateDataSource event to load data from the object.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the class declaration of the form.
Private Sub runt_LocateDataSource(ByVal sender As Object, ByVal args As
GrapeCity.ActiveReports.LocateDataSourceEventArgs)
If dogArray Is Nothing Then LoadData()
args.Data = dogArray
End Sub
Note: This topic uses the Movie table in the Reels database. By default, the Reels.mdb file is located in
[User Documents folder]\GrapeCity Samples\ActiveReports 9\Data folder.
Note: A default group name like FixedPage1_Group appears under Name, once you set the group. To
modify the group name, add a field name or expression under Group on to enable the Name option
and enter a new name.
3. Under the Document map label field, you can optionally set a label to add the item to the document map.
4. Click OK to close the dialog.
5. Drag and drop a data region, like a Table onto the design surface and set data inside its cells.
6. Go to the Preview Tab to view the result. You'll notice that the data appears in groups sorted according
the YearReleased field on each report page.
Note: This topic uses examples from the Movie table in the Reels database. By default, in ActiveReports, the
Reels.mdb file is located at [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data\Reels.mdb.
Note: A default group name like Table1_Group1 appears under Name, until you set the grouping
expression under Group On, after which you can modify the group name.
5. Under the Document map label, you can optionally set a label to add the item to the document map.
See Document Map for further information.
6. Under Parent group, you can optionally set the parent group for a recursive hierarchy.
7. Click OK to close the dialog. Group header and group footer rows appear right above and below the table
details row.
8. Drag and drop fields onto the Table data region and in the group header row, add the field on which the
grouping is set.
9. Preview the report to see the result.
Tip: You can sort, filter, set page breaks or repeat headers for your grouped data in the other tabs of the
Table-Groups dialog.
Note: A default group name like Table1_Detail_Group1 appears under Name, until you set the
grouping expression under Group On, after which you can modify the group name.
4. Under the Document map label, you can optionally set a label to add the item to the document map.
See Document Map for further information.
5. Under Parent group, you can optionally set the parent group for a recursive hierarchy.
6. Click OK to close the dialog.
7. Drag and drop fields onto the Table data region and go to the preview tab to see grouped data.
Tip: You can filter, set page breaks or set visibility for your grouped data in the other tabs of the Table-
Detail Grouping page.
Note: A default group name like List1_Detail_Group appears under Name, until you set the grouping
expression under Group On, after which you can modify the group name.
4. Under the Document map label field, you can optionally set a label to add the item to the document map.
See Document Map for further information.
5. Under the Parent group field, you can optionally set the parent group for a recursive hierarchy.
6. Click OK to close the dialog.
7. Drag and drop fields or other data regions onto the List data region and go to the preview tab to see
grouped data.
Tip: You can place lists within lists to create nested grouping. You can also filter, set page breaks or set
sorting for your grouped data in the other tabs of the List-Detail Grouping page.
Note: A default group name like BandedList1_Group1 appears under Name, until you set the
grouping expression under Group On, after which you can modify the group name.
4. Under the Document map label field, you can optionally set a label to add the item to the document map.
See Document Map for further information.
5. Under Parent group you can set the parent group for a recursive hierarchy.
6. Click the OK to close the dialog.
7. Drag and drop fields onto the BandedList data region and go to the preview tab to see grouped data.
3. From the Report Explorer, drag and drop a field onto the aggregate detail cell of the matrix data region.
To manually group a matrix using dynamic columns and rows
1. From the Visual Studio toolbox, drag and drop a Matrix data region onto the design surface.
2. Right-click a row or column header and choose Insert Group. This adds a new cell below the original
column header or to the right of the original row header.
3. In the Matrix - Column Groups or Row Groups dialog that appears, under Group on enter an
expression on which you want to group the data. For e.g., =Fields!YearReleased.Value.
Note: A default group name like Matrix1_RowGroup1 or Matrix1_ColumnGroup1 appears under Name, until
you set the grouping expression under Group On, after which you can modify the group name.
5. In the Chart Data dialog, go to the Series Groups page and click the Add button to add a new group.
6. Enter an expression under Group on on which you want to group your series data. For e.g.,
=Fields!Country.Value.
Note: A default group name like Chart1_CategoryGroup1 or Chart1_SeriesGroup1 appear under Name, until
you set the grouping expression under Group On, after which you can modify the group name.
Note: This topic uses examples from the SalesByGenre table in the Reels database. By default, in
ActiveReports, the Reels.mdb file is located in the [User Documents folder]\GrapeCity Samples\ActiveReports
9\Data folder.
1. From the toolbox, drag a Table data region onto the report design surface.
2. With the table selected, set the following:
Set the DataSetName property (For example, SalesByGenre).
Right-click the table handle to the left of the Detail row and select Insert Row Below or Insert
Row Above from the menu and add another detail row to the table.
Hover your mouse over the first Textbox located in the Detail row column to make the Field
Selection Adorner appear. Click this adorner to display a list of available fields from the data set,
select a field (For example, GenreName).
Note: This automatically places an expression in the detail row and simultaneously places a
static label Genre Name in the header row of the same column.
3. From the toolbox, drag a Sparkline control to the second detail row of the table on your report and set the
following in the Properties Window.
Set the SparklineType property to Line (by default).
Set the DataSetName property to a data set (For example, SalesByGenre).
Set the SeriesValue property by selecting <Expression...>. In the Expression Editor under
Fields, expand the Fields (SalesByGenre) node and select a numeric field from the connected
data set (for example, =Fields!Profit.Value). Click the OK button to accept the change.
Set the LineColor property to Gray.
Set the MarkerColor property to Blue.
4. To apply the detail grouping to the sparkline, right-click the Table data region and go to Properties Window
to select the Properties dialog command at the bottom.
5. In the Table dialog that appears, select the Detail Grouping.
6. In the General tab, under Group on, select an expression from the drop-down list on which to group the
data (for example, =Fields!GenreName.Value).
Setting Filters
Normally you can filter your data using parameters in a query, but if your data source does not support
parameters you can use filters. You can set filters on the following:
DataSet
Data Region
Groups in a Data Region
In a Page Report, you can also set filters on the page through the FixedPage dialog.
Use the following steps to create filters in a page report and RDL report. These steps assume that you have
already added a Page Report/RDL Report template and have a data connection and a dataset in place. See Adding
an ActiveReport to a Project, Connect to a Data Source and Add a Dataset for more information.
Set filters on a DataSet
When you set a filter on a dataset, any control you add to the design surface can utilize this filtered data.
1. In the Report Explorer, right-click the DataSet node and select Edit.
2. In the DataSet dialog that appears, select the Filters page and click the Add (+) icon to add a new filter for
the data set. By default, an empty filter expression gets added to the filter list.
3. Under Expression, enter an expression or use the Expression Editor to provide the expression on which to
filter data. For example, =Fields!YearReleased.Value
4. Under Operator, select an operator from the list to decide how to compare the Expression with the Value.
For example, set a GreaterThan operator on the Expression above. See Filtering for a list of available
operators and their description.
5. Under Value, enter a value or set an expression using the Expression Editor with which to compare the
expression results. For example, 2000 to represent the year 2000.
The resultant filter looks like the following.
=Fields!YearReleased.Value > 2000
2. In the data region dialog that appears, select the Filters page and click the Add (+) icon to add a new filter
for the data region. By default, an empty filter expression gets added to the filter list.
3. Under Expression, enter an expression or use the Expression Editor to provide the expression on which to
filter data. For example, =Fields!UserRating.Value
4. Under Operator, select an operator from the list to decide how to compare the Expression with the Value.
For example, set a LessThan operator on the Expression above. See Filtering for a list of available operators
and their description.
5. Under Value, enter a value or set an expression using the Expression Editor with which to compare the
expression results. For example, 6 to represent the Rating 6.
The resultant filter looks like the following.
=Fields!UserRating.Value < 6
3. In the Table dialog, go to the Groups tab and select the Group.
4. After selecting the group, go to the Filters tab and click the Add (+) icon to add a new filter. By default, an
empty filter expression gets added to the filter list.
5. Under Expression, enter an expression or use the Expression Editor to provide the expression on which to
filter data. For example, =Fields!YearReleased.Value
6. Under Operator, select an operator from the list to decide how to compare the Expression with the Value.
For example, GreaterThan operator set on the Expression above. See Filtering for a list of available
operators and their description.
7. Under Value, enter a value or set an expression using the Expression Editor with which to compare the
expression results. For example, 2000 to represent the year 2000.
The resultant filter looks like the following.
=Fields!YearReleased.Value > 2000
Caution: The Size of an OverflowPlaceHolder cannot be changed to a value which is less than the Size of a
data region it is linked with.
Create a Map
The Map data region shows your business data against a geographical background. This topic illustrates how to
create a Map and modify its appearance.
These steps assume that you have added a page layout template to your project and have a data connection in
place. See Adding an ActiveReport to a Project and Connect to a Data Source for further information.
To add a map to the report
1. From the Visual Studio toolbox, drag a Map control onto the design surface.
2. In the Select a Map Template wizard that appears, select a map template from the following options:
3. On the Visibility page of the dialog, you can setup the visibility mode of the map.
4. On the Appearance page of the dialog, you can make modifications to the border width, style, color and
background color.
5. On the Data Output page of the dialog, choose from Auto, Yes or No to decide whether to include this
map in the XML output. Also, if you choose to include this map in the XML output, then in Element Name,
enter a name to be used in the XML output for this map. Choosing Auto will include the map in the XML
output.
6. Click OK to close the dialog.
To add a legend to the map
A legend on a map provides valuable information to users for interpreting the map data visualization rules such as
color, size, and marker type differences for map elements on a layer. By default, a single Legend item already
exists in the legends collection which can be used by all layers to display items. You can also create additional
legends to use them individually with layers that have associated rules to display items in the legend. Use these
steps to learn adding and setting a legend on a map:
1. On the design surface, select the Map control.
2. In the Properties window, click the Legends (Collection) property and then click the ellipsis (...)
button that appears.
3. In the LegendDesigner Collection Editor that appears, click Add under the Members list of
legends. Legend1 with the default legend settings appears in the Members list.
4. With Legend1 selected in the Members list of legends, you can make modifications to its font, border and
background color settings.
5. Click OK to close the dialog.
Note: You can associate the newly added legend to a layer by specifying its name in the Legend
Name field that appears in the Legend tab on a specific rule page of a Layer dialog. See, Use Color
Rule, Marker Rule and Size Rule for more information.
4. In the Properties Window, you can modify the text, font, border and the background color settings of
the map title.
5. Click OK to close the dialog.
To set the distance scale
A distance scale helps a user to understand the scale of the map. Distance on a map is not the same as the actual
real-world distance, so a distance scale shows that a certain distance on the map equals a certain distance in a
real-world. In distance scale, the distance is displayed in both miles and kilometers. The scale range and values
are automatically calculated using the viewport boundaries, projection type, and zoom level. Use these steps to
learn setting a distance scale on a map:
1. On the design surface, select the Map control.
2. In the Properties window, click the DistanceScale property and then click the ellipsis (...) button that
appears.
3. In the Map Distance Scale dialog that appears, on the General page, you can set the location and the
color of the distance scale.
4. On the Appearance page of the dialog, you can make modifications to the border width, style, color and
background color.
5. On the Font page of the dialog, you can make modifications to the font properties of the distance scale.
6. On the Visibility page of the dialog, you can setup the visibility mode of the distance scale.
7. On the Navigation page of the dialog, you can setup the interactivity features for the distance scale.
8. Click OK to close the dialog.
To set the color scale
A color scale helps a user to understand the range of colors that are used for data visualization on a layer. A map
has just one color scale and multiple layers can provide data for it. Use these steps to learn setting a color scale on
a map.
1. On the design surface, select the Map control.
2. In the Properties window, click the ColorScale property and then click the ellipsis (...) button that appears.
3. In the Map Color Scale dialog that appears, on the General page, you can set the location and the color
of the color scale.
4. On the Labels page of the dialog, you can make modifications to the properties of the color scale labels.
5. On the Title page of the dialog, you can make modifications to title text and font properties of the color
scale.
6. On to the Appearance page, you can make modifications to the border width, style, color and background
color.
7. On the Font page, you can make modifications to the font properties of the color scale.
8. On the Visibility page, you can setup the visibility mode of the color scale.
9. On the Navigation page, you can setup the interactivity features for the color scale.
10. Click OK to close the dialog.
To modify the appearance of the Viewport
Viewport refers to the area on the map where map data is displayed against a geographical background. It
specifies the coordinates, projection system, parallels and meridians, center point, and scale of the map. In other
words, it is a map element that actually display geographical data and occupies most area of the map control
depending on the location and dock position of other map elements. See Map for more information.
You can modify Viewport properties to make the map look more attractive.
1. On the design surface, select the Map control.
2. Go to the Properties window, click the Viewport property and then click the ellipsis (...) button that
appears.
3. In the Map Viewport dialog that appears, on the General page, choose the Coordinate system. The
map viewport supports the following two coordinate system:
Geographic: Specifies Earth coordinates by defining longitude and latitude values. If you set the
CoordinateSystem property to Geographic, then you must specify the Projection property. A
projection is a set of rules on how to locate three-dimensional objects onto a planar surface.
Planar: Specifies geometric coordinates on a two-dimensional surface by using X and Y
values. and in case you set it to Geographic then set the Projection.
4. Go to the Meridians page, set its visibility and its line and font style and color.
5. Similarly, go to the Parallels page, set its visibility and its line and font style and color.
6. On the View page of the dialog, choose a Center and Zoom mode. The map viewport supports the
following four center and zoom modes:
Note: Zoom and View Center level can also be set from the design surface using the zoom slider and
arrow keys that appears in the View Pane of the Map control.
7. On the Appearance page, set the Border and Background style and color of the viewport.
8. Click OK to close the dialog.
Spatial Data
Spatial data is a set of coordinates that defines a map element. Each map layer must have spatial data of one of
the following types - a polygon, a line, or a point.
Spatial data can be either embedded in a map or can be linked to a map layer. The only difference between the
two is that while having the spatial data embedded in a map, there is no separate file to locate or to keep track of
when you move the report between projects or machines.
Embedded Spatial Data:
Embedded spatial data can refer to the following:
Embedded ESRI shapefile or dataset: When you use the Embedded option in Map Layer
Data Properties dialog or the From ESRI file option in the Map Wizard to import spatial data
from an ESRI shapefile, the ESRI shapefile gets embedded in the Map. Similarly, if a report
dataset is been used to provide spatial data to a map layer, you always have an option of
embedding that spatial data in the map using the Embed Spatial Data option that appears in
the layers pane. See, Use Layers to learn embedding spatial data to a map.
Custom data: When you add an empty layer to a map and enter spatial data manually in the
LayerDesigner Collection Editor, the data entered gets embedded to the map automatically.
External Spatial Data:
External spatial data can refer to the following:
Remote or Local ESRI shapefile: When you use the Linked option in Map Layer Data
Properties dialog or use the File property in the Properties Window to specify the local or
remote path/location of an ESRI shapefile, the ESRI shapefile gets linked to the Map layer.
However, it remains an external source as the dependent ESRI shapefile needs to moved
along with the report between projects or machines.
Report Dataset: When you use a report dataset to provide spatial data to a map layer and
you don't embed the spatial data, it remains an external source. This requires the
dependent database file to moved along with the report between projects or machines.
ActiveReports provide numerous ways to add spatial data to the map. You can either use the Map Wizard
and add data from an ESRI shapefile or use the Map Layer Data Properties dialog for using advance options.
You can also add spatial data from the Properties Window.
To add spatial data using Map Wizard
1. From the Visual Studio toolbox, drag and drop a Map control onto the design surface.
2. In the Select a Map Template wizard that appears, select From ESRI file.
3. In the Open dialog that appears, navigate to the folder that contains the .shp and .dbf files, select the .shp
file, use the Map Resolution slider to simplify vector data and click Open.
This option automatically imports the spatial data stored in the shapefile and adds a related layer to the map
Embedded : Use this option where you want to add spatial data from an ESRI file along with an
additional option of adding custom spatial data fields if required.
To add Spatial data from an ESRI file using the Embedded option
1. In the Map Layer Data Properties dialog, on the General page, select the Embedded
option and click the Browse button.
2. In the Open dialog that appears, navigate to the folder that contains the .shp and .dbf files.
3. Select the .shp file, use the Map Resolution slider to simplify vector data and click Open. The
fields list gets populated with spatial data fields that are added from the shapefile.
4. In Dataset, set the name of the dataset.
5. In the Fields list, click the Add (+) button to add a new empty spatial data field.
6. With the newly added spatial data field selected in the list, in Field name, enter the name of
the field.
7. In Field type, set the field type of newly added spatial data field.
8. Click OK to close the dialog.
Note : In order to apply the new spatial data field on a layer, you must provide its value for
each map layer element like polygons, points or lines in the added map layer Designer
Collection Editor dialog.
Linked : Use this option when you just want to add spatial data from an ESRI shapefile without any
additional modifications or additions .
To add Spatial data from an ESRI file using the Linked option
1. In the Map Layer Data Properties dialog, on the General page, select the Linked option
and click the Browse button.
2. In the Open dialog that appears, navigate to the folder that contains the .shp and .dbf files.
3. Select the .shp file and click Open.
4. Click OK to close the dialog.
Dataset : Use this option when you have a dataset that stores a spatial data field to provide spatial
data to the Map. You can directly use the data fields from the dataset to display data on a map layer
without setting the match fields for analytical data. Therefore, it also provides you an
additional option of having different dataset for analytical data and spatial data respectively.
To add Spatial data from a Dataset
1. In the Map Layer Data Properties dialog, on the General page, select the Dataset option.
2. In Dataset, set the name of the dataset.
3. In Field name, enter the data field name that contains the spatial data.
Caution: Simply type the name of the dataset field that contains spatial data. For
example, enter value as StateName, not as =[StateName].
Note : Once the Analytical data has been set, the Analytical option on the General page
of the Map Layer Data Properties dialog becomes active.
2. In the Map Layer Data Properties dialog, on the General page, select the Analytical
option.
3. In Field name, enter the data field name that contains the spatial data.
Caution: In Field name, enter the data field name as =[StateName], not
as StateName.
3. In Type, choose the spatial data source of the layer from the following supported options:
Embedded: Use this option when you want to add custom spatial data to the map data
layer. This can be done by first adding the spatial data fields for the embedded spatial data using
the MapFieldDefinitionDesigner Collection Editor which can be accessed through the
FieldDefinitions property. And then later adding spatial data (points, polygons or lines) using
the PolygonDesigner Collection Editor, PointsDesigner Collection Editor or LineDesigner Collection
Editor depending on the layer in use. These Editor dialogs can be accessed using the
SpatialData > Polygons, SpatialData > Points or SpatialData > Lines property.
File: Use this option when you want to add spatial data from an ESRI file. Use the
Source property to specify the location of the shapefile.
Note: The specified location must contain the shape format (.shp) and attribute format
(.dbf) files.
DataSet: Use this option when you have a dataset that stores a spatial data field to provide
spatial data to the Map. This option is equivalent to the DataSet option in the Map Layer Data
Properties dialog. Use the SpatialData > DataSetName property to specify the name of the
dataset and the SpatialData > SpatialField property to specify the data field that contains
spatial data.
DataRegion: Use this option when you have a dataset that stores a spatial data field to provide
spatial data to the Map. This option is equivalent to the Analytical option in the Map Layer
Data Properties dialog. Use the LayerData > DataSetName property to specify the name of
the dataset and the SpatialData > VectorData property to specify the data field or
expression that contains spatial data.
4. Click OK to close the dialog.
Analytical Data
Analytical data is the data that you want to visualize on the map, for example, tourist attractions in a city or
product sales by region. For analytical data, you can associate it with map elements by indicating match fields in
the Match box of the Map Layer Data Properties dialog. You can use one or more fields in the Match box of the
Map Layer Data Properties dialog; for each spatial data field you must indicate a unique analytical data field.
This data is optional.
You can get analytical data from the following types of data sources.
Dataset field: A field from a dataset.
Spatial data source field: A field from the spatial data source. For example, you can often find that an
ESRI Shapefile contains both spatial and analytical data. Field names from the spatial data source are
marked with the # sign in the drop-down list of fields.
Embedded data for a map element: After you embed polygons, lines, or points in a report, you can
select the data fields for map elements and define custom values.
To add Analytical Data to the Map control
Use the following steps to add analytical data to the map. These steps assume that you have added a page layout
template to your report and have a data connection in place. See Adding an ActiveReport to a Project and Connect
to a Data Source for further information.
1. Add spatial data to the map control. See the dropdown sections above to learn adding spatial data to the
map control.
2. In the Map Layer Data Properties dialog, go to the Analytical data page.
3. Select the dataset that you want to use from the Dataset dropdown list and click the Add (+) button
located next to the Match field. This creates an empty match field expression and enables the Spatial and
Analytical field properties.
4. In the Spatial field and Analytical field options set data fields that contain same data in both Spatial and
Analytical databases. This builds the match field expression and relates analytical data to map elements on
a map layer.
Note: It is necessary to set match fields if you want to use a spatial data field from analytical data, or
if you want to visualize analytical data on the map layer. Match fields enable the report processor to
build a relationship between the analytical data and the spatial data.
Use Layers
1. On the design surface, with the Map control selected, go to the Properties window.
2. In the Properties Window, click the Layers (Collection) property and then click the ellipsis button that
appears.
3. In the LayerDesigner Collection Editor that appears, under the members list, select the map layer you
want to reorder and use the up or down arrow to change the rendering order of each layer.
4. Click OK to close the Collection Editor.
11. In the General page of the dialog, select any data field from the Label Text combo box to display as
labels inside polygons at runtime.
12. Go to the Color Rule page of the dialog, to set rules to visualize data using color pallets, color ranges or
custom colors for polygons or polygon center points that gets displayed on the map or keep it set to the
default "Use Appearance settings". See, Use Color Rule, Marker Rule and Size Rule for more information.
13. Go to the Visibility page of the dialog and make sure the layer visibility is set to Show. You can also select
options to show or hide layer based on any expression or zoom value.
14. In the Navigation page of the dialog, you can optionally link the polygon to a URL, bookmark or a report.
15. The Appearance page of the dialog either reflects the default appearance of the polygons or the color rule
settings if any.
16. In the Font page of the dialog, you can optionally set the font family, size, weight, style, set and color for
the label text that you had set in the General page of the dialog.
17. Go to the Data Output page and specify the Data Element Name of the layer to be used while rendering to
XML and also specify whether the layer should be included in output while rendering or not.
18. Click OK to close the dialog and go to the preview tab to view the map.
12. In the General page of the dialog, select any data field from the Label Text dropdown list to display as
label for each point that gets displayed on the map at runtime. You can also set the label placement, size
and marker type.
13. Go to the Marker Rule page to set rules to visualize data using markers or keep it set to "Use default
marker type".
14. Go to the Size Rule page to set rules to visualize data using different marker sizes or keep it set to "Use
default marker size". See, Use Color Rule, Marker Rule and Size Rule for more information.
15. Go to the Color Rule page to set rules to visualize data using color pallets, color ranges or custom colors
for markers that gets displayed on the map or keep it set to "Use Appearance settings".
16. Go to the Visibility page of the dialog and make sure the layer visibility is set to Show. You can also select
options to show or hide layer based on any expression or zoom value.
17. In the Navigation page of the dialog, you can optionally link the layer to a URL, bookmark or a report.
18. The Appearance page of the dialog either reflects the default appearance of the polygons or the color rule
settings if any.
19. In the Font page of the dialog, you can optionally set the font family, size, weight, style, set and color for
the label text that you had set in the General page of the dialog.
20. Go to the Data Output page and specify the Data Element Name of the layer to be used while rendering to
XML and also specify whether the layer should be included in output while rendering or not.
21. Click OK to close the dialog and go to the preview tab to view the map.
12. In the General page of the dialog, select any data field from the Label Text dropdown list to display as
label for each line that gets displayed on the map at runtime. You can also set the label placement.
13. Go to the Color Rule page to set rules to visualize data using color pallets, color ranges or custom colors
for lines that gets displayed on the map or keep it set to "Use Appearance settings". See, Use Color Rule,
Marker Rule and Size Rule for more information.
14. Go to the Size Rule page to set rules to visualize data using line width or keep it set to the default line
width.
15. Go to the Visibility page of the dialog and make sure the layer visibility is set to Show. You can also select
options to show or hide layer based on any expression or zoom value.
16. In the Navigation page of the dialog, you can optionally link the layer to a URL, bookmark or a report.
17. Go to the Appearance page of the dialog and set the style, width and color of the layer border and the
layer background.
18. In the Font page of the dialog, you can optionally set the font family, size, weight, style, set and color for
the label text that you had set in the General page of the dialog.
19. Go to the Data Output page and specify the Data Element Name of the layer to be used while rendering to
XML and also specify whether the layer should be included in output while rendering or not.
20. Click OK to close the dialog and go to the preview tab to view the map.
5. In the Map Tile Properties dialog that appears, on the General page, set the layer name and choose its
Source and Type. The default values in these fields also work fine.
6. In the Provider property, choose one from the following supported tile providers:
Bing: The Microsoft Bing Map server offers static map images. This requires an Application key
for authentication. The default key provided by ActiveReports is for demo purpose and can't be
used by 3rd party applications. In order to obtain a Bing Map Key, see HowTo - Create a Bing
Map Account and HowTo - Get a Bing Map Key.
Note: After generating the key, add the following script in
the Grapecity.ActiveReports.config file to configure embedded Bing tile provider with
Application key.
Script
Paste inside the <Configuration></Configuration> tags.
<MapTileServerConfiguration>
<Timeout>5</Timeout>
<AppID>"Your Application Key"</AppID>
</MapTileServerConfiguration>
Google: The Google Map server creates your map tiles based on URL parameters sent through a
standard HTTP request that returns the map tiles as an image.
CloudMade: The CloudMade tile server allows you to access it through the HTTP Tile API. The
URL structure for this API is straightforward, and is instantly recognizable to anyone familiar with
the OpenStreetMap tile numbering convention. To use a CloudMade Tile server you require an
API key for authentication which can be obtained by registering at CloudMade.
Note: After generating the key, add the following script in
the Grapecity.ActiveReports.config file to configure embedded CloudMade tile provider with
ApiKey.
Script
Paste inside the <Configuration></Configuration> tags.
<!-- Configure embedded CloudMade tile provider with ApiKey -->
<MapTileProvider Name="CloudMade" DisplayName="CloudMade Tiles
Provider">
<Settings>
<add key="ApiKey" value="API Key" />
</Settings>
</MapTileProvider>
MapQuest: The MapQuest tile server provides the tiles in a format similar to Google. This tile
server requires an API Key for authentication which can be obtained by registering at MapQuest.
Note: After generating the key, add the following script in
the Grapecity.ActiveReports.config file to configure embedded MapQuest tile provider with
OpenStreetMap: The OpenStreetMap server provides the tiles in an index based format. This
tile server provides only the roadmap and returns fixed size images (256x256). Before using the
OpenStreetMap server, go through the Copyright and License and Tile usage policy pages.
7. Go to the Visibility page of the dialog and make sure the layer visibility is set to Show. You can also select
options to show or hide layer based on any expression or zoom value.
8. Click OK to close the dialog and go to the preview tab to view the map.
Note
If you are using proxy server connection to see the map tile images, you need to set credentials for the proxy
server in the application config file for authentication. To use your default proxy server credentials, you can
do the following:
For Visual Studio Designer (IDE)
1. Find devenv.exe.config (the devenv.exe configuration file) in: ProgramFiles(x86)\Microsoft Visual
Studio 12.0\Common7\IDE
2. In the configuration file, find the <system.net> block, and add this code:
Paste inside the <system.net></system.net> tags.
<defaultProxy useDefaultCredentials="true" />
Note: Grapecity.ActiveReports.config file should be kept inside the project Debug folder and added to a
Visual Studio project for displaying a Tile layer on a Map in any Viewer control.
End Namespace
3. Add a new Class to the project and name the class, for example, MyMapTile. Replace the existing code with the following in the MyMapTile class to implement
the IMapTile interface.
To write the code in Visual Basic.NET
4. Add another Class to the project and name the class, for example, WebRequestHelper. Replace the existing code with the following in the
WebRequestHelper class to implement the loading of raw website data into the System.IO.MemoryStream class.
To write the code in Visual Basic.NET
VB code. Paste on TOP
Imports System.IO
5. Save and build your class library project and locate the new .dll file in its Bin>Debug folder. This file has the same name as your class library project, with a .dll
extension.
6. Create a Basic End User Designer in a new solution following the steps in Creating a Basic End User Designer.
7. Run your Basic End User Designer project to create a EndUserDesigner.exe in your projects Bin>Debug folder.
8. Copy the Grapecity.ActiveReports.config file from the C:\Program Files\Common Files\GrapeCity\ActiveReports 9\ location and paste it into your End User
Designer project's Bin>Debug folder.
Caution: Grapecity.ActiveReports.config file should always be placed inside the same folder as the EndUserDesigner.exe file for displaying a tile layer on a
Map.
9. Right-click on the Grapecity.ActiveReports.config file and select Include in this Project to make changes in the config file.
10. Double-click to open the Grapecity.ActiveReports.config file and paste the following code between the <Configuration> and </Configuration> tags:
Paste between the <Configuration></Configuration> tags.
<!-- Register and configure custom tile provider. -->
<MapTileProvider Name="Custom" DisplayName="Custom Provider" type="YourTileProvider, AssemblyName, Version = x.x.x.x">
<Settings>
<add key="ApiKey" value="API Key" />
</Settings>
</MapTileProvider>
Note: Replace YourTileProvider with fully qualified class name and AssemblyName with the name of the assembly created after implementing
IMapTileProvider and IMapTile interfaces.
11. Add the Class Library project created in step 5 to your Basic End User Designer project.
12. Copy the YourProjectName.dll created in step 5 and paste it to the current project's Bin>Debug folder together with the EndUserDesigner.exe.
13. Save and Run the project.
14. Create a Report containing a Map control in the Basic End User Designer. See Reports with Map for more information.
15. Add a Tile layer to the Map control. Right click the Tile layer and select Edit to view the custom tile provider added in the Provider drop-down. See Use a Tile
Layer for more information.
1.
1. Color Rule
Color Rule is set to fill colors for map elements like polygons, markers (points or polygon center points)
and lines while using a Polygon, Point or Line layer.
Color Rule provides four options:
a. Apply Appearance Settings : Use the default appearance settings that are set in the Appearance
page of the map layer dialog.
b. Visualize data by using color palette : This option uses an in-built palette that you specify.
Based on related analytical data, each map element is assigned a different color from the palette.
c. Visualize data by using color ranges : This option, combined with the start, middle, and end
colors that you specify on this page and the options that you specify on the Distribution page, divide
the related analytical data into ranges. The report then assigns the appropriate color to each map
element based on its associated data and the range that it falls into. For example, in a map which
uses color to display temperatures on a scale of 0 to 100, low values are blue to represent cold and
high values are red to represent hot.
d. Visualize data by using custom colors : This option uses the list of custom colors that you
specify. Based on related analytical data, each map element is assigned a color from the list.
3. Size Rule
Size Rule is set on markers, polygon center points or line width while using a Polygon, Point or a Line layer.
Size Rule support two options:
a. Use a default marker size or Use a default line width : You specify the marker size or line
width in points.
b. Visualize data by using size or Visualize data by using line width : In this option, you set the
minimum (start) and maximum (end) sizes or width for marker or line, specify the data field to
be used for varying the marker size or line width and then specify the distribution options to apply
to that data.
Distribution Options
The distribution values are used by the rules to differ the map element display values.
To create a distribution of values, you divide your data into ranges by specifying the distribution method, the
number of sub-ranges, and the range start and end values.
To set distribution values for rules
1. Click the Map until the map panes appear.
2. In the layers pane, right click on the added map layer and select Edit to open the selected map layer
dialog.
To add items to the Document Map using Label Property or Document Map Labels
By setting the Label property or Document Map Label of the controls in your page report/RDL report, you
can show a hierarchical structure based on the parent - child relationship between the controls in the Document
Map. For example, set the Label property or Document Map Label of a List data region and a TextBox control
and then place the TextBox control inside the List data region. When you view the Document Map, the TextBox
label appears nested inside the List data region label, thereby displaying a hierarchical structure. Similarly, if you
set a Document map label on multiple Groups of a data region, they appear nested below each other in the
document map displaying the same hierarchy in which they were set.
These steps assume that you have already set the Label property or Document Map Label of the controls that
your report contains. See, Add Items to the Document Map for more information.
1. In the Report Explorer, right-click the control and select Report Properties...
2. In the Report Properties dialog that appears, go to the Document Map page.
3. In the Document Map page, set Source to Labels Only and optionally select the Numbering Style from
the dropdown list.
Tip: You can also set Source to Labels and Headings to include both labels and headings in
the Document Map.
Note: You can also set various numbering styles for all levels or individual level by setting the
Numbering Style for document map levels using the Report dialog or using the DocumentMap
property that gets directly applied to the ToC control. For more information see Add Items to the
Document Map.
Note: In the query above TableName refers to the table you want to get from the
database. FieldNames and N refer to the fields you want to fetch from the table and the number of
3. Click the Validate DataSet icon at the top right hand corner above the Query box to validate the query
and then click OK to close the dialog.
4. In the Report Explorer, expand the DataSet node and drag and drop fields onto the design surface. In an
Page report, you need to place these fields inside a data region.
5. Go to the Preview tab and view the result. You'll notice only N number of records displaying in your report.
The following image is an example of a Top N Report displaying top 10 movie records:
Note: In the expression above, FieldName refers to field that the textbox contains. For example, if a
textbox contains the Rollup field, the expression looks like:
=iif(Fields!Rollup.Value < 0, "Red", "Black")
Set its Best Value property to 500 and the Worst Value property to 0. The Best Value and
Worst Value properties define the value range on the graph.
You can also optionally encode the segments on the graph as qualitative ranges indicating bad,
satisfactory and good sections.
The Range1Boundary property defines a value for the bad/satisfactory boundary on
the graph. Set this property to 150.
The Range2Boundary property defines a value for the satisfactory/good boundary on
the graph. Set this property to 300.
You can also optionally define the Interval property for the graph value range. So, set this
property to 100.
4. Go to the Preview tab to view the bullet graph you have added to your report.
As the bullet graph is based on aggregated data, you get a stack of bullet graphs indicating the Sales
Amount value for different customers.
Note: These steps use the AccountsChartData table from the Reels database. The sample Reels.mdb
database file is located in the [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data folder.
1. From the Visual Studio toolbox, drag a Sparkline control onto the design surface.
2. With the sparkline selected on the design surface, go to the properties window and:
Set the Sparkline Type property to Whiskers.
Set the SeriesValue property to a numeric field (like =Fields!RollUp.Value) from the
connected data set.
Set the FillStyle/FillColor property to Red.
3. Go to the Preview tab to view the whisker sparkline.
Add Parameters
You can add parameters to a page report/RDL report to allow users to select the data to display, or to use in
creating drill-through reports.
To add a parameter
1. In the Report Explorer, right-click the Parameters node and select Add Parameter. The Report
Parameters dialog appears.
2. On the General tab of the dialog, set the name, data type and prompt text for the parameter. For
example:
Name: MPAA
Data type: String
Text for prompting users for a value: Enter value
Select out of the checkbox options to allow null values, multivalues, blank value, multiline values or set
hidden parameters.
3. On the Available Values tab, you can select From query populate a list from the data set from which
users can select a value. Alternatively, you can select Non-queried to enter your own values.
4. On the Default Values tab, you can provide default values to use if the user does not select a value. This is
useful when you are creating a hidden parameter.
5. Click OK to save the parameter. The new parameter appears in the Report Explorer under the Parameters
node.
6. From the Report Explorer, drag the parameter to report design surface to create a TextBox that is bound to
the parameter. When you run the report, the value that the user supplies in the prompt dialog displays in
the bound TextBox on the report.
For a step by step description of adding parameters in different scenarios look at the following pages:
Create an ALL Parameter
Learn how to create a multi-value parameter with an ALL value.
Add a Cascading Parameter
Learn how to create cascading parameters where one parameter value is dependent on the selection of another.
Note: This topic uses the Producers and Movie table from the Reels database. By default, in ActiveReports, the Reels.mdb file is located at [User Documents folder]\GrapeCity
Samples\ActiveReports 9\Data\Reels.mdb.
4. Click the OK button on the lower right corner to close the dialog and see the dataset and the selected fields appear in the Report Explorer.
To add a Report Parameter
1. In the Report Explorer, right-click the Parameters node and select Add Parameter.
2. In the Report - Parameters dialog that appears, add a name for the parameter (i.e. ProdID) and ensure that the Data type matches that of the field (i.e. Integer for ProductionID).
3. Enter Text for prompting users for a value.
4. Select the check box next to Multivalue to allow users to select more than one item from the list.
3. On the Query page, enter a SQL query like the following in the Query text box:
SELECT Movie.Title, Movie.YearReleased, Movie.UserRating, Producers.Name
FROM Producers INNER JOIN (Movie INNER JOIN MovieProducers ON Movie.MovieID = MovieProducers.MovieID) ON Producers.ProductionID = MovieProducers.ProductionID
WHERE (MovieProducers.ProductionID IN (?)) OR (-1 IN (?))
ORDER BY MovieProducers.ProductionID, Movie.YearReleased
4. Click the Validate DataSet icon to validate the query and to populate the Fields list.
5. Click the OK button on the lower right corner to close the dialog and see the dataset and the selected fields appear in the Report Explorer.
Place a control like a Table onto the design surface and add fields to it. View the report in the preview tab and see the Parameters in the sidebar with an ALL option at the top.
Note: In a page report, when you have multiple datasets in the report, you need to set the DataSet property on the General tab of the FixedPage dialog in order to specify which
dataset is used to display data in the report.
Note: This topic uses the Reels database. By default, in ActiveReports, the Reels.mdb file is located at [User
Documents folder]\GrapeCity Samples\ActiveReports 9\Data\Reels.mdb.
2. On the Query page of the DataSet Dialog, use the following SQL Query to fetch data from the Regions
table.
SELECT RegionID, Region FROM Regions
3. Click OK to close the Regions DataSet dialog.
4. Follow step 1 to create another dataset named Districts and on the Parameters page of the DataSet Dialog,
click the Add(+) icon to add a parameter named Region with the value set to:
=Parameters!Region.Value
This parameter is added to the Report Parameters collection later.
5. In the Districts dataset dialog, on the Query page, add the following SQL query to fetch data from the
Districts table. This query depends on the Region parameter.
SELECT DistrictID, District FROM Districts WHERE Region = ?
6. Click OK to close the Districts DataSet dialog.
7. Follow step 1 and create another dataset named StoreNames and on the Parameters page of the DataSet
Dialog, click the Add(+) icon to add a parameter named DistrictID with the value set to:
=Parameters!DistrictID.Value
This parameter is added to the Report Parameters collection later.
8. In the StoreNames dataset, on the Query page, add the following SQL query to retrieve data for the
selected region from the selected district. This query depends on the DistrictID parameter.
SELECT StoreID, StoreName, OpenDate FROM Store WHERE NOT StoreID = 0 AND DistrictID = ?
9. Click OK to close the StoreNames DataSet dialog.
10. In the Report Explorer, right-click the Parameters node and select Add Parameter
11. In the Report - Parameters dialog that appears, add a parameter named Region with an Integer data
type. On the Available Values tab, select From query and set the dataset to Regions, the value field to
RegionID, and the label field to Region.
12. Click OK to close the Report - Parameters dialog.
13. Follow the same process as steps 10 and 11 to add a second parameter named DistrictID with an Integer
data type. On the Available Values tab, select From query and set the dataset to Districts, DistrictID for
the value field, and District for the label field.
14. From the Visual Studio toolbox, drag and drop a Table data region (or any other data region) onto the
design surface, and drag the StoreID, StoreName and OpenDate fields onto the table details row.
15. Click the Preview Tab to view the result.
Notice that the two drop down lists, for regions and districts appear in the Parameters sidebar while the second
drop down list remains disabled until a region is selected. Click the View Report button to see the StoreID,
Note: In a Page Report, when you have multiple datasets in the report, you need to set the DataSet
property on the General tab of the FixedPage dialog in order to specify which dataset is used to display data
in the report.
Note: This topic uses the DVDStock table in the Reels database. By default, in ActiveReports, the Reels.mdb
file is located at [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data folder.
1. In the Report Explorer, right-click the Parameters node and select Add Parameter.
2. In the Report - Parameters dialog that appears, add a parameter named StorePrice with an Integer data
type. Click the checkbox next to Hidden to hide the parameter UI at runtime.
3. On the Default Values tab, select Non-queried and click the Add(+) icon to add an empty expression for
the value.
4. In the Value field enter 5 and click OK to close the Report - Parameters dialog.
Note: When adding multiple default values, in the Report - Parameters dialog, General tab, check the
Multivalue check box, otherwise the report collects only the first default value from the list and uses
it to generate the report.
5. In the Report Explorer, right-click Data Source (DataSource1 by default) node and select Add Data Set to
create a dataset.
6. In the DataSet Dialog that appears, on the Parameters page, click the Add(+) icon to add an empty
expression for the parameter.
7. In the Name field, enter the same parameter name (StorePrice) you had added in the steps above and set
its value to:
=Parameters!StorePrice.Value
8. On the Query page of the DataSet Dialog, use the following SQL query to fetch data from the DvDStock
table.
SELECT * FROM DvDStock WHERE StorePrice IN (?).
9. From the Visual Studio toolbox, drag and drop a Table data region (or any other data region) onto the
design surface, and from the Report Explorer, drag the Title, StorePrice and In Stock fields onto the
table details row.
10. Click the Preview Tab to view the result.
Notice that the report collects the required parameter value from the default value (i.e. 5) and uses it to display
the list of Movie DVDs with Store Price $5.
Set Up Collation
You can add multiple themes to the report. In this case, the report renders a combination of multiple outputs for
each theme. For example, if a report has two themes, then the report output includes a combination of the first
and the second themes, applied to each report page. You can control the combination rules of the report output in
the CollateBy ('CollateBy Property' in the on-line documentation) property.
Caution: If you are using collation in a report, you cannot use interactive features, such as drill down, links,
document map, and sorting.
You can control the page order of a rendered report with multiple themes by selecting the collation mode in the
CollateBy ('CollateBy Property' in the on-line documentation) property of the report:
Note: The collection of constant expressions must be the same in all themes of a report. See Use Constant
Expressions in a Theme for further information.
1. In the Designer, click the gray area around the report page to select the report.
2. In the Properties Window, go to the CollateBy ('CollateBy Property' in the on-line documentation)
property and select one of the available options:
Simple. Renders report pages without any specific sorting. For example, if you have a report
with 2 themes, the report renders all pages with theme 1, then all pages with theme 2.
ValueIndex. Sorts report pages by page number. For example, if you have a report with 2
themes, the report renders page 1 for theme 1 and 2, then page 2 for theme 1 and 2, and so on.
Value. Sorts report pages by the grouping expression that you specify in the report's FixedPage
dialog. For example, if you have a report with 2 themes with grouping, the report renders group1
(pages 1 and 2 of theme1, then pages 1 and 2 of theme2), then group 2 (pages 1 and 2 of
theme1, then pages 1 and 2 of theme2), and so on.
Note: In RDL Reports, the Value collation mode is not available by design.
See Add Page Numbering for information on setting cumulative page count formats for Page Report.
Add Hyperlinks
In a page report or a RDL report, you can set hyperlinks in the TextBox or Image controls to access a Web page
from your report. You can also set hyperlinks on Map layer data elements. These hyperlinks open in the default
browser of the system.
Add Bookmarks
A bookmark link is similar to a hyperlink, except that it moves the viewer to another area in the report instead
of opening a web page. You can add bookmarks in a two-step process:
Identify the place (target control) where you want to allow a user to jump to with the help of a
Bookmark ID.
Tip: You can also set the Bookmark ID through the Bookmark property in the Properties window.
You move to the top of the page where the Bookmark ID was set on the control.
Tip: You can also access the Navigation page of a control to set the bookmark link through the ellipsis
button next to the Action property in the Properties window.
In a RDL report, you can create a master report that you apply to any number of content reports to keep common
styles in one easy-to-maintain location. See Master Reports for more information.
Property Description
Location To position the control with respect to the top left corner of the container.
Size To set the control size for determining the space available to design a content
report.
Text To add instructive text for the user. E.g. "Design your content report here". This
caption appears in the design view and not the final output.
5. With the report selected, go to the Report menu > Save Layout.
6. In the Save As dialog that appears, navigate to the location where you want to save the report and click
Sort Data
In a page report and a RDL report, you can apply sorting on a data region, grouped data or fixed page.
Use the following steps to determine how to sort your data. These steps assume that you have already added a
Page Report (xml-based)/RDL Report template to your project and connected it to a data source. See Adding an
ActiveReport to a Project, Connect to a Data Source and Add a Dataset for more information.
Sorting in a Data Region
You can set the sorting expression on the Sorting page of a data region dialog.
1. Right-click the data region and select Properties to open the Properties window. Select the Property dialog
link under properties where the commands are displayed to open the data region dialog. See Properties
Window for more information.
2. In the dialog that appears, go to the Sorting page and click the Add(+) icon to add an empty expression to
the sorting list below.
3. In the Expression field, enter the expression directly or use <Expression...> from the dropdown to open the
Expression Editor and select the field on which you want to sort your data.
4. Under Direction, select Ascending or Descending to set the order in which to sort your data.
5. Click OK to close the dialog.
6. From the Report Explorer, drag and drop the field on which the sorting expression is set and go to the
Preview Tab to view the result.
The following image shows the result after setting sorting in a Table data region on the Title field in Ascending
order:
Note: In a Chart data region dialog, the Sorting tab is available on the Category Groups and Series Groups
pages.
1. On the Groups or the Detail Grouping page of the data region dialog, select the Sorting tab.
2. In the Sorting tab, click the Add(+) icon to add an empty expression to the sorting list.
3. In the Expression field, enter the expression directly or use <Expression...> from the dropdown to open the
Expression Editor and select the field on which you want to sort your data. The expression set here should
be the same as the grouping expression.
4. Under Direction, select Ascending or Descending to set the order in which to sort your data.
5. Click OK to close the dialog.
6. From the Report Explorer, drag and drop the field on which sorting is set and go to the Preview Tab to view
the result.
The following image shows the result on a Table data region where grouping and sorting is set on the StorePrice
field in Descending order:
3. In the FixedPage dialog, now go to the Sorting page and click the Add(+) icon to add an empty expression
to the sorting list below and in the Expression field enter the same expression you used for grouping the
data.
4. Under Direction, select Ascending or Descending to set the order in which to sort your data.
5. Click OK to close and apply the settings.
6. From the Report Explorer, drag and drop the field on which sorting is set and go to the Preview Tab to view
Note: The difference in setting sorting on a Fixed Page is that it affects every data region placed on the
report layout, whereas sorting on a data region is limited to the data region only.
The following images shows the result when sorting is set on a fixed page on the StorePrice field in descending
order:
Page 1 Page 2
Note: Under Data region or group to sort, and Evaluate sort expression in this scope, you can
optionally choose a different a scope from the Choose data region or grouping drop down list.
You can click the icon to sort in descending order. The icon changes to an up arrow that you can click to sort
ascending.
3. Under the Jump to Report field, enter the name of the report (like BasicReport.rdlx) that you want to
navigate to on clicking the drill-through link.
Note: Under the Jump to Report field, when you enter just a report name, the targeted report
should be kept in the same directory as the parent report. Else, you can also enter the relative path to
the location of the report. You can also use a report from your connected database using the Custom
Resource Locator.
4. After setting the detail report to drill-through, on the Navigation page, under Parameters, you can
optionally enter a valid parameter Name and Value to pass to the detail report. This value must evaluate
to a valid value for the parameter. By setting parameters you can jump right to the desired information. For
example, if your summary report contains a list of invoice numbers and delivery dates for each customer,
you could use a drill-through link with the invoice number as the parameter to allow the user to jump to the
relevant invoice.
Caution: The Parameter Name must exactly match the name of the parameter in the detail report. If
any parameter is spelled differently, capitalized differently, or if an expected parameter is not
supplied, the drill-through report fails.
5. Go to the preview tab and click the drill-through link to navigate to the targeted report.
6. On the Viewer toolbar, click the Back to Parent Report button to return to the main report.
The following images show a simple drill-through link set on a list displaying years. Click any year to drill-through
to a report that contains top movies in that year.
Target Report
Alternatively,
1. On the design surface, select the report control you want to add to the Document map and right-click to
choose Properties from the context menu.
2. In the Properties window that appears, enter a text or an expression in the Label property to represent the
report control in the Document map.
Note: In an Page report, you can also set grouping and set the document map label on the FixedPage dialog
> Groups page. See Grouping in a FixedPage to learn how to set groups on a fixed page.
Note: Any customization made here gets directly applied to the TableOfContents control.
Note: The unit of measure is based on your locale, but you can change it by typing in a different unit
designator such as cm or pt after the number.
Note: This topic uses examples from the tables in the Reels database. By default, in ActiveReports, the
Reels.mdb file is located at [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data\Reels.mdb.
4. Follow the steps below to add detail grouping to the List data region.
Right-click the list and select Properties.
In the Detail Grouping page, select a Group on expression (like AccountNumber) on which you
want to group the data.
Click the OK button to close the dialog and apply grouping.
5. Go to the Preview Tab to view the report, you can see a subtotal on price for each account number.
4. From the Report Explorer, drag and drop a field (Like SalesAmount) onto the bottom right cell of the
matrix. This is the detail data cell, and displays aggregated data for the intersection of each column and
row.
5. In the Matrix data region, click the cell containing the field you placed in the last step and go to the
Properties Window.
6. In the Properties Window, go to the Value property and set the expression for the detail cell to
=Sum(Fields!SalesAmount.Value). This displays the sum of aggregated data at the intersection of each
column and row.
Note: For the Value property, you can set any expression from the set of aggregate functions
to calculate data for the subtotals. For example, if you set the Value property of the detail cell to the
expression =Max(Fields!SalesAmount.Value), this displays the maximum value at the intersection
of each column and row.
7. In the Matrix, right-click the column header cell and select Subtotal. A new column appears to the right
with the text Total. This displays the subtotal for each row group.
8. Right-click the row header cell and select Subtotal. A new row appears at the bottom with the text Total.
This displays subtotals for each column group.
9. Go to the Preview tab to view the subtotals for each year.
Along with the additional cell, a static label cell is added automatically. The label is added at the position indicated
in the following table, depending on the side of the original detail cell on which the static column or row is placed.
Note: Make sure that the Value property of each TextBox representing the row group in the Matrix is
set to the corresponding field value.
In case the data flows to the next page at a point where the merged cell is located, the merged cell value repeats
on the new page along with the corresponding values of the matrix.
Page 1 Page 2
Click the gray area around the design surface and in the commands section at the bottom of the
Properties Window, click the Edit Data Source command.
There are four tabs in the dialog for the four most commonly used data sources.
The following steps take you through the process of binding reports to each data source. These steps assume that
you have already added an ActiveReports 9 Section Report template in a Visual Studio project. See Adding an
ActiveReport to a Project further information on adding different report layouts.
To use the OLE DB data source
1. In the Report Data Source dialog, on the OLE DB tab, next to Connection String, click the Build button.
2. In the Data Link Properties window that appears, select Microsoft Jet 4.0 OLE DB Provider and click the
Next button to move to the Connection tab.
3. Click the ellipsis (...) button to browse to your database, for example the NWind.mdb sample database.
Click Open once you have selected the appropriate database path.
4. Click the Test Connection button to see if you have successfully connected to the database.
5. Click OK to close the Data Link Properties window and return to the Report Data Source dialog. Notice that
the Connection String field gets filled automatically.
6. In the Query field on the OLE DB tab, enter a SQL query to select the data that you want use from the
connected database. For example, Select * From CUSTOMERS
OR
In the Report Data Source dialog, click on to access Visual Query Designer for
creating SQL queries. See Visual Query Designer for further information on how to create a query using
the interactive query designer.
7. Click OK to save the data source and return to the report design surface.
To use the ODBC data source
Before you connect to an ODBC data source, you must install an ODBC driver and set up an ODBC data source. For
more information, see How To: Setup an ODBC Data Source.
1. In the Report Data source dialog, click the ODBC tab.
2. In the Connection String field on the ODBC tab, enter a connection string to connect to the database. For
example, Provider=MSDASQL;Persist Security Info=False;DSN=MS Access Database
3. In the Query field on the ODBC tab, enter a SQL query to select the data that you want use from the
connected database. For example, Select * From CUSTOMERS
4. Click OK to save the data source and return to the report design surface.
To use the SQL data source
1. In the Report Data Source dialog, on the SQL tab, next to Connection String, click the Build button.
2. In the Data Link Properties window that appears, select Microsoft OLE DB Provider for SQL Server and
click the Next button to move to the Connection tab.
3. On the Connection tab of the Data Link Properties window:
In the Select or enter server name field, select your server from the drop down list.
Under Enter information to log on to the server, select the Windows NT security credentials
or your specific user name and password.
Under Select the database on the server, select a database from the server or attach a
database file.
Click the Test Connection button to see if you have successfully connected to the database.
4. Click OK to close the Data Link Properties window and to return to the Report Data Source dialog. Notice
that the Connection String field gets filled automatically.
5. In the Query field on the SQL tab, enter a SQL query to select the data that you want use from the
connected database. For example, Select * From CUSTOMERS
OR
To write code in C#
C# code. Paste above the ReportStart event.
private static OleDbConnection m_cnn;
private static OleDbDataReader m_reader;
private string sqlString;
private string m_cnnString;
Tip: In order to view the added data at runtime, add controls to your report and assign their DataField
property to the name of the fields you added in code while creating a field collection.
Caution: Do not access the Fields collection outside the DataInitialize and FetchData events. Accessing the
Fields collection outside of these events is not supported, and has unpredictable results.
Visual Basic.NET code. Paste inside the class declaration of the report.
Private Function GetIEnumerableData() As IEnumerable(Of String)
For i As Integer = 1 To 10
list.Add(String.Format("TestData_{0}", i.ToString()))
Next
Return list
End Function
3. On the design surface, right-click the gray area around the design surface to select the report and select
Properties.
4. In the Properties window that appears, click the Events icon to view the available events for the report.
5. Double-click the DataInitialize event. This creates an event-handling method for the report's DataInitialize
event.
6. Add the following code to the handler to add fields to the report's Fields collection.
To add fields in Visual Basic
Visual Basic.NET code. Paste inside the DataInitialize event.
Me.Fields.Add("TestField")
Me.list = New List(Of String)
datasource1 = GetIEnumerableData().GetEnumerator()
To add fields in C#
C# code. Paste inside the DataInitialize event.
this.Fields.Add("TestField");
datasource = GetIEnumerableData().GetEnumerator();
7. Repeat steps 3 and 4 to open the events list in the property window.
8. Double-click the FetchData event. This creates an event-handling method for the report's FetchData
event.
9. Add code to the handler to retrieve information to populate the report fields.
To populate fields in Visual Basic
Visual Basic.NET code. Paste inside the FetchData event.
If datasource1.MoveNext() Then
Me.Fields("TestField").Value = datasource1.Current
eArgs.EOF = False
Else
eArgs.EOF = True
End If
To populate fields in C#
C# code. Paste inside the FetchData event.
if (datasource.MoveNext())
{
this.Fields["TestField"].Value = datasource.Current;
eArgs.EOF = false;
}
else
eArgs.EOF = true;
Tip: In order to view the added data at runtime, add controls to your report and assign their DataField
property to the name of the fields you added in code while creating a field collection.
Note: You can also set a field expression in the DataField property. For example, =Country + City.
3. Drag and drop the grouping field onto the GroupHeader section to see the grouping field while previewing
the report.
4. Drag and drop data fields onto the detail section. All the data placed inside the detail section gets grouped
according to grouping field.
5. Preview the report to see the result.
The following image shows a customer list grouped on the Country field.
Tip: In a section report, data is grouped in the order in which it is fetched in the raw form. Therefore, for
best results, while setting the SQL query in your report data source, order the data by the grouping field. For
example., SELECT * FROM Customers ORDER BY Country
1. Right-click the design surface, and select View Code to display the code view for the report.
2. Add the following code to the report to access the sample database path from the registry.
To write the code in Visual Basic
The following example shows what the code for the function looks like.
Visual Basic.NET code. Paste below the Imports GrapeCity.ActiveReports statement at the top of the
code view.
End Function
Note: ActiveReports automatically handles null values, replacing them with an empty string.
To round a calculation
Set the DataField Property of a textbox control like the following example.
Example:
=(double)System.Math.Round(UnitsInStock/10)
To use modular division
Set the DataField property of a textbox control like the following example to get the remainder (2 in this case).
Example: =22%(5)
To replace a null value
Set the DataField property of a textbox control like the following example to replace null with your own value.
Example:
=(UnitsInStock == System.DBNull.Value) ? "No Units In Stock" : UnitsInStock
{RunDateTime: M/d/yyyy h:mm tt} Display the Date and Time in the following format :
1/31/2012 2:45 PM
{RunDateTime: M/d/yy h:mm} Display the Date and Time in the following format :
1/31/12 2:45
{RunDateTime: M/d/yyyy h:mm} Display the Date and Time in the following format :
1/31/2012 2:45
Page numbering can also be set to a group level using the SummaryGroup and SummaryRunning properties.
These steps assume that you have already added a Section Report to a project in Visual Studio. See Adding an
ActiveReport to a Project for more information.
To display page numbers and report dates on a report
1. From the ActiveReports 9 Section Report tab in the toolbox, drag the ReportInfo control to the desired
location on the design surface.
2. With the ReportInfo control selected in the Properties Window, drop down the FormatString property.
3. Select the pre-defined format that best suits your needs.
Tip: You can customize the pre-defined formats in the Properties Window. For example,
if you change the FormatString property to Page {PageNumber} / {PageCount}, it shows the
first page number as Page 1/1. For more information on creating formatting strings, see the Date,
Time, and Number Formatting topic.
Caution: Do not attempt to load a file into a RichTextBox in a section that repeats. After the first iteration of
the section, the RTF or HTML file is already in use by that first iteration and returns "file in use" errors when
that section is processed again.
Note: The RichTextBox control is limited in its support for advanced RTF features such as the ones supported
by Microsoft Word. In general, the features supported by WordPad are supported in this control.
Note: The RichTextBox control has limited support for advanced RTF features such as the ones supported by
Microsoft Word. Therefore, use a WordPad for obtaining best results.
These steps assume that the RTF file (for example, sample.rtf) to load has been saved in the bin/debug directory
of your project.
1. Right-click the report and select View Code to open the code view.
2. Add an Imports (Visual Basic.NET) or using (C#) statement at the top of the code view for the
GrapeCity.ActiveReports.SectionReportModel namespace.
Note: The Application.Startup path code does not work in preview mode. You must run the project in order
to see the file load.
Note: The Application.Startup path code does not work in preview mode. You must run the project in order
to see the file load.
2. On the OLE DB tab of the Report Data Source dialog, next to Connection String, click the Build button.
3. In the Data Link Properties window that appears, select Microsoft Jet 4.0 OLE DB Provider and click the
Note: The sample NWind.mdb data file is located in: [User Documents folder]\GrapeCity
Samples\ActiveReports 9\Data\NWind.mdb
5. Click OK to close the window and fill in the Connection String field.
6. Back in Report Data Source dialog, paste the following SQL query in the Query field to fetch Top 10
records from the database.
SQL Query
SELECT TOP 10 Customers.CompanyName, Sum([UnitPrice]*[Quantity])
AS Sales
FROM (Customers INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID)
INNER JOIN [Order Details] ON Orders.OrderID = [Order Details].OrderID
GROUP BY Customers.CompanyName
ORDER BY Sum([UnitPrice]*[Quantity])
DESC
Note: These steps use the Products table from the NWind database. The sample NWind.mdb database file is
located in the [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data folder.
3. Add controls like TextBox to the report design surface and preview the report.
Caution: Base reports and the reports that inherit from them cannot contain controls with duplicate names. You can
compile and run your project with duplicate control names, but you cannot save the layout until you change the
duplicate names.
3. Right-click the gray area below the design surface and choose properties, to open the Properties window.
4. In the Properties window, set the MasterReport property to True. Setting the MasterReport property to True locks
the Detail section.
You can use the Page Header and Page Footer sections to design the base report. When you create reports that inherit the
layout from this base report, only the detail section is available for editing.
Caution: Do not set the MasterReport property to True until you have finished designing or making changes to
the report. Setting this property to True triggers major changes in the designer file of the report.
4. Close the reports and from the Build menu on the Visual Studio menu bar, select Rebuild. When you reopen the
report, the inherited sections and controls are disabled.
Note: To apply further changes from the base report to the content report, you might have to rebuild the
project again.
Printer Settings
At design time, you can set up duplex printing, page orientation, collation, and page size in the Printer Settings
tab of the Report Settings Dialog.
Duplex Printing
To set up duplex printing in Printer Settings
1. In the Report Explorer, double-click the Settings node.
2. In the Report Settings dialog that appears, click Printer Settings.
3. On the Printer Settings page, next to Duplex, select one of the following options:
Printer Default: The report uses the default settings of the selected printer.
Simplex: Turns off duplex printing.
Horizontal: Prints horizontally on both sides of the paper.
Vertical: Prints vertically on both sides of the paper.
4. Click OK to return to the report.
Page Orientation
To set page orientation on the Printer Settings page
1. In the Report Explorer, double-click the Settings node.
2. In the Report Settings dialog that appears, click Printer Settings.
3. On the Printer Settings page, in the Orientation section, select either Default, Portrait or Landscape.
4. Click OK to return to the report.
To use code to change page orientation
1. Double-click the gray area below the design surface to create an event-handling method for the report's
ReportStart event.
2. Add the following code to the handler to change the page orientation of the report for printing.
Note: Page orientation can only be modified before the report runs. Otherwise, changes made to the
page orientation are not used during printing.
The following example shows what the code for the method looks like.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the ReportStart event.
Me.PageSettings.Orientation =
GrapeCity.ActiveReports.Document.Section.PageOrientation.Landscape
Multiple Copies
You can print multiple copies using the Print dialog in the Preview tab or in the Viewer, or you can use code to set
the number of copies to print.
To set multiple copies in the print dialog
1. With a report displayed in the viewer or in the preview tab, click Print.
2. In the Print dialog that appears, next to Number of copies, set the number of copies that you want to
print.
To use code to set multiple copies
1. Double-click in the gray area below the design surface to create an event-handling method for the report's
ReportStart event.
2. Add the following code to the handler to set multiple copies of the report for printing.
The following example shows what the code for the method looks like for printing five copies.
Note: These steps use the Products table from the NWind database. By default, in ActiveReports, the
NWind.mdb file is located in the [User Documents folder]\GrapeCity Samples\ActiveReports
9\Data\NWind.mdb.
1. From the Report Explorer, drag and drop the following fields onto the detail section of the report and set
their properties in the Properties Window.
2. Double-click the detail section of the report to create an event-handling method for the Format event.
3. Add the following code to the handler to hide the details of a product which is discontinued.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the Detail_Format event.
If Me.txtReorderLevel1.Value = 0 And Me.txtDiscontinued1.Value = False
Then
Me.Detail1.Visible = True
Me.txtReorderLevel1.Text = "Need to Reorder"
Me.txtReorderLevel1.ForeColor = System.Drawing.Color.DarkRed
Else
Me.Detail1.Visible = False
End If
4. In Form1 of the Visual Studio project, add a Viewer control and load the report you created above in it. See
Using the Viewer for further details.
5. Press F5 to debug and see a report with discontinued products hidden from view.
2. Select the added parameter to open the Properties Window and set values in the following properties:
Name: This is the unique name of the parameter which appears as Parameter1 by default. It corresponds to the Key property in parameters entered via code.
Default Value: Sets/returns the value displayed when the user is prompted to enter a value at runtime.
Prompt: Sets/returns a string displayed when a user is prompted for the value at runtime.
PromptUser: Boolean value that indicates whether to prompt the user for a value or not. This is set True to use parameters at runtime.
Type: This value which defaults to String defines the type of data the parameter represents. You can also set data type to Date or Boolean.
3. Pass the parameter to a field on the report, or access it programmatically as described in the run time procedure below.
3. In the design view, click the gray area below the report to select it and open the Properties Window.
4. Click the events icon in the Properties Window to display available events for the report.
5. Double-click FetchData. This creates an event-handling method for the report's FetchData event.
6. Add code to the handler to pass the parameter at run time.
To write the code in Visual Basic.NET
The runtime implementation above causes ActiveReports to display the following dialog to the user. The user can enter any text in this prompt dialog and display it on the report.
To save annotations
The following example shows how to add a Save Annotated Report button to the viewer and save a report with
annotations in RDF.
1. From the Visual Studio toolbox, drag a Button control onto the viewer.
2. Set the Text property of the button to Save Annotated Report.
3. Double-click the button. This creates an event-handling method for the button Click event.
4. Add code to the click handler to save the document to an RDF file. See Save and Load RDF Report Files for
more information on loading the saved RDF file into the viewer.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the button Click event.
Me.Viewer1.Document.Save("C:\UserAnnotations.rdf")
'Set the size properties. The annotation must be added to the page first.
circle.Height = 0.25
circle.Width = 0.50
//Set the size properties. The annotation must be added to the page first.
circle.Height = 0.25f;
Add Bookmarks
In a section report, you can display bookmarks and nested bookmarks in the viewer's table of contents for fields, groups, and subreports. You
can also add special bookmarks at run time.
To set up basic bookmarks
1. From the Visual Studio toolbox, drag and drop a TextBox control onto the detail section.
2. Double-click the Detail section of the report. This creates an event-handling method for the report's Detail_Format event.
3. Add code to the handler to set up bookmarks.
The following example shows what the code for the method looks like.
To write the code in Visual Basic.NET
4. Add a GroupHeader section to the layout and set its DataField property to City.
5. Double-click in the Group Header section of the report. This creates an event-handling method for the report's Group Header Format
event.
6. Add code to the handler to set up a bookmark for each instance of the City group.
The following example shows what the code for the group header looks like.
To write the code in Visual Basic.NET
C# code. Paste INSIDE the Detail Format event of the main report.
detail1.AddBookmark(txtCustomerID.Text);
4. From the Report Explorer, drag and drop the ContactName field onto the detail section of the Subreport.
5. Double-click in the Detail section to create an event-handling method for the report's Detail Format event.
6. Add code to the handler to create a bookmark for each instance of the ContactName field in the subreport.
The following example shows what the code for the method looks like for the subreport.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the Detail Format event of the subreport.
Me.Detail1.AddBookmark(CType(Me.ParentReport.Sections("Detail1").Controls(" txtCustomerID"),
TextBox).Text + "\" + Me.txtContactName.Text)
Caution: Remember that the page collection does not exist until the report runs, so use this code in the ReportEnd event or in form
code after the report has run.
Note: Specify the full URL address (for example, "http://www.grapecity.com") for the Hyperlink property to
avoid broken links while viewing reports.
Note: You can apply styles to the CheckBox, Label, TextBox, and ReportInfo controls only.
rpt1.Run()
rpt2.Run()
rpt1.Document.Pages.AddRange(New GrapeCity.ActiveReports.Document.Section.Page()
{rpt2.Document.Pages(1), rpt2.Document.Pages(2)})
Viewer1.Document = rpt1.Document
rpt1.Run()
rpt2.Run()
rpt1.Document.Pages.Insert(0, rpt2.Document.Pages(0))
Viewer1.Document = rpt1.Document
rpt1.Run();
rpt2.Run();
rpt1.Document.Pages.Insert(0, rpt2.Document.Pages[0]);
viewer1.Document = rpt1.Document;
rpt1.Run()
rpt1.Document.Pages.InsertNew(0)
rpt1.Run();
rpt1.Document.Pages.InsertNew(0);
viewer1.Document = rpt1.Document;
Embed Subreports
To embed a subreport into a parent report, you add two reports (one parent and one child report) to a Visual
Studio project, and from the ActiveReports 9 Section Report toolbox, drag the SubReport control onto the parent
report. The following steps take you through the process of adding a subreport in a section report.
These steps assume that you have already added a Section Report (code-based) template in a Visual Studio
project. See Adding an ActiveReport to a Project for further information.
To add code to create an instance of the child report in the parent report
1. Double-click the gray area around the parent report to create an event-handling method for the
ReportStart event.
2. Add code like the following to the handler to create a new instance of the child report.
To write the code in Visual Basic
Caution: It is recommended that you do not create a new instance of the subreport in the Format event.
Doing so creates a new subreport each time the section Format code is run, using a lot of memory.
To add code to display the child report in a subreport control on a parent report
1. Add the SubReport control onto the design surface of the parent report.
2. Double-click the detail section of the report to create a detail_Format event.
3. Add code like the following to the handler to display a report in the SubReport control.
To write the code in Visual Basic
Visual Basic.NET code. Paste INSIDE the Format event.
Or
Visual Basic.NET script. Paste INSIDE the Detail Format event.
CType(rpt.Sections("Detail1").Controls("TextBox1"), TextBox).Text =
"Hello"
Or
To add a class in C#
C# code.
public partial class clsMyItem
2. Add a public function to your class using code like the following:
To create a public function in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the new class.
Public Function getMyItem() As String
getMyItem = "Hello"
End Function
3. Go to the design view of the report and double-click the gray area around the design surface to create an
event-handling method for the ReportStart event.
4. Add the following code to the handler:
To access the class in Visual Basic.NET
Visual Basic.NET code. Paste before or in the ReportStart event.
Me.AddNamedItem("myItem", new clsMyItem())
5. From the Visual Studio toolbox, drag and drop a TextBox control onto the detail section of the report.
6. Go to the script tab and drop down the Object list to select Detail. This populates the Event drop-down list
with section events.
7. Drop down the Event list and select Format. This creates script stubs for the event.
8. Add the following script to the event to access a control on the report and populate it using the named
item.
To access the control in VB.NET script
Or
VB.NET script. Paste INSIDE the Detail Format event.
CType(rpt.Sections("Detail1").Controls("TextBox1"), TextBox).Text =
myItem.getMyItem()
Or
C# script. Paste INSIDE the Detail Format event.
((TextBox)rpt.Sections["detail"].Controls["textBox1"]).Text =
To access a namespace in C#
C# code. Paste INSIDE the Form code. Replace YourReportName with the name of your report.
private void runReport()
{
YourReportName rpt = new YourReportName;
rpt.AddScriptReference("System.Data.dll");
rpt.Run();
}
To add code in C#
C# code. Paste INSIDE the report class.
public string addThisCode()
{
string sCode = "public string ShowACMessage(){return \"my Added Code\";}";
return sCode;
}
2. In the design view of your report double-click the gray area around the design surface to create an event-
handling method for the ReportStart event.
3. Add the following code to the handler:
To access the class in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the ReportStart event.
Me.AddCode(addThisCode())
4. Go to the script tab and drop down the Object list to select Detail. This populates the Event drop-down list
with section events.
5. Drop down the Event list and select Format. This creates script stubs for the event.
6. Add the following script to the event:
To write the script in Visual Basic.NET
VB.NET script. Paste INSIDE the Detail1_Format event.
Me.TextBox1.Text = ShowACMessage()
Or
Or
C# script. Paste INSIDE the detail_Format event.
((TextBox)rpt.Sections["detail"].Controls["textBox1"]).Text =
ShowACMessage();
Or
VB.NET script. Paste INSIDE the Detail1_Format event.
Dim f As MyFuncs = New MyFuncs()
CType(rpt.Sections("Detail1").Controls("TextBox1"), TextBox).Text = f.ShowMyString
Or
C# script. Paste INSIDE the detail_Format event.
MyFuncs f = new MyFuncs();
((TextBox)rpt.Sections["detail"].Controls["textBox1"]).Text = f.ShowMyString();
Note: Use the examples with the "this" (C#) and "Me"(Visual Basic.NET) keywords, as they are
recommended rather than the ones with "rpt".
Note: The Windows Form Viewer can display RDF files made with any version of ActiveReports, including
COM versions. The FlashViewer viewer type of the WebViewer (Professional Edition) may be able to display
RDF files made with previous versions, but this is not guaranteed for every RDF.
Caution: When you load an RPX layout into a report object, it overwrites everything in the report object. In
order to avoid overwriting important layouts, add a new blank ActiveReport and load the RPX file onto it.
Note: When you save a layout that contains a dataset, ActiveReports saves the data adapter and data
connection in the component tray, but not the dataset itself. When the saved layout is loaded into another
report, you can regenerate the dataset with the data adapter and data connection.
Note: When you save a report layout, ActiveReports only saves the code in the script editor to the file. Any
code behind the report in the .cs or .vb file is not saved to the RPX file.
1. Right-click the Windows Form and select View Code to see the code view for the Windows form.
2. Add the following code to the Form class to save the report.
The following example shows what the code for the method looks like.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the Form class.
Dim rpt As New SectionReport1()
Dim xtw As New System.Xml.XmlTextWriter(Application.StartupPath +
"\report.rpx", Nothing)
rpt.SaveLayout(xtw)
xtw.Close()
Save report layouts before they run. If you save a layout after the report runs, you also save any dynamic changes
made to properties or sections in the report. To avoid this when you call SaveLayout inside the report code, use
the ReportStart event.
Note: The SaveLayout method uses utf-16 encoding when you save to a stream, and utf-8 encoding when
you save to a file.
In this section
Localize Reports, TextBoxes, and Chart Controls
Learn how to localize individual textboxes, chart controls, and entire reports.
Localize ActiveReports Resources
Learn to localize ActiveReports dialogs, error messages, and images.
Customize the Viewer Control
Learn how to customize the touch mode toolbar and the mouse mode toolbar of the Viewer control.
Localize the Viewer Control
Learn how to localize strings and images for the ActiveReports Viewer control.
Deploy Windows Applications
Learn to deploy ActiveReports Windows applications.
Deploy Web Applications
Learn to deploy ActiveReports Windows applications.
Localize the End User Report Designer
Learn to localize the strings and images in the End User Report Designer.
Customize the FlashViewer Toolbar
Learn to deploy ActiveReports Windows applications.
Localize the Flash Viewer
Learn to deploy ActiveReports Windows applications.
Configure HTTPHandlers in IIS 6
Learn to deploy ActiveReports Windows applications.
Configure HTTPHandlers in IIS 7 and IIS 8
Learn to deploy ActiveReports Windows applications.
Customize HTML5 Viewer
Learn how to customize the HTML5 Viewer.
Note: The default value for the Culture property is (default, inherit). For the Report object, this is the
culture of the current thread and for the TextBox control and the ChartControl, this is the culture of the
Report object.
In a page layout report, the Report object, TextBox control, and Chart control all have a Language property that
works in the same way. The default value for the Language property is Default, which is the culture of the current
thread.
Design Time
At design time, you can set the culture or language in the Visual Studio Properties window.
To localize a Report at design time
1. Click the gray area around the design surface to select the Report in the Properties window.
2. In the Properties window, drop down the Culture or Language property and select the culture that you
want to apply to the report.
To localize a TextBox control at design time
1. Click the TextBox control that you want to localize to select it.
2. In the Properties window, drop down the Culture or Language property and select the culture that you
want to apply to the textbox.
To localize a Chart control at design time
1. Click the Chart control to select it.
2. In the Properties window, drop down the Culture or Language property and select the culture that you
want to apply to the chart.
Run Time
You can also specify a culture in code for section reports. For a list of System.Globalization culture codes, see
Cultures.
To localize a Report at run time
1. Double-click the gray area around the design surface, to create an event handling method for the
ReportStart event.
2. In the code view of the report that appears, paste code like the following.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the ReportStart event.
YourReportName.Culture =
System.Globalization.CultureInfo.CreateSpecificCulture("en-US")
4. If you want to change the images, rename your localized images to the names of the ones in the
Note: Before you can distribute or put your localization in the Global Assembly Cache (GAC), you
must first send the localized GrapeCity.ActiveReports.AssemblyName.v9.resources.dll file to GrapeCity
and get it signed with a strong name. Then you can drag the language subfolder with the signed dll
file into C:\WINDOWS\ASSEMBLY, or distribute it with your solution.
Test your localized application on a machine that does not share the culture of the localized DLLs.
1. Add the following code in the form's constructor just before the InitializeComponent method is called.
2. Replace the "ja" in the example code with the culture you specified in the *.bat file.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the form's constructor just before the InitializeComponent
method.
System.Threading.Thread.CurrentThread.CurrentUICulture = New
System.Globalization.CultureInfo("ja")
6. Add the following code to the Form class below the Load event to display frmPrintDlg when a user clicks the
custom print button.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste BELOW the Form Load event.
'Call the custom dialog from the new button's click event.
Private Sub tsbPrint_Click(sender As Object, e As EventArgs)
Me.CustomPrint()
End Sub
7. Press F5 to run the project and see the custom print button on the viewer.
Customize the Touch Mode Toolbar
1. Double-click in the title bar of the Viewer form to create a Form Load event.
2. Add the following code to add a custom Zoom out button.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the Form Load event.
Dim zoomOutButton = viewer1.TouchModeToolbar.ToolStrip.Items(8)
zoomOutButton.Visible = true
Caution: Any customization done in mouse mode does not apply to the touch mode and vice versa.
Although this topic and the sample both demonstrate using section reports, customized viewers support page
reports and RDL reports as well. The only difference is in the way that you load reports. For more information, see
Using the Viewer.
4. If you want to change the images, rename your localized images to the names of the ones in the
Res\Resources subfolder and replace them with your localized images.
Run the batch file as an Administrator.
1. From the Start menu, type cmd in the text box, and press CTRL + SHIFT + ENTER to open a command
prompt as an Administrator.
2. To change directories, type:
cd C:\Program Files (x86)\GrapeCity\ActiveReports 9\Localization
and press Enter.
3. Type WinViewer.bat and press Enter to run the file. The NameCompleter.exe application runs, and
creates the following.
A SatelliteAssembly folder inside the WinViewer folder.
A language subfolder with the name of the culture you set inside the SatelliteAssemby folder.
A localized GrapeCity.ActiveReports.Viewer.Win.v9.resources.dll file inside the language
subfolder.
4. Copy the language subfolder and paste it into the Debug folder of your application.
Note: Before you can distribute or put your localization in the Global Assembly Cache (GAC), you
must first send the localized GrapeCity.ActiveReports.Viewer.Win.v9.resources.dll file to GrapeCity
and get it signed with a strong name. Then you can drag the language subfolder with the signed dll
file into C:\WINDOWS\ASSEMBLY.
Test your localized application on a machine that does not share the culture of the localized DLL.
1. Add the following code in the form's constructor just before the InitializeComponent method is called.
2. Replace the "ja" in the example code with the culture you specified in the WinViewer.bat file.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the form's constructor just before the InitializeComponent
method.
System.Threading.Thread.CurrentThread.CurrentUICulture = New
System.Globalization.CultureInfo("ja")
XCopy Deployment
1. Open your project in Visual Studio, and set the Solution Configuration to Release.
2. From the Build menu, select Build Solution.
3. In Windows Explorer, navigate to the project's bin directory, and copy the files from the Release folder
into a zip file.
4. Distribute the zip file.
7. From the Visual Studio Action menu, select Add, then Project Output.
8. In the Add Project Output Group dialog that appears, choose your ActiveReports project name from the
drop-down list.
9. In the list, select Primary Output and click OK. This adds all of the existing assembly dependencies to
your project.
10. If you want to add other ActiveReports DLLs to the installer (e.g. if you use OleObjects on reports, you
need to include the Interop.dll or Interop64.dll for 64-bit machines), in the Solution Explorer, right-click the
installer project name, select Add, then Assembly.
Note: If you would rather use the ActiveReports .msm file, please contact our technical support team.
11. In the Select Component dialog that appears, select any components that you want to add and click the OK
button.
12. From the Visual Studio Build menu, select Build YourInstallerProjectName to build your Installer
project.
To deploy the installer application
1. Select the Installer project in the Solution Explorer.
2. From the Visual Studio Project menu, click Install.
3. The Installer application runs and installs the project on your computer. The distributable exe and msi
setup files appear in your installer project Debug folder.
Other important assemblies that are required for deploying web applications are as follows:
GrapeCity.ActiveReports.v9.dll
GrapeCity.ActiveReports.Extensibility.v9.dll
GrapeCity.ActiveReports.Export.Document.v9.dll
GrapeCity.ActiveReports.Diagnostics.v9.dll
To copy referenced DLLs to your project
1. In the Visual Studio Solution Explorer, if the References node is not showing, click the Show All Files
button.
2. Expand the References node, and select one of the ActiveReports references.
3. In the Properties window, change the CopyLocal property to True. The corresponding DLL is stored in the
Bin folder of your project.
4. Set the CopyLocal property to True for each ActiveReports reference used in your project.
To install prerequisites on the server
Follow Microsoft's instructions to install each of the following on your Web server:
The Microsoft .NET Framework version 3.5 SP1 or higher
Internet Information Services (IIS) version 5.1 or 6.0
ASP.NET version 3.5 or higher (must be the same version as the Framework)
4. If you want to change the images, rename your localized images to the names of the ones in the
Res\Resources subfolder and replace them with your localized images.
Run the batch file as an Administrator.
1. From the Start menu, type cmd in the text box, and press CTRL + SHIFT + ENTER to open a command
prompt as an Administrator.
2. To change directories, type:
cd C:\Program Files (x86)\GrapeCity\ActiveReports 9\Localization
and press Enter.
3. Type ARDesigner.bat and press Enter to run the file. The NameCompleter.exe application runs, and
creates the following.
A SatelliteAssembly folder inside the ARDesigner subfolder.
A language subfolder with the name of the culture you set inside the SatelliteAssemby folder.
A localized GrapeCity.ActiveReports.Design.Win.v9.resources.dll file inside the language
subfolder.
4. Copy the language subfolder and paste it into the Debug folder of your application.
Test your localized application on a machine that does not share the culture of the localized DLLs.
1. Add the following code in the form's constructor just before the InitializeComponent method is called.
2. Replace the "ja" in the example code with the culture you specified in the ARDesigner.bat file.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the form's constructor just before the InitializeComponent
method.
System.Threading.Thread.CurrentThread.CurrentUICulture = New
System.Globalization.CultureInfo("ja")
Note: This code is ignored if the ViewerType property of the WebViewer control is not set to FlashViewer.
Tip: The ToolsCollection class in the Web.Controls namespace has the standard
System.Collections.ObjectModel.Collection methods available, so if you want to just add a button to the end
of the toolbar, you can use the Add method instead.
1. In the Visual Studio Solution Explorer, right-click the ASPX file that contains your WebViewer and select
Note: If you are willing to share your new localization with other customers, let support know so that the
updated GrapeCity.ActiveReports.Flash.v9.Resources.swf file can be included in future builds of the product.
Included Localizations
The default locale is en_US, U.S. English, but the included GrapeCity.ActiveReports.Flash.v9.Resources.swf file
also contains strings localized for the following languages:
ru_RU Russian
ja_JP Japanese
zh_CN Simplified Chinese
The SWF files are located in C:\Program Files (x86)\GrapeCity\ActiveReports 9\Deployment\Flash.
To use the Russian, Japanese, or Chinese localization
1. From C:\Program Files (x86)\GrapeCity\ActiveReports 9\Deployment\Flash, copy
GrapeCity.ActiveReports.Flash.v9.Resources.swf into the project folder that contains the ASPX file
with the WebViewer.
2. In the Design view of the ASPX file, click the WebViewer control to select it, and in the Properties window,
expand the FlashViewerOptions property node.
3. In the ResourceLocale property, drop down the list of values and select the locale that you want to use.
4. Run the project to see the localized FlashViewer.
Custom Localizations
The localization file is located in C:\Program Files (x86)\GrapeCity\ActiveReports 9\Localization.
To localize strings (and images) in the resource file.
1. In C:\Program Files (x86)\GrapeCity\ActiveReports 9\Localization, open the FlashViewer.zip file.
2. Using Notepad, open the Resources.properties file and localize the strings.
3. Save and zip the file.
4. If you want to change the toc.png image for the Table of Contents button icon, rename your localized
image to toc.png and add it to the zip file.
To send the localized file to GrapeCity to be compiled into the SWF file.
1. Attach the localized FlashViewer.zip file to the Submit New Issue form on
our web site: http://activereports.grapecity.com/.
2. Tell support the culture of the localization and ask them to compile it into the
GrapeCity.ActiveReports.Flash.v9.Resources.swf.
5. In the Executable field, select and copy all of the text, and click Cancel to return to the Application
Configuration dialog.
6. Click the Add button to add a new Application Mapping.
7. In the Add/Edit Application Extension Mapping dialog that appears, enter the information from the first row
of the table below.
Classic Mode
If any part of your Web application is not supported in Integrated Mode, you can run it using the Classic .NET
AppPool.
To run your Web application in the Classic .NET Application Pool
1. In the Control Panel, open Administrative Tools, then Internet Information Services (IIS) Manager.
2. In the Internet Information Services (IIS) Manager window that appears, in the left pane under
Connections, expand the Sites node and select the Web application you want to configure.
3. To the right of the Handler Mappings pane that appears, under Actions, click Basic Settings.
4. In the Edit Site dialog that appears, click the Select button.
5. In the Select Application Pool dialog that appears, drop down the Application pool, select Classic .NET
AppPool, and click OK.
6. Back in the Edit Site dialog, click OK to accept the changes.
To configure ActiveReports HTTP handlers to enable report linking in your Web applications
1. In the Control Panel, open Administrative Tools, then Internet Information Services (IIS) Manager.
2. In the Internet Information Services (IIS) Manager window that appears, in the left pane under
Connections, expand the Sites node and select the Web application you want to configure.
3. In the site's Home pane that appears, under IIS, double-click Handler Mappings.
4. To the right of the Handler Mappings pane that appears, under Actions, click Add Script Map.
5. In the Add Script Map dialog that appears, enter the information from the first row of the table below.
Note: If you have a 64 bit app pool, add script mappings for the 64 bit version of the aspnet_isapi.dll
by navigating to C:\Windows\Microsoft.NET\Framework64\v*\aspnet_isapi.dll.
6. Click the Request Restrictions button and ensure that the Invoke handler only if request is mapped
to check box is cleared.
7. Click OK to close the window and add the script mapping.
8. Repeat for each script mapping in the table above.
To add handlers without configuring IIS 7 or IIS 8 using the Classic .NET AppPool
1. In your Web application, open the Web.config file and add code like the following between the
<system.web> and </system.web> tags, changing the ActiveReports Version number on each line to
match the version installed on your machine.
Paste inside the <system.web> tags.
<httpHandlers>
<add verb="*" path="*.AR9"
type="GrapeCity.ActiveReports.Web.Handlers.ReportBinariesStreamer,
GrapeCity.ActiveReports.Web.v9, Version=8.0.xxxx.0, Culture=neutral,
PublicKeyToken=cc4967777c49a3ff" />
<add verb="*" path="*.ActiveReport"
type="GrapeCity.ActiveReports.Web.Handlers.CompiledReportHandler,
GrapeCity.ActiveReports.Web.v9, Version=8.0.xxxx.0, Culture=neutral,
PublicKeyToken=cc4967777c49a3ff" />
<add verb="*" path="*.rpx"
type="GrapeCity.ActiveReports.Web.Handlers.RpxHandler,
GrapeCity.ActiveReports.Web.v9, Version=8.0.xxxx.0, Culture=neutral,
PublicKeyToken=cc4967777c49a3ff" />
<add verb="*" path="*.rdl"
type="GrapeCity.ActiveReports.Web.Handlers.RdlxHandler,
GrapeCity.ActiveReports.Web.v9, Version=8.0.xxxx.0, Culture=neutral,
PublicKeyToken=cc4967777c49a3ff" />
<add verb="*" path="*.rdlx"
type="GrapeCity.ActiveReports.Web.Handlers.RdlxHandler,
GrapeCity.ActiveReports.Web.v9, Version=8.0.xxxx.0, Culture=neutral,
PublicKeyToken=cc4967777c49a3ff" />
<add verb="*" path="*.AR9Web"
type="GrapeCity.ActiveReports.Web.Handlers.WebCacheAccessHandler,
GrapeCity.ActiveReports.Web.v9, Version=8.0.xxxx.0, Culture=neutral,
PublicKeyToken=cc4967777c49a3ff" />
</httpHandlers>
2. In your Web application, open the Web.config file and add code like the following between the
<system.webServer> and </system.webServer> tags depending on the .Net Framework version 2.0 or
4.0 installed on your machine:
.Net 2.0
Paste inside the <system.webServer> tags.
<handlers>
<add name="AR9Rpx" path="*.rpx" verb="*" modules="IsapiModule"
scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll"
preCondition="classicMode,runtimeVersionv2.0,bitness32"/>
<add name="AR9Rdlx" path="*.rdlx" verb="*" modules="IsapiModule"
.Net 4.0
Paste inside the <system.webServer> tags.
<handlers>
<add name="AR9Rpx" path="*.rpx" verb="*" modules="IsapiModule"
scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll"
preCondition="classicMode,runtimeVersionv4.0,bitness32"/>
<add name="AR9Rdlx" path="*.rdlx" verb="*" modules="IsapiModule"
scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll"
preCondition="classicMode,runtimeVersionv4.0,bitness32"/>
<add name="AR9Rdl" path="*.rdl" verb="*" modules="IsapiModule"
scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll"
preCondition="classicMode,runtimeVersionv4.0,bitness32"/>
<add name="AR9" path="*.AR9" verb="*" modules="IsapiModule"
scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll"
preCondition="classicMode,runtimeVersionv4.0,bitness32"/>
<add name="AR9Web" path="*.AR9Web" verb="*" modules="IsapiModule"
scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll"
preCondition="classicMode,runtimeVersionv4.0,bitness32"/>
<add name="ActiveReport" path="*.ActiveReport" verb="*"
modules="IsapiModule"
scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll"
preCondition="classicMode,runtimeVersionv4.0,bitness32"/>
</handlers>
Note: If you have a 64 bit Web application, change the preCondition attribute on each line to
classicMode,runtimeVersionv2.0,bitness64, or in ASP.NET 4, change it to
classicMode,runtimeVersion4.0,bitness64.
Integrated Mode
To configure ActiveReports HTTP handlers to enable report linking in your Web applications
1. In the Control Panel, open Administrative Tools, then Internet Information Services (IIS) Manager.
2. In the Internet Information Services (IIS) Manager window that appears, in the left pane under
Connections, expand the Sites node and select the Web application you want to configure.
3. In the site's Home pane that appears, under IIS, double-click Handler Mappings.
4. To the right of the Handler Mappings pane that appears, under Actions, click Add Managed Handler.
5. In the Add Managed Handler dialog that appears, enter the information from the first row of the table
below.
6. Click the Request Restrictions button and ensure that the Invoke handler only if request is mapped
to check box is cleared.
7. Click OK to close the window and add the handler mapping.
8. Repeat for each handler mapping in the table above.
To add handlers without configuring IIS 7 or IIS 8 using the DefaultAppPool
In your Web application, open the Web.config file and add code like the following between the
<system.webServer> and </system.webServer> tags, changing the ActiveReports Version number on each line
to match the version installed on your machine.
Paste inside the <system.webServer> tags.
<handlers>
<add name="AR9Rpx" path="*.rpx" verb="*" modules="IsapiModule"
scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll"
preCondition="integratedMode,runtimeVersionv2.0,bitness32"/>
<add name="AR9Rdlx" path="*.rdlx" verb="*" modules="IsapiModule"
scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll"
preCondition="integratedMode,runtimeVersionv2.0,bitness32"/>
<add name="AR9" path="*.AR9" verb="*" modules="IsapiModule"
scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll"
preCondition="integratedMode,runtimeVersionv2.0,bitness32"/>
<add name="AR9Web" path="*.AR9Web" verb="*" modules="IsapiModule"
scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll"
preCondition="integratedMode,runtimeVersionv2.0,bitness32"/>
<add name="AR9Rdl" path="*.rdl" verb="*" modules="IsapiModule"
scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll"
preCondition="integratedMode,runtimeVersionv2.0,bitness32"/>
<add name="ActiveReport" path="*.ActiveReport" verb="*" modules="IsapiModule"
scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll"
preCondition="integratedMode,runtimeVersionv2.0,bitness32"/>
</handlers>
Note: If you have a 64 bit Web application, change the preCondition attribute on each line to
integratedMode,runtimeVersionv2.0,bitness64, or in ASP.NET 4, change it to
integratedMode,runtimeVersion4.0,bitness64.
Note: These steps assume that you have already created a new ASP.Net Web Application and added a
sample report to display in the viewer.
1. Add a new HTML page item to the project and in the Name field, rename the page item as
HTML5Viewer.html.
2. Copy and place GrapeCity.ActiveReports.Viewer.Html.js and
GrapeCity.ActiveReports.Viewer.Html.css files in the project folder and add them to your project.
Note: In ActiveReports, these files are located in the C:\Program Files\GrapeCity\ActiveReports
9\Deployment\Html folder.
3. In the HTML5Viewer page item, add references to the stylesheets that will control the styling and
appearance of the HTML5 Viewer.
Note: You can obtain the source of Bootstrap.min.js from Content Delivery Network (CDN) like shown
in the code below. You can also download the file from the source website and add the file to the
project locally.
Code
Paste inside the <head></head> tags
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css"
rel="stylesheet" />
<link href="/GrapeCity.ActiveReports.Viewer.Html.css" rel="stylesheet" />
4. Add the following DIV element inside the <body></body> tags that will contain the HTML5 Viewer and
the Paginator control.
Code
Paste inside the <body></body> tags
<div class="container">
<div id="paginator" class="pagination"></div>
<div id="viewer" style="width: auto; height: 600px"></div>
</div>
5. Add the following Style element inside the <body></body> tags to make the viewer fill the entire
browser window.
Code
Paste inside the <body></body> tags
<style>
#viewer {
position: absolute;
left: 5px;
right: 5px;
top: auto;
bottom: 5px;
font-family: 'segoe ui', 'ms sans serif';
overflow: hidden;
}
</style>
6. Add the following DIV element inside the <body></body> tags that will contain the buttons for Print and
Export.
Code
Paste inside the <body></body> tags
<div class="panel panel-default">
7. In the Project menu, click Add New Item, select ActiveReports 9 Web Service and then click the Add
button. This adds the ActiveReports.ReportService.asmx file to the project.
8. Add the reference to the GrapeCity.ActiveReports.Viewer.Html.js and its following dependencies:
jQuery 1.10.2 or higher
Bootstrap 3.1.0 or higher
Knockout 2.3.0 or higher
Note: You can obtain the source of dependencies like jQuery from Content Delivery Network (CDN).
You can also download and add them to the project locally.
Code
Paste inside the <head></head> tags
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.js"
type="text/javascript"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/twitter-
bootstrap/3.1.0/js/bootstrap.js" type="text/javascript"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/knockout/2.3.0/knockout-debug.js"
type="text/javascript"></script>
<script src="/GrapeCity.ActiveReports.Viewer.Html.js" type="text/javascript">
</script>
9. Add the following script element below other script elements to create the HTML5 Viewer for the viewer
<div> element we have added above.
Code
Paste inside the <body></body> tags
<script type="text/javascript">
$(function () {
var paginator = $('#paginator');
var viewer = GrapeCity.ActiveReports.Viewer(
{
element: '#viewer',
report: {
id: "SampleReport.rdlx"
},
reportService: {
url: '/ActiveReports.ReportService.asmx'
},
//Setting the uiType to Custom
uiType: 'custom',
documentLoaded: function () {
setPaginator();
}
});
//Creating the function for Printing
$('#btnPrint').click(function () {
viewer.print();
});
//Creating the function for Exporting
$('#btnExport').click(function () {
//Creating the function for using Paginator control to display report pages
and to navigate through them
function setPaginator() {
if (viewer.pageCount > 0) {
for (var i = 1; i <= viewer.pageCount; i++) {
$('<li data-bind="' + i + '"><a class="js-page"
href="javascript:void(0)">' + i + '</a></li>').appendTo(paginator);
}
paginator.children(":first").addClass('active');
paginator.children().click(function () {
var self = $(this);
viewer.goToPage(self.attr('data-bind'), 0, function () {
paginator.children().removeClass('active');
self.addClass('active');
});
});
}
}
});
</script>
10. Press F5 to run the project and navigate to the webpage containing the HTML5 Viewer that we have just
created.
11. As the report gets loaded in the viewer, use the paginator control to navigate through the all the report
pages and click Print or Export to PDF to print or export the displayed report.
Localization
The HTML5 viewer can be localized by localizing the strings present in the en.txt file and then using it through the
localeUri option while initializing the viewer. The en.txt file contains strings for viewer's toolbar items, panes,
dialogs and errors. These strings can be localized to any culture and should be saved in the UTF-8 format. Follow
these steps to learn localizing the HTML5 viewer:
1. Go to C:\Program Files\GrapeCity\ActiveReports 9\Deployment\Html\i18n and open the en.txt
file in a Notepad.
3. Add the newly created localized file to the project containing the HTML5 viewer. See Working with HTML5
Viewer using Javascript to learn creating the HTML5 viewer.
4. In the targeted HTML page that contains code to create the HTML5 viewer, paste the following code:
XML
var viewer = GrapeCity.ActiveReports.Viewer(
{
localeUri: 'Scripts/i18n/jp.txt'
});
5. Press F5 to run the project and navigate to the webpage containing the HTML5 Viewer with localized
strings.
Deployment
You can deploy the HTML5 viewer on IIS by deploying the ActiveReports Web Application that contains the viewer.
See Working with HTML5 Viewer using Javascript to learn creating the HTML5 viewer in a ASP.Net Web Application
project and Deploy Web Applications to learn deploying an ActiveReport Web Application.
3. In the Report Explorer, with field1 selected, go to the Properties Window and set a value for the field in the
Formula ('Formula Property' in the on-line documentation) property. For e.g., for a calculated field
Inventory, in the Formula field, enter the expression =UnitsInStock - ReorderLevel.
You can change the name of the field in the Name ('Name Property' in the on-line documentation)
property.
4. Drag the field from the Calculated node onto the detail section of the report. This action creates a TextBox
object, and sets its DataField property to the name of the calculated field.
Note: You can also add C# expressions in a Bound Field's DataField property to modify it. See Add Field
Expressions for more information.
Note: These steps assume that you have added a DataSet in your report. See Add a Dataset for further
information.
1. In the Report Explorer, right-click the data set node and select Edit.
2. In the DataSet dialog that appears, go to the Fields page and click the Add (+) button to add an empty
3. Under Name, enter the name of the field. By default it appears as Field1.
4. Under Value, click the dropdown arrow and select <Expression...>, to open the Expression Editor dialog.
5. In the Expression Editor dialog, create an expression you want to use as the value for the calculated field.
For e.g., for a calculated field Cost, in the Formula field, enter the expression =[Quantity]*[Price]. See
Expressions for further information.
6. Click OK to close the Expression Editor and then the DataSet dialogs.
7. From the Report Explorer, drag the calculated field from that now appears as a field under the DataSet
node onto the design surface. This action creates a TextBox object, and sets its Value property to the name
of the calculated field expression.
Note: You may also check the Print page border or Auto-Rotate Pages check box for further
customization of your print setup.
When you print to PDF, the exceptions that occur at printing cannot be caught. Thus, if there is a printing
exception, no Print dialog appears after you click the Print button.
Note: You might need to update the Version and PublicKeyToken values to reflect the current version
of ActiveReports installed on your machine. You can find the Version and PublicKeyToken values in the
Global Assembly Cache (GAC), C:\Windows\assembly.
To write code in C#
C# Code. Paste to MainPage.xaml.cs to the viewer1_Loaded event.
viewer1.PdfPrint = true;
Viewer.Print method
The code sample illustrate how to access the the print method using the Viewer conrol.
You can use the Print ('Print Method' in the on-line documentation) method of the Viewer class to print a
report loaded in the Viewer control. Make sure that the report is loaded completely before Print is executed.
Visual Basic.NET code. Add this code INSIDE the LoadCompleted event of the Viewer
Viewer1.Print(True, True, True)
C# code. Add this code INSIDE the LoadCompleted event of the Viewer
viewer1.Print(true, true, true);
Note: The Print ('Print Method' in the on-line documentation) method is implemented as an extension
method of the PrintExtension.Print ('Print Method' in the on-line documentation) method, which is
present in Grapecity.ActiveReport namespace of GrapeCity.ActiveReports.Viewer.Win.v9 assembly.
In order to access Print ('Print Method' in the on-line documentation) method through
SectionDocument or PageDocument class, you need to add GrapeCity.ActiveReports.Viewer.Win.v9 reference
to the project. Also, as mentioned in the code, make sure that you add a reference for the
GrapeCity.ActiveReports namespace in your project using Imports (Visual Basic.NET) or using (C#)
statement.
Section Report
Visual Basic.NET code. Paste at the top of the code view.
Imports GrapeCity.ActiveReports
Page Report
Visual Basic.NET code. Paste at the top of the code view.
Imports GrapeCity.ActiveReports
Note: The Print ('Print Method' in the on-line documentation) method is implemented as an extension
method of the PrintExtension.Print ('Print Method' in the on-line documentation) method, which is
present in Grapecity.ActiveReport namespace of GrapeCity.ActiveReports.Viewer.Win.v9 assembly.
In order to access Print ('Print Method' in the on-line documentation) method through
SectionDocument or PageDocument class, you need to add GrapeCity.ActiveReports.Viewer.Win.v9 reference
to the project. Also, as mentioned in the code, make sure that you add a reference for the
GrapeCity.ActiveReports namespace in your project using Imports (Visual Basic.NET) or using (C#)
statement.
Section Report
Visual Basic.NET code. Paste INSIDE an event like Button_Click.
GrapeCity.ActiveReports.PrintExtension.Print(sectionDocument, True, True)
Page Report
Visual Basic.NET code. Paste INSIDE an event like Button_Click.
GrapeCity.ActiveReports.PrintExtension.Print(pageDocument, True, True)
Samples
Learn about the samples provided with the ActiveReports installation standard and professional editions. The
samples folder is located at the following location:
[User Documents folder]\GrapeCity Samples\ActiveReports 9
Each sample has a C# and a Visual Basic.NET version for Visual Studio 2010 and 2012. You can also see the
comments within the sample projects throughout code.
This section contains information about:
HTML5 Viewer Sample
This sample demonstrates the HTML 5 Viewer with its various options of loading Basic or Customized UI and Page,
RDL and RDLX reports.
Page Reports And RDL Reports
This section provides information on each of the Page report and RDL report sample provided with the
ActiveReports installation.
Professional
This section provides information on each of the sample provided with the ActiveReports professional edition
installation.
Reports Gallery
This section provides information on Page, RDL and Section reports provided with the ActiveReports installation.
Section Reports
This section provides information on each of the Section report sample provided with the ActiveReports
installation.
Standard Edition Web
Demonstrates exporting an ActiveReports report to the HTML or PDF format in your Web application.
WPF Viewer
Demonstrates the WPF Viewer and its options to view rdlx and rpx reports.
Basic UI
Custom UI
Sample Location
<User Folder>\GrapeCity Samples\ActiveReports 9\HTML5 Viewer
Runtime Features
When you run the sample, the index.html containing the HTML5 Viewer appears on your browser with the following
options to choose from:
Basic or Custom UI Viewer
The Basic UI Viewer appears by default with an option of switching to Custom UI Viewer by clicking the Custom
UI option.
The Custom UI option loads the CustomUI.html in the browser. On the Custom UI Viewer page, you can click
on any Genre category button to pass parameter to the MoviesReport.rdlx report and load the report in the
viewer specific to the passed parameter value.
While working on the Custom UI Viewer, you can always switch back to the Basic UI Viewer by clicking the Basic
option.
Choose Report: Page Report, RDL Report , RPX Report and Code-based Report
These options are a part of the Basic UI Viewer. Click on any of these buttons to load a report of specific format.
Choose UI Type: Desktop or Mobile
These options are a part of the Basic UI Viewer and are related to the Viewer report preview area. When you run
this project, the HTML5 Viewer Desktop UI appears in the browser by default. You can switch to the HTML5 Viewer
Mobile UI by clicking the Mobile button.
Project Details
Css folder
The Css folder contains the following css files that store styles for the HTML5 viewer application:
bootstrap.css
GrapeCity.ActiveReports.Viewer.Html.css
site.css
theme-cosmo.css
Create Report
The Create Report sample demonstrates how to create a RDL report using code and display it in the ActiveReports
Designer.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Page Reports And RDL Reports\API\CreateReport\VB.NET
C#
Note: To run this sample, you must have access to the Reels.mdb. A copy is located at [User Documents
folder]\GrapeCity Samples\ActiveReports 9\Data. If you are unable to access the data files in the
sample, create the Data folder and place all the data files to this folder, or change the reference path to the
data files within the folder according to your environment.
Project Details
ReportsForm
This is the main form of the sample that contains the Designer, ReportExplorer, PropertyGrid, Toolbox and ToolStrip
controls, used to create the ActiveReports Designer at runtime. See Creating a Basic End User Report Designer (Pro
Edition) for information on creating a basic ActiveReports Designer.
Right-click the form and select View Code to see how to set up the Designer and attach the ReportExplorer,
PropertyGrid and Toolbox controls to it. It also contains code that loads a layout created in
the LayoutBuilder class to a page report object; then loads the page report object to a stream, which is loaded to
the Designer.
Constants
This file is an internal class that contains string values that are required for creating a dataset of the report.
LayoutBuilder
This file is an internal class that contains code for creating a RDL report layout and adding a data source and a
dataset to it.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Page Reports And RDL Reports\API\CustomResourceLocator\C#
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Page Reports And RDL Reports\API\CustomResourceLocator\VB.NET
Runtime Features
When you run this sample, you see the MainForm with the list of images from the My Pictures directory. Select any image
and click the Show Report button. A report with the selected image opens in the PreviewForm.
Caution: To run this sample properly, you must have image files in your My Pictures directory. If the directory does
not contain any pictures, you should add them to the folder manually.
Project Details
Resources folder
DataSet DataSource
The DataSetDataSource sample demonstrates how to use the API to load the report and to set the report's dataset at
runtime.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Page Reports And RDL Reports\API\DataSetDataSource\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Page Reports And RDL Reports\API\DataSetDataSource\C#
Runtime Features
When you run this sample, the MainForm with the ActiveReports Viewer appears. The Viewer displays the Parameter
pane and the DataGrid control containing the report data in the left part of the Viewer. Set the parameters and click
the View Report button to display the report.
Also, the Viewer toolbar contains the custom export button that opens the ExportProperties form where you can set up
the options for exporting the displayed report to a specified format.
Project Details
Constants
This file is an internal class that contains string values that are required for creating a dataset of the report.
DataLayer
Layer
The Layer sample demonstrates how to work with Layers in four different reporting scenarios.
Sample Location
Runtime Features
Project Details
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Page Reports And RDL
Reports\API\Layer\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Page Reports And RDL
Reports\API\Layer\C#
Runtime Features
When you run this sample, the End User Designer shows a list of .rdlx reports on the bottom left of the form.
Expand the Reports node to view reports under it and double-click a report to load it into the designer. Once the
report is loaded in the designer, a Layers List window showing all the Layers used in the report is displayed as a
tab next to the Report Explorer tab. See Working with Layers for further details on the Layers List window.
Project Details
ReportForm
This is the main form that appears when you run the Layers sample. This form uses controls such as Designer,
ReportExplorer, LayerList, Toolbox, PropertyGrid, ToolStripPanel, ToolStripContentPanel and TreeView to create a
customized report designer.
Right-click the form and select View Code to see how to set up the report designer. It also contains code that
adds reports to the TreeView control, loads a report into the Designer when it is double-clicked in the Reports
node, and shows the Layer List window if the report type is Page or RDL.
Reports Folder
AccountStatementSheet.rdlx: This report uses the XML data source connection to provide custom data.
Controls such as Image, FormattedTextBox, Table and Label are used to display the statement of an account
holder. The FormattedTextBox control contains text in HTML tags to display the content.
This report is contains three Layers besides the Default Layer with the following controls and TargetDevice
settings.
Layer2 Screen, Paper Contains a FormattedTextBox control to display the account information of
the account holder.
Layer3 All Contains a Table data region and an OverflowPlaceHolder control to display
the account transactions.
SalesRevenueReport.rdlx: This report uses the Reels shared data source connection to provide the data. The
layout of the report uses a Chart data region to graphically display sales and profit for each month
and two Table data regions to display the chart data. The first Table data region (Layer2) contains the sales
revenue for each month and the second Table data region (Layer3) lists down the detailed figures for the monthly
sales along with a DataBar to visually depict the profits.
This report contains three Layers besides the Default Layer with the following controls and TargetDevice settings.
SchoolStudentReportCard.rdlx: This report uses the XML data source connection to provide custom data. This
report includes an Image control that acts as a background layout of the report. It also includes a few TextBox
controls to display the name and the grades obtained by the student.
This report contains two Layers besides the Default Layer with the following controls and TargetDevice settings.
UserConferenceLabels.rdlx: This report uses the Nwind shared data source connection to provide data. This
report uses the Image, TextBox, BarCode and Label controls to create a layout for the User Conference 2014
ticket.
This report contains two Layers besides the Default Layer with the following controls and TargetDevice settings.
Normalized DataSet
The Normalized DataSet sample demonstrates how to access relational data in reports, using the DataSet, Object or XML
providers. This sample uses the same data in all three reports bound to the relational data providers.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Page Reports And RDL Reports\API\NormalizedDataSet\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Page Reports And RDL Reports\API\NormalizedDataSet\C#
Runtime Features
When you run this sample, the Relational Data Sampler form appears. Select a provider in the left pane and click the
Display Sample button located below the left pane to see a sample report appear in the ReportsForm Designer form.
You can see the description of the each provider and its related sample report as you select the provider in the left pane of
the form.
Project Details
Explanations folder
This folder contains DataSetProvider.rtf, ObjectDataProvider.rtf and XmlDataProvider.rtf files that provide descriptions for
the corresponding provider and its sample report. This is the description that the Relational Data Sampler form
displays when you run the sample and select a provider.
Constants
This file is an internal class that contains string values required for creating a dataset for the report. It also contains the
sample description text that the label on the main form displays.
DataLayer
This file is an internal class that contains code to read data from the Reels database and load it in a normalized dataset.
DataSetReport
This is the sample report that is bound to the DataSet provider. This report uses an ADO.Net dataset to obtain data for the
report. At runtime, the report is displayed in ReportsForm Designer after you select DataSet Provider in the list of
providers on the main ReportSelector form and click the Display Sample button.
ObjectReport
This is the sample report that is bound to the Object provider. This report uses a collection of business objects to obtain
data for the report. At runtime, the report is displayed in ReportsForm Designer after you select Object Provider in
the list of providers on the main ReportSelector form and click the Display Sample button.
XmlReport
This is the sample report that is bound to the XML provider. This report uses the XmlReader to obtain data for the report.
At runtime, the report is displayed in ReportsForm Designer after you select XML Provider in the list of providers on
the main Relational Data Sampler form and click the Display Sample button.
XmlDB
This is an XML database file included in this sample to provide data for the reports.
ReportSelector
This is the main form that is displayed at runtime. This form uses the Label, ListBox and Button controls docked to the left
and the RichTextBox control docked to the right. The Label control displays description of the sample, the Listbox control
displays the list of three data providers at runtime. The Button control is used to display the corresponding sample report
in the ActiveReports Designer.
Right-click the form and select View Code to see how to add the three sample reports in an array to display in the listbox
and have the ActiveReports Designer display the report when you double-click the provider in the list or when you
click the Display Sample button.
ReportsForm
This form appears when you click the Display Sample button on the main Relational Data Sampler form after selecting
a data provider in the listbox. This form uses the ToolStripPanel, the ToolStripContentPanel, the Designer, the Toolbox,
the ReportExplorer and PropertyGrid controls to create the Unified ReportDesigner.
OleDb DataSource
The OleDB Data Source sample demonstrates how to use the OleDb data provider for binding a report to data.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Page Reports And RDL Reports\API\OleDbDataSource\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Page Reports And RDL Reports\API\OleDbDataSource\C#
Runtime Features
When you run this sample, the MainForm with the ActiveReports Viewer appears. The Viewer displays the report with
the list of movies, their ratings and the release year information.
Note: To run this sample, you must have access to the Reels.mdb. A copy is located at [User Documents
folder]\GrapeCity Samples\ActiveReports 9\Data. If you are unable to access the data files in the sample,
create the Data folder and place all the data files to this folder, or change the reference path to the data files
within the folder according to your environment.
Project Details
DataLayer
This file is an internal class that contains code to create a data connection. It creates the OleDb data reader to read
data from the Reels database and add it to an array to provide data for the report.
MainForm
This is the main form that appears when you run this sample. It uses the ActiveReports Viewer control to display the
report at runtime.
Right-click the form and select View Code to see how to load and show the report at runtime.
OleDBReport.rdlx
This is the report that gets displayed in the Viewer at runtime.
The report uses the header with the Textbox to display the report heading and the footer with the Textbox to display
the page number information. The body of the report has the Table data region to display data obtained from the OleDb
data provider. For that, the Textbox controls of the Table are bound to the OleDB data source in the Value property.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Page Reports And RDL Reports\API\PageUnboundData\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Page Reports And RDL Reports\API\PageUnboundData\C#
Runtime Features
When you run this sample, the Invoice2.rdlx report is displayed in the Viewer control. The report displays the Invoice
form with the list of products along with the product ID, quantity and price of the products.
The report connects to an unbound data source at runtime using the LocateDataSource event and the DataSet provider.
Project Details
Invoice2.rdlx
In the Report Data Source dialog, the type of the report data source is set to DataSetProvider and the ConnectionString
is left blank. In the DataSet dialog, data fields used on the report are added to the DataSet on the Fields page.
This report uses the Table, TextBox, Label and Shape controls to create an Invoice layout for displaying the customer
transactions. The Container control at the bottom of the report contains a label, a textbox and line control. The textbox
uses the Sum function to display the sum of the values returned by the expression indicated in the Value property.
ViewerForm
This is the main form that appears when you run this sample. It uses the ActiveReports Viewer control to display the
report at runtime. The code-behind the form contains the code with the LocateDataSource event that connects the
Invoice2.rdlx report to unbound data and the code that populates fields for the data table.
Report Wizard
The Report Wizard sample demonstrates how to create and customize a report, using the report wizard.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Page Reports And RDL Reports\API\ReportWizard\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Page Reports And RDL Reports\API\ReportWizard\C#
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Page Reports And RDL Reports\Data\XmlDataSource\VB
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Page Reports And RDL Reports\Data\XmlDataSource\C#
Runtime Features
When you run this sample, you will see the MainForm appear. The MainForm contains the ActiveReports Viewer
that displays a report with data from the xml data provider.
Project Details
BandedListXML.rdlx
This is the main report that gets displayed in the Viewer at runtime. It uses the BandedList and Textbox controls,
and the Subreport control inside the BandedList data region to display data.
The BandedList data region uses two groups to group the report data by the fields City and Country.
The Subreport control, placed in the GroupFooter section of the BandedList, displays the CountrySales report.
CountrySales.rdlx
This is the report that gets displayed by the Subreport control of the BandedListXML report.
It uses the Chart data region to display data. The Chart Type property is set to Doughnut (Pie Exploded
Doughnut), which shows the analysis of companies sales amount for different countries.
Professional
This section provides information on each of the sample provided with the ActiveReports professional
edition installation.
This section contains:
Active Reports Web Pro
Note: Before running this sample, in the Solution Explorer, click the Licenses.licx file and then, from the
Build menu, select Build Runtime License. Please see To license Web Forms projects made on the trial
version for details.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Professional\ActiveReportsWebPro\VB.NET
HTTPHandlers
This link opens the HttpHandlers.aspx page with the http handler examples.
Note: To run this sample, you must have access to the Nwind.mdb. A copy is located at [User Documents
folder]\GrapeCity Samples\ActiveReports 9\Data\NWIND.mdb. If you are unable to access the data
files in the sample, create the Data folder and place all the data files to this folder, or change the reference
path to the data files within the folder according to your environment.
Project Details
CodeReports
The CodeReports folder contains the following reports - Invoice, InvoiceFiltered, NwindLabels and
NwindLabelsFiltered.
The code reports are used to demonstrate how the ActiveReports Compiled Report HttpHandler functions. For more
details, see HttpHandlers.aspx below.
images
The images folder contains the logo.png. This image file is used in the header of the FlashViewerIntro.aspx page.
PageReports
The PageReprorts folder contains the Invoice_Grouped and PurchaseReport report.
RDLReports
The RdlxReports folder contains the SalesReceipt report.
RPXReports
The RpxReports folder contains the following reports - Invoice, InvoiceFiltered, NwindLabels,
NwindLabelsFiltered and Params.
The Invoice.rpx report is used to demonstrate the Web Viewer control options and is opened by clicking
WebControl for ASP.NET on the Default.aspx page. This report is also opened by clicking the Custom
Exporting PDF Example option on the Default.aspx page. For detailed information on the Invoice report, see the
Cross Section Control Sample.
The NwindLabels report is opened by clicking the Custom Exporting HTML Example option on the Default.aspx
page.
The Params report is used by the ParameterReport.aspx page to demonstrate how to generate a report by passing
a parameter to the report.
All reports from this folder are used to demonstrate the Flash Viewer options. You can select one of these reports
from the list on the FlashViewer.aspx page.
Themes
The Themes folder contains themes to use on the Flash Viewer. Following themes can be used for the Flash
Viewer.
FluorescentBlue.swf
Office.swf
Note: This sample requires write permissions to the ReportOutput folder that is located in the web samples
directory.
CustomExportPdf.aspx
This Web form is displayed by clicking the Custom Exporting PDF Example option on the Default.aspx page. In
CustomExportPdf.aspx, the Invoice report is exported to memory stream and then outputted in the browser.
Note: This sample requires write permissions to the ReportOutput folder that is located in the web samples
directory.
CustomHtmlOutput class
This class is used for exporting a report to the HTML format. The CustomHtmlOutput class implements the required
IOutputHtml in the HTML export and saves the output results to a file with a unique name.
Default.aspx
This is the main Web form of the sample that shows the introductory text and links to the following sample pages.
WebControl for ASP.NET (WebControl.aspx)
FlashViewer Control (FlashViewerIntro.aspx)
HTTPHandlers (HttpHandlers.aspx)
Custom Exporting PDF Example (Invoice report)
Custom Exporting HTML Example (NWindLabels report)
Parameterized Report Example(ParameterReport.aspx)
FlashViewer.aspx
This is a web form with the Web Viewer that is displayed after you click the View Report button on
the ActiveReports9 Flash WebViewer Sample.
In the Properties window, notice that the ViewerType property is set to FlashViewer, and the Height and
Width properties are set to 100%. (This ensures that the viewer resizes to fill the browser window.)
For information on the Flash Viewer, see Using the Flash Viewer.
FlashViewerIntro.aspx
This web form displays the introductory text for the ActiveReports 9 Flash WebViewer Sample. On this page, you
can adjust the Flash Viewer settings, select a language, a theme and a report for the Flash Viewer from the drop-
down lists. The report is opened in the Flash Viewer by clicking the View Report button that you see on this page.
This sample uses the reports from the RPXReports folder of the Sample project.
Right-click the file and select View Code to see the code used to populate the Themes drop-down list and to
redirect to the FlashViewer form.
Grapecity.ActiveReports.Flash.v9.Resources.swf
ParameterReport.aspx
The web form that demonstrates how to generate a report by passing a parameter to the report. This sample uses
the Params report from the RpxReports folder of this Sample project.
The date list is created by changing the SQL query of the report at runtime. In this sample, when the date is
selected from the Calendar control, the SQL query is updated and the report is generated. The report is generated
dynamically in the SelectedIndexChanged event of the Calendar control.
On this form, you can select the Viewer to display the report - HTML, Flash, AcrobatReader, or RawHTML.
Note: This sample requires write permissions to the ReportOutput folder that is located in the web samples
directory.
Web.config
The configuration file that contains the httpHandlers that allow ActiveReports to process reports on the Web.
Note that you need to manually update version information here when you update your version of ActiveReports.
WebControl.aspx
This page is opened by clicking WebControl for ASP.NET on the Default.aspx page. By default it displays the
Web Viewer control with the Invoice report.
In this page, you can select from HTMLViewer, FlashViewer, AcrobatReader, RawHtml viewer types and can
also select from Page, Section and RDL report types to be displayed.
Note: Before running this sample, you must first install the ASP.NET MVC 3 framework on your machine.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Professional\ActiveReportsWithMVC\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Professional\ActiveReportsWithMVC\C#
Runtime Features
When you run the project, the page with the Customer Index view appears. On this page, you can click a
customer in the list to open a new page with the Customer Details information. At the bottom of the page, there
are two links - Freight Summary (section report) and Order Summary (page report). Clicking the Freight
Summary (section report) link opens a page with the OrderReport report. Clicking the Order Summary
(page report) link opens a page with the OrderDetailsReport.rdlx report.
Project Details
Controllers
This folder contains the HomeController that handles the user interaction and returns the main Index view, the
CustomerDetails view and the views with Freight Summary (section report) and Order Summary (page report).
DBContext
This folder contains the NWindData class that gets the Customer, Orders, Order Details tables of the NWIND.mdb
and populates the data into the components of this sample project.
Models
This folder contains the following classes.
Customer - a container for the rows in the Customers table of NWind.mdb.
Order - a container for the rows in the Orders table of NWind.mdb.
OrderDetails - a container for the rows in the Order Details table of NWind.mdb.
ReportDescriptor - the class representation of the ReportType (section or page layout) and the CustomerID.
Repository - a container for data required by the application.
Reports
OrderDetailsReport.rdlx: This report uses the object provider to connect to data at runtime. It uses the
Table data region to display order details and the Plain Line chart to display sales by order id. The Table data is
grouped by OrderID. Some TextBox controls of the Table use the Sum function to display the total price
information for each order.
This is the report that opens in a separate view when you click the Order Summary (page report) link on the
Customer Details page.
OrderReport: This report binds to data at runtime. The report uses the Textbox and Label controls to display the
CustomDataProvider
The Custom Data Provider sample demonstrates how to create a project that use a custom data provider and
how to pull data from a comma separated value (CSV) file. This sample is part of the ActiveReports Professional
Edition.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Professional\CustomDataProvider\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Professional\CustomDataProvider\C#
Note: CustomTileProvider is for use with the Professional Edition license only. An evaluation message is
rendered when used with the Standard Edition license.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Professional\CustomTileProvider\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Professional\CustomTileProvider\C#
Runtime Features
When you run this sample, the ActiveReports End User Designer appears with an overlaying Help-Creating a
Custom Tile Provider dialog. This dialog gives you step-by-step instructions to create a new tile provider for a
Map control with custom settings.
The End User Designer displays a RDL report containing a Map control with MapQuest set as the default tile
provider. To change the existing tile provider, double-click on the Map control to display the existing tile layer and
right click to select Edit. In the Map Tile Properties - General dialog that appears, click the Provider drop-
down to select the tile provider you want to apply to the Map control. Go to the Preview tab to view the data in the
selected tile provider. You can choose from the following tile provider options:
Google-Sample
Cloud-Made Sample
MapQuest-Sample
OpenStreetMap-Sample
Note: The Microsoft Bing Map server offers static map images. This requires an Application key for
authentication. The default key provided by ActiveReports is for demo purpose and can not be used by 3rd
party applications. In order to obtain a Bing Map Key, see HowTo - Create a Bing Map Account and HowTo -
Generate a Bing Map Key.
Project Details
Digital Signature
This sample demonstrates how you can digitally sign or set time stamp for a section report when exporting it
to PDF format.
Note: PDF digital signatures is for use with the Professional Edition license only. An evaluation message is
rendered when used with the Standard Edition license.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Professional\DigitalSignature\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Professional\DigitalSignature\C#
Runtime Features
When you run this sample, the Invoice report is displayed in the Viewer control.
Clicking the Generate Digitally Signed PDF button in the Viewer toolbar creates a PDF file with a time stamp or
digital signatures, based on the settings you have specified in the Viewer toolbar. You can change the content of
signatures in the Signature Format box and you can add the time stamp to the generated pdf file by checking
the Set TimeStamp checkbox, in the Viewer toolbar.
When you click the Generate Digitally Signed PDF button, a dialog for saving the destination file appears. After
you indicate the location for a new PDF file, the PDF report file is created. Digital signature certificates dynamically
reference and use GrapeCity.pfx, included in the project. Also, digital signatures dynamically load and use the
gc.bmp file that you can find in the Image folder of this sample project.
Note: To run this sample, you must have access to the Nwind.mdb. A copy is located at [User Documents
folder]\GrapeCity Samples\ActiveReports 9\Data\NWIND.mdb. If you are unable to access the data
files in the sample, create the Data folder and place all the data files to this folder, or change the reference
path to the data files within the folder according to your environment.
Project Details
Image folder
This folder stores the gc.bmp file with the GrapeCity logo that digital signatures dynamically load and use.
Invoice report
The Invoice report is the Sample report that uses three GroupHeader sections, a Detail section and a GroupFooter
section as well as a label in the PageFooter section to display data.
See The Bound Data Sample topic for details on the Invoice report.
GrapeCity.pfx
In order to create a digital signature, you must have a valid PKCS#12 certificate (*.pfx) file.
For information on creating a self-signed certificate, see the Adobe Acrobat Help topic "Create a self-signed digital
ID."
You can also create a PFX file from the Visual Studio command line. For more information and links to SDK
downloads, see http://www.source-code.biz/snippets/vbasic/3.htm.
PDFDigitalSignature form
This is the main form of the Sample that uses the ActiveReports Viewer control in the bottom section of the form,
and a panel docked to the top contains the Create Digitally Signed PDF button, the Signature Format box with
the drop-down list and the Set TimeStamp checkbox.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Professional\EndUserDesigner\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Professional\EndUserDesigner\C#
Runtime Features
When you run the sample, the End User Designer appears in the Viewer control. This report designer provides the
functionality of the ActiveReports Designer and supports three types of report layouts: Page Report, RDL
Report and Section Report.
The End User Designer lets you create report layouts and edit them at design time or runtime. The
Designer includes the Property Window with extensive properties for each element of the report, the Toolbox is
filled with report controls and the Report Explorer with a tree view of report controls. Page reports and RDL
reports provide the Layer List in a tabbed window with the Report Explorer. The Layer List window displays a list of
layers in the report along with their visibility and lock options.
The End User Designer provides the following menu items:
File menu
New - Creates a new report in the designer with the default report template.
Open - Opens Open File Dialog to load a report.
Open from server - Opens Open report from server dialog to open reports from the ActiveReports
Note: Except for View option, all other options in Report menu are disabled for a Section report.
For more information on the Designer features, please see ActiveReports Designer.
Project Details
ExportForm
This is the form with the Export dialog for Page report, Rdl report and Section report.
A user sees the Export dialog under the Preview tab in the File menu > Export. This dialog allows to select the
export type and to browse for the file location in local folders where the report is exported. See Exporting for
details on the type of export formats supported in Section report, Page report and RDL report.
ExportForm controls
Right-click the ExportForm in the Solution Explorer and select View Code to see the code implementation for the
Export form.
EndUserDesigner form
This is the form with a basic end-user report designer that contains the following elements. These elements are
dragged from the Visual Studio toolbox onto the form.
End User Designer controls
Right-click the EndUserDesigner form in the Solution Explorer and select View Code to see the code
implementation for the End User Designer.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Professional\Map\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Professional\Map\C#
Runtime Features
When you run this sample, the End User Designer shows a list of .rdlx reports at the bottom left of the
form. Expand the Reports node to view reports under it and double-click a report to load it into the designer.
Project Details
Report Form
This is the main form that appears when you run the sample. This form uses the ToolStripPanel,
ToolStripContentPanel, Designer, Toolbox, ReportExplorer and PropertyGrid controls to create a customized
ReportDesigner.
Right-click the form and select View Code to see how to set up the designer and create a blank page report. It
also contains code that adds the reports to the TreeView control, loads a report into the Designer when the report
is double-clicked, and checks for any modifications that have been made to the report in the designer.
Reports Folder
OilProducingCountries.rdlx: This report uses the FactBook shared data source connection to provide data.
It contains a Map control that visually displays the oil production in different countries of the world on a virtual
earth background. The map control uses the color rule set on a polygon layer to differentiate parts of
world according to their oil production capacity. These colors are defined using a color rule which is described in
the legend at runtime.
RomePlaces.rdlx: This report contains a Map control that visually displays famous places in Rome.
The map control uses Google maps in a Tile layer to provide a virtual earth background and a Point layer to plot
famous places on the map using image markers. Clicking the image marker opens the web page for the selected
place in Wikipedia.
StoreSales.rdlx: This report contains a Map control that visually displays the sales of different stores in the US.
The Map control uses the built-in USA map template. The polygon layer defines the country and state boundaries
while the point layer is used to plot store locations. The Point layer uses the marker size rule to differentiate
Silverlight Viewer
The Silverlight Viewer sample demonstrates the Silverlight Viewer with its various options of loading RPX,
RDLX and RDF reports. This Sample is part of the ActiveReports Professional Edition.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Professional\SilverLightViewer\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Professional\SilverLightViewer\C#
Runtime Features
When you run the project, the MainPage.xaml page with the Silverlight Viewer displaying the
MainReport.rpx appears in your browser, and you will see a number of report options that the Silverlight Viewer
will display.
RDF
RDLX
RPX
Code
Project Details
Images
The Images folder contains images that are used in the header of the ActiveReports 9 Silverlight Viewer, including
the images for the buttons to load and display an RDF, an RDLX, an RPX and a Code report in the Silverlight
Viewer.
MainPage.xaml
The user control that contains the Silverlight Viewer. The code behind this file, MainPage.xaml.vb (or .cs), handles
the customization of the Silverlight Viewer application.
It contains code that handles the display of RDF, RDLX, RPX, and Code reports in the ActiveReports 9 Silverlight
Viewer.
SilverlightViewer.Web Project
Reports
Table of Contents
The TableofContents sample demonstrates basic features of the TableofContents control. This sample is part of the
ActiveReports Professional Edition.
Sample Location
Runtime Features
Project Details
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Professional\TableOfContents\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Professional\TableOfContents\C#
Runtime Features
When you run this sample, the End User Designer appears with a MovieCatalog.rdlx under the Reports node. The
report contains a TableOfContents control which displays a list of movie titles along with their page numbers under
each genre. On clicking the movie title, the details on the selected movie are displayed.
Project Details
Report Form
This is the main form that appears when you run this sample. This form uses the ToolStripPanel, LayerList,
TreeView, ToolStripContentPanel, Designer, Toolbox, ReportExplorer and PropertyGrid controls to create a
customized ReportDesigner.
Right-click the form and select View Code to see how to set up the designer. It also contains code that adds the
reports to the TreeView control, loads a report into the Designer when it is double-clicked, and checks for any
modifications that have been made to the report in the designer.
Note: Before running this sample, you must first install the ASP.NET MVC5 framework on your system.
Sample Location
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Professional\ActiveReportsWithMVC5WebAPI\C#
Runtime Features
When you run the sample, the page with the main view appears. On the left side of the main view, you can click a
customer name under the Customer List. On the right side of the main view, you have the Customer Info tab
and the Reports tab. Following options are available on this page.
Customer List
Displays a list of customer names. You can use the search box on the top to search for customer names.
Customer Info tab
Displays details of the customer name selected from the customer list.
Reports tab
Displays a report for the selected customer in the HTML5 Viewer. You can choose from the following
options.
Choose Report: You can choose from Orders report (Page Report) or Product Details
(Section Report). The selected report is displayed in the HTML5 Viewer.
Choose UI type: You can choose from Desktop or Mobile options. The default mode is set to
Desktop. On selecting the Mobile UI type, the layout adapts itself to the mobile device
display.
Project Details
App_Start folder
This folder contains the following cs files that are required to run the application.
BundleConfig.cs
FilterConfig.cs
This folder contains the HomeController and CustomersController files. The HomeController handles the user
interaction and returns the main view. The CustomersController handles the customer details information that is
displayed when a customer is selected.
css folder
The css folder contains the following css files that store styles for the HTML5 viewer application.
GrapeCity.ActiveReports.Viewer.Html.css
theme-cosmo.css
Fonts folder
The fonts folder contains the following font files to provide styles to the text that gets displayed in the HTML5
viewer at runtime.
glyphicons-halflings-regular.eot
glyphicons-halflings-regular.svg
glyphicons-halflings-regular.ttf
glyphicons-halflings-regular.woff
Models
This folder contains the following classes.
Customer - Contains information for the rows in the Customers table of Reels.mdb.
CustomerContext - Contains information for the rows in the CustomerOrders table of Reels.mdb.
Reports
OrderDetailsReport.rdlx: This page report loads in the HTML5 Viewer when you select the Orders report for the
Desktop UI type. This report uses the Table data region to display the order details. The Sum function is used to
display the totals.
ProductDetail.rpx: This section report loads in the HTML5 Viewer when you select Product Details for the
Desktop UI type. This report uses the Textbox and Label controls to display the data. The Sum function is used to
display the total price information for each customer order.
Scripts folder
The Scripts folder contains the following javascript files and its dependencies required to build this application.
bootstrap-3.0.0.js
GrapeCity.ActiveReports.Viewer.Html.js
jquery-1.10.2.js
knockout-2.3.0.js
Views folder
Home folder
The default view start file.
Index.cshtml: The Index view file.
Reports Gallery
The Reports Gallery sample demonstrates how to customize the End User Designer application by adding the
TreeView control to display a list of categorized reports. At runtime, the user can double-click any report out of the
three categories: Page, Rdl and Section, and load it into the designer.
Sample Location
Runtime Features
Project Details
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Reports Gallery\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Reports Gallery\C#
Project Details
ReportsForm
This is the main form that appears when you run this sample. This form uses the ToolStripPanel,
ToolStripContentPanel, Designer, Toolbox, ReportExplorer, TreeView, PropertyGrid and LayerList controls to create
a customized unified ReportDesigner.
Right-click the form and select View Code to see how to set up the designer and create a blank page report. It
also contains code that attaches the Toolbox, ReportExplorer, PropertyGrid and LayerList controls to the Designer,
inserts DropDown items to the ToolStripDropDownItem and sets their functions. Finally, it also contains code that
adds the reports to the TreeView control, loads a report into the Designer when the report is double-clicked, and
checks for any modifications that have been made to the report in the designer.
Reports folder
Reports folder consists of three subfolders - Page Report, RDL Report and Section Report, each containing a set of
reports that highlight the major features of the corresponding report types.
This report uses the NWind shared data source. It is used as a child report for the AllCustomers report. It uses
the Table data region to display the customer orders. This report opens when the user clicks any CustomerID
link in the AllCustomers report. The Textbox displaying the OrderID field in the detail row of the Table is used to
set a drill-through link to navigate to the OrderDetails report.
OrderDetails report
This report uses the NWind shared data source. It is used as a child report for the CustomerDetails report. It
uses the Table data region to display order details when the OrderID link in the CustomerDetails report is
clicked.
Invoice folder
BillingInvoice report
This report uses the NWind shared data source. It showcases a billing invoice layout commonly used in
convenience stores. The report mostly contains Label, TextBox and Line controls in its layout. It also includes an
EAN128FNC1 barcode due to its high reading accuracy.
Invoice_Grouped report
This report uses the NWind shared data source. It uses the Table, few TextBox and Label controls to display
customer transactions in an Invoice. The data is grouped on the CustomerID field, so that all transactions made
by a customer appear together based on their ID.
Invoice_Parameters report
This report uses the NWind shared data source connection and two datasets to provide data. It is similar to the
Invoice_Grouped report with an additional parameters feature. It uses parameters set on the CompanyName
This report uses the NWind shared data source. It includes a BandedList and few TextBox controls to create the
Invoice layout for displaying customer transactions. Both the page and the BandedList control are grouped by the
OrderID field. One of the textboxes in the footer section of the BandedList control uses the Sum function to
display the grand total of all transactions.
Invoice2 report
This report uses the NWind shared data source. It uses a Table, few TextBoxes and Shape controls to create the
Invoice layout for displaying customer transactions. The report page is grouped by the CustomerID field,
therefore all transactions made by a customer appear together based on the ID. One of the textboxes placed
inside the Container control at the bottom of the report uses the Sum function to display the grand total of all
transactions.
Other folder
BarCode report
This report demonstrates all barcode types that are supported by ActiveReports. The barcode types are presented
in the Table data region, using a single page layout. The rows of the table use alternate background colors (grey
and white). At runtime, the Barcode report displays one page that fits the table with all the sample barcodes.
Catalog report
This report uses the NWind shared data source. It shows a multi page layout spread over four pages in the report.
The layout in Page1 and Page2 contains Image, Label and Textbox controls to display introductory text. The
layout on Page3 contains a List data region with TextBox controls and a Table to display product details for each
product category. The List is grouped by the CategoryID field to filter products by their category and its FixedSize
property is set to fit in excess data. The layout on Page4 (that appears as page 9 at runtime) uses Textbox,
Shape and Line controls amongst others to create an Order Form, which a user is to fill manually.
CellMerging report
This report uses the NWind shared data source. It demonstrates cell merging in a Matrix data region, where cells
with same values are merged automatically to avoid showing duplicate values.
DeliverySlip_theme report
This report uses the Seikyu2 shared data source. It uses the TextBox, Label, Container controls and two Table
data regions to display the invoice information. The report uses two themes and has its CollateBy property set to
ValueIndex to determine the order in which the report pages are rendered. Some TextBox controls on the report
also use the Sum function to display the total price information for each Invoice. The page is grouped on the
EstimateID field, so the invoices are sorted by EstimateID.
EmployeeSales report
This report uses the NWind shared data source. It contains the Chart and Table data regions to display sales by
each employee for the year 1997. A column chart shows the graphical representation of sales by each employee
while the Table lists down the exact sales figures. One of the TextBox controls on the report also uses the Sum
function to display the grand total of all sales.
IRS-W4 report
This report uses the IRS XML data source to provide data to the report. It mainly contains Textbox, CheckBox,
Shape and Line controls to create the layout of a tax form used in the US.
Letter report
This report uses the NWind shared data source. It contains an Image, FormattedTextBox, Table and an
OverflowPlaceholder controls to create a layout for a letter. The FormattedTextBox control uses text with HTML
tags to display content. The Table displays OrderID with order dates and order amount and is linked with the
OverflowPlaceholder control to display excess data on the same page. The Reels logo, displayed on the report
inside the Image control, is embedded within the Reels theme and the TextBox placed below the Image control
uses a Global expression to display the current date. The layout page is grouped by the CustomerID field to filter
data on each report page according to individual customers.
This report uses the NWind shared data source. It contains the Matrix data region that displays an orders report
with product category and names showing quarterly and yearly orders. The Matrix uses multiple row grouping to
group the Matrix data region by CategoryName and ProductName, and multiple column grouping to group the
Matrix data by Years and Quarter. One of the TextBox controls on the report also uses the Sum function to display
the grand total of order amount.
PurchaseReport report
This report uses the NWind shared data source. It contains the Textbox and Table controls to display purchase
details for each company. The layout page is grouped by the Company_CD field to filter data on each report page
according to the company. The Textbox control placed below each table column uses the Sum function to display
totals. The FixedSize property of the Table is set to fit in excess data.
ReelsMatrix
This report uses the Reels shared data source. It contains the Matrix data region to display a sales report for each
country, city and media type by year. The Matrix uses multiple row grouping to group matrix data by Country,
City and MediaType, and column grouping to group the data by Years. One of the TextBox controls on the report
also uses the Sum function to display the grand total of all orders.
SalesReport report
This report uses the Reels data source connection and two datasets that fetch data through a Stored Procedure.
The layout of the report uses the Chart to display sales and profit for the selected date range and the Table to
display the numeric values of the same. The table also uses the DataBar function to plot profits graphically. The
Reels logo, displayed on the report inside the Image control, is embedded within the Reels theme. This report also
uses two nullable parameters to select the range of dates.
TackSeal
This report uses the NWind shared data source. It contains the OverflowPlaceholder control and the List data
region to create a columnar display of tack seals with postal barcodes. The List data region has its OverflowName
property set to OverflowPlaceHolder1 and the OverflowPlaceHolder1 control has its OverflowName property
set to OverflowPlaceHolder2 to assure correct display of columnar data display within the report page.
Calendar folder
Events
This report uses XML data containing event details entered directly in the connection string of the data source and
accessed by the dataset. It contains a Calendar control to display events.
EventTypes
This report uses XML data containing event details entered directly in the connection string of the data source and
accessed by the dataset. It contains a Calendar control to display Family, Music and Cultural events. A custom
event background color is also set for each event type in the Script tab.
Vacations
This report uses XML data containing event details entered directly in the connection string of the data source and
accessed by the dataset. It contains a Calendar control to display employee's vacations.
DashBoard folder
CallCenterDashBoard
This report uses the CallCenter shared data source. It contains uses the Bullet control to indicate when the data is
approaching or past a warning range and the Sparkline controls to indicate daily trends in key pieces of
performance and sales data. It also uses the Icon Set data visualizer to indicate the warning levels for key
performance data.
This report uses the MarketData shared data source. It contains the Sparkline control to display stock price trends
over the last 30 days. The Sparkline allows investors to see trends without knowing what actual values are
associated with each point.
TeamList
This report uses the FootballStatistics shared data source. It contains the List control that displays a list of team
names with drill-through links to navigate to the TeamStatisticsDashboard.rdlx report that displays the
selected team's statistics.
TeamStatisticsDashBoard
This report uses the FootballStatistics shared data source. It contains the Bullet control to display the team's
scoring performance in ranges below average, average and above average. The report also uses the Sparkline
controls to display the team statistics.
FactBook folder
CountryFacts
This report uses the Factbook shared data source. It contains a List data region grouped on CountryID that groups
data by Country. The report also contains a map image whose Value property is set to the expression with the
MapCode data field from the XML data source. It contains a hidden parameter that is used to accept the Country
ID. This report is called in other reports by drill-through links or as a subreport, so the Country ID is passed
silently. The default ID is the World. The dataset has a filter that retrieves only countries, specified by the report
parameter. From each textbox with category under Energy Production / Consumption you can see the Image
control that uses the Icon Set data visualizer to flag energy categories where consumption is greater than
production.
LifeExpectancyByGdpAndMedianAge
This report uses the Factbook shared data source. It contains the Matrix data region to compare the average life
expectancy based on the category where the Median age and GDP fall.
Top10CountriesByGdp
This report uses the FactbookSortedByGdp shared data source and shows the Top 10 countries by GDP. It contains
a List data region with an image in the Image control that uses the RangeBar function to create an ad-hoc
horizontal bar chart.
Reels folder
CustomerMailingList
This report uses the Reels shared data source. It includes a Container control along with TextBox and Barcode
controls to display a mailing list of customers. The Columns property of the Body section is set to 3 to display
mailing labels in three columns.
CustomerOrders
This report uses the Reels shared data source. It contains the List and Table data regions that group data by
CustomerID and SaleID respectively to display order information. The SalesAmount textbox of the Table has its
Value property set to Sum function to calculate the total for each order (as a table group subtotal). The
YearTotal textbox of the Table also has its Value property set to Sum function to calculate the total of pre-tax
sales. The Reels logo that is displayed on the report is embedded within the Reels theme. The page number in the
PageHeader section is reset every time a new customer is displayed. This report also contains a subreport,
CustomerOrdersCoupon.rdlx.
CustomerOrdersCoupon
This report is used as a subreport in the CustomerOrders report. It includes a Rectangle containing some
TextBoxes, Image and Barcode controls to create a layout for a discount coupon. It also includes a Parameter,
CouponAmount to set the discount provided to customers.
DistrictReport
DistrictSales
This report uses the Reels shared data source. It contains the BandedList data region that groups data by
SaleYear, DistrictID and RegionID to display district sales details. Sum function is used to get the total sales at
the District, Region, Year levels and also to display a grand total. The Reels logo that is displayed on the report is
embedded within the Reels theme.
Filmography
This report uses the Reels shared data source. It contains nested List data regions that group data by MovieID
and MoviePersonID to return a distinct number of movies with the selected actors. The report contains two
cascading parameters that narrow down the number of actors displayed in the list first based on the alphabet with
which the actor's name begins and then based on the actor's name. The Reels logo that is displayed on the report
is embedded within the Reels theme.
GenreSales
This report uses the Reels shared data source. It contains a Matrix data region to display the units sold for each
genre, in each year and each quarter. The report also uses the plain column Chart to display the number of titles
sold for each genre. This report uses the multivalue parameter that allows you to select more than one genre for
displaying sales data. The Reels logo that is displayed on the report is embedded within the Reels theme.
GenreStatistics
This report uses the Reels shared data source. Median and Mode aggregate functions are used to show the middle
values in a set of data as well as the most commonly occurring value. It also uses the ReelsConfidential.rdlx-
master report to provide standard page headers and footers. The Reels logo that is displayed on the report is
embedded within the Reels theme.
MonthlySalesReport
This report uses the Reels shared data source. It contains a Table data region that groups data by DistrictID. The
Textbox controls in the Table have their Value property set to expressions to display the total of sales for each
district and region as well as the totals of all districts within a region for a given month. It also uses the Plain Line
Chart with the data grouped and sorted by Day for each SaleDate to display sales and profit for the selected
month. This report uses query based parameters to select the month and region for displaying data. The Reels
logo that is displayed on the report is embedded within the Reels theme.
MovieCatalog
This report uses the Reels shared data source. It contains the Image, TextBox, TableofContents and List controls
to display the list of movies in a catalog. This report uses the TableofContents control to display, an organized
hierarchy of the report heading levels and labels along with their page numbers, in the body of a report. It also
uses the TextBox and Image control to display the layout of the report. The Reels logo that is displayed on the
report is embedded within the Reels theme.
MovieReport
This report uses the Reels shared data source. It contains four List data regions with groupings. The MovieList is
grouped by MovieID, the GenreList is used to display the genre names and is grouped by GenreID, the
CrewList is used to display the title and is grouped by CrewTitleID, and finally the CastNameList is used to
display the cast and crew and is grouped by MoviePersonID. This report uses cascading parameters. The first
parameter asks to select which letter the movie titles starts with, and then the second parameter asks to select a
movie to display. The CrewName textbox in the report Body uses the drill-through link (the Action is set to
Jump to report) that opens Filmography.rdlx with more information on the selected person. The parameters of
this report are passed to the Filmography.rdlx report. The Reels logo that is displayed on the report is embedded
within the Reels theme.
ReelsConfidential.rdlx-master
RegionPerformance
This report uses NWind.mdb database. It contains the Table data region that uses the Region value to group the
report data and the SalesAmount value to sort the report data. It also uses filtering to filter the report data by
the RegionID value. Textbox controls in the Table have their Value properties set to Sum functions to display the
total of sales amount for each region. The Reels logo that is displayed on the report is embedded within the Reels
theme.
ReorderList
This report uses Reels shared data source. It contains the Table data region without any grouping. The Table detail
row has its BackgroundColor property set to the expression to create a light yellow bar report. The Reels logo
that appears on the report is embedded within the Reels theme.
SalesByMediaType
This report uses the Reels shared data source. It contains the List data region that is grouped by Image to display
data. The list also includes the Table data region that groups its data by MediaID. The report also contains the
Plain Column Chart to display sales and profit by media type and embedded images for each category. This report
uses the ReelsConfidential.rdlx-master report to render the report page header and footer.
SalesByRegion
This report uses the Reels shared data source. It contains the Matrix data region and subtotals to display the
number of units sold and profit for each region by year and quarter. The Matrix report data has the row grouping
by Region and the column grouping by SaleDate.Year. The report also uses the Plain Column Chart to display
the annual profit for each region. Data in the Chart is also grouped by Region and SaleDate.Year.
SalesReceipt
This report uses the Reels shared data source. It contains a Table data region and three Container controls nested
in the List data region. The List is grouped by SaleID to produce the body of the receipt. The salesTaxLabel and
totalSalesTax textboxes use the Sum function that totals the amount due in the list and adds tax to the sum of a
field for the grand total due. The Reels logo that is displayed on the report is embedded within the Reels theme.
SalesReport
This report uses the Reels shared data source. It contains a Table and Chart data regions to display totals of sales
and profit for the selected date range. The Table also uses the Data Bar function to plot the profits. The Chart and
Table data is grouped by Month and Year. The Month textbox uses the drill-through link to display
MonthlySalesReport.rdlx with more information on the selected month. This report uses parameters that allow
the null value to select the range of dates. The Reels logo that is displayed on the report is embedded within the
Reels theme.
StorePerformance
This report uses the Reels shared data source. It identifies stores with profits above or below expectations. It also
has two Image controls that display the database images and use the IconSet function. This report uses the
ReelsConfidential.rdlx-master report to render page headers and footers.
StoreReport:
This report uses the Reels shared data source. It contains the Table, List and Chart data regions to display sales
for each employee. The Table and Chart data is grouped by EmployeeID. The Table uses hierarchical grouping to
show the relationship between employee and supervisor for each store. The FirstName textbox has its Padding>
Left property set to the Level function that leaves a space 15 pixels wide to the left of the control. This is the drill-
down report where the Visibility > Hidden property of the Table detail row is set to =Fields!Supervisor.Value
<> 0 and the Visibility > ToggleItem property is set to the FirstName data field. The expression in the
Visibility > Hidden property calculates whether the supervisor field returns 0, so only the supervisor's name is
displayed initially. By clicking the toggle image next to the supervisor's name, the rows with details about
employees are displayed. The report uses a cascade of parameter values - Region, District and StoreNumber.
Each parameter depends on the value of the previous parameter and each comes from a separate dataset. The
Reels logo that is displayed on the report is embedded within the Reels theme.
This report uses the Reels shared data source. It contains two Table data regions to display the top and bottom
performers based on the movies sales. Each Table data is grouped by MoviePersonID and MovieID (nested
grouping). The TopN filter is applied to one table and the BottomN filter is applied to another. The number of items
returned by each of the filters is specified in report parameters. This report also uses two integer parameters to
alter the number of items displayed in each table. The parameters use default values, which are passed to
textboxes of the Table Headers. This is the drill-down report where the second Table Group Header in each Table
has its Visibility > Hidden property set to True and the ToggleItem property set to the PerformerName
textbox. By clicking the toggle image next to the name, the rows containing details about performers are
displayed.
Note: This sample uses bound fields on the PageHeader section, assuming that the value of all records to be
displayed on a page does not change.
However, it is not recommend that you place bound fields in the PageHeader or PageFooter sections because
these sections are displayed on a page once. For the same reason it is not recommended that you place
bound fields on the GroupHeader and GroupFooter sections.
GroupHeader section: This section (ghColumnCaption) contains the Label controls that are captions
for the information displayed in the Detail section. This section also uses the CrossSectionBox and the
Shape controls.
Detail section: This section contains the bound TextBox controls that display each row of data
associated with the current ghColumnCaption. The Shape control is used to alternate row colors in the
Detail section. Go to the Script tab and see the shpDetailBack.BackColor property in the Detail_Format
event.
PageFooter: This section contains the Label controls that explain codes used in the Category column of
the invoice details.
Invoice2 Report
This report shows another invoice layout and uses Seikyu2.mdb database to provide data.
GroupHeader1 section: This section contains the Label and Textbox controls. It uses the bound data
fields to calculate the invoice information in the header. The values of the Year, Month and Day
Textbox controls are set under the Script tab and are calculated in the ReportStart event. It also uses
the CrossSectionLine and the CrossSectionBox controls that span the GroupHeader1 section to Detail
section. The CrossSection Box ends in the GroupFooter1 section. These controls form vertical lines
between columns of the invoice details and a rectangle around the details of the invoice at runtime.
Detail section: This section uses the data table tb_Main for the main report data and the data table
tb_Count to retrieve the number of data items within a group. The Detail data in each group is
retrieved beforehand to calculate the required number of empty rows. For the required empty row
count, substitute data with "" in the FetchData event. The Shape control is used to alternate row colors
in the Detail section. Go to the Script tab and see the shpDetailBack.BackColor property in the
Detail_Format event.
GroupFooter1 section: This section contains the Label and Textbox controls that display the totals of
UnderlayNext Report:
This report displays the bound data. It uses Nwind.mdb database to provide data.
PageHeader section: This section contains the Label and Line controls to create the header for report
data.
GroupHeader1 section: This section contains a TextBox control bound to the Country field and the
CrossSectionLine controls to create the table for the body data of the report. UnderlayNext Property
(on-line documentation) of this section is set to True to align the beginning position of the report
data in the Detail section with the GroupHeader1 section.
Detail section: This section contains the bound Textbox controls to display report data. This
section displays the name of the city, contact name and postal code for each customer according to their
countries.
Section Report
Learn about the different section report samples categorized under Data, Layout, Preview, Summary and Web
Copyrightrespectively.
© 2016 GrapeCity, inc. All rights reserved
This section contains:
ActiveReports 9 User Guide 643
Data
Learn working with different data sources.
This section contains:
Bound Data
Demonstrates binding to ADO.NET Data objects.
IList Binding
Demonstrates creating a custom collection that stores data from the database in the List. The custom collection is
displayed by binding data to the DataGridView control by using the DataSource property of this control.
LINQ
The LINQ sample demonstrates how to use LINQ in an ActiveReports report.
Unbound Data
The Unbound Data sample demonstrates how to create a dataset for a section report and use the FetchData event
to populate the Fields collection to display the report unbound data.
XML
This sample demonstrates how to create a report with XML data, using a SubReport or using the XML hierarchical
structure.
Bound Data
The Bound Data sample demonstrates various ways to bind data in a section report.
When you run the sample, the Viewer control displays the form with seven tabs, each with a different data binding
technique. Click to select a tab, and then click the Bind To button to create the report.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Data\BoundData\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Data\BoundData\C#
Runtime Features
The top panel of the MainForm comprises of seven tabs:
Bind to DataSet
Creates a DataSet from the sample database and binds it to a SectionReport object.
Bind to DataReader
Creates a DataReader from the sample database and binds it to a SectionReport object.
Bind to DataView
Creates a DataView from the sample database and binds it to a SectionReport object. This tab contains a
ComboBox which lets you choose the company name from the NWind database.
Bind to DataTable
Creates a DataTable from the sample database and binds it to a SectionReport object.
Project Details
MainForm
The MainForm uses the ActiveReports Viewer control in the bottom section of the form, and a panel docked to the
top contains seven tabs, each with a different data binding technique.
Click to select a tab, and then double-click the button on the tab to jump to the button's Click event in the code.
Invoice Report
The Invoice report uses three GroupHeader sections, a Detail section and a GroupFooter section as well as a label
in the PageFooter section to display data.
Note: Except for the Detail section, all sections come in header and footer pairs. Unused sections have their
Height properties set to 0 and their Visible properties set to False.
ghOrderHeader
The DataField property of this section is set to OrderID. This setting, in conjunction with data ordered by the
OrderID field, causes the report to print all of the information for one order ID value, including all of the related
details and footers, before moving on to the next order ID. For more information on grouping, see Grouping Data
in Section Reports.
This section also contains a Picture control, a number of Label controls, and two bound TextBox controls. The
TextBoxes are bound using the DataField property in the Properties window, and the date is formatted using the
OutputFormat property.
ghOrderID
The DataField property of this section is also set to OrderID. This allows subtotal summary functions in the
related GFOrderID section to calculate properly.
This section contains a number of labels and bound text boxes, as well as two Line controls.
ghTableHeader
This section contains only labels for the data to follow in the Detail section.
Detail
This section contains bound TextBox controls. These TextBoxes render once for each row of data found in the
current OrderID before the report moves on to the GroupFooter sections.
GFOrderID
The NewPage property of this section is set to After. This causes the report to break to a new page and generate
a new invoice after this section prints its subtotals.
This section contains several labels and several TextBoxes. Two of the TextBox controls use the following
properties to summarize the detail data: SummaryFunc, SummaryGroup, and SummaryType. For more
information, Create a Summary Report.
The Total TextBox does not use the DataField property or any of the summary properties, or even any code. To
find the functionality of this TextBox, in design view, click the Script tab at the bottom of the report.
PageFooter
This section has one simple Label control. For more information about report sections and the order in which they
print, see Section Report Structure and Section Report Events.
IList Binding
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Data\IListBinding\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Data\IListBinding\C#
Runtime Features
When you run this sample, DataGridView, which is a standard Windows Forms control displays the custom
collection. To display a report with the bound custom collection, click the Generate Report button.
Note: To run this sample, you must have access to the Nwind.mdb. A copy is located at [User Documents
folder]\GrapeCity Samples\ActiveReports 9\Data. If you are unable to access the data files in the
sample, create the Data folder and place all the data files to this folder, or change the reference path to the
data files within the folder according to your environment.
Project Details
The IList Binding sample consists of two projects: IListBinding and IListBinding.DataLayer.
IListBinding Project
BindIListToDataGridSample
GroupHeader1 section
The GroupHeader1 section contains nine Label controls that define the layout of the report data.
Detail section
The Detail section contains TextBox controls to display the report data. Following settings have been performed
to enhance the appearance of the report output.
Change the background color of alternate rows
Use the BackColor property of the Detail section (set in the Format event of the Detail
section) to change the background color of each row for better visibility of the table.
Change the background color for selected rows
Use the BackColor property of the Detail section (set in the Format event of the Detail
section) to change the background color of selected rows. The background color changes when Reorder
Level is below Ordered Units.
ViewerForm
Setting the Dock property of the Viewer control to Fill ensures that the viewer resizes along with the form at run
time. Right-click the form and select View Code to see the code used to run the report and display it in the
viewer.
IListBinding.DataLayer project
DataProvider Class
Implements the connection to the data base.
Product Class
Defines custom collection class.
ProductCollection Class
Implements the CollectionBase class to create a collection of Product class. The list of this collection stores
data from the Products table.
LINQ
The LINQ sample demonstrates how to use LINQ in an ActiveReports report.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Data\LINQ\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Data\LINQ\C#
Runtime Features
Unbound Data
The Unbound Data sample demonstrates how to create a dataset for a section report and use the FetchData event
to populate the Fields collection to display the report unbound data.
When you run the sample, the Viewer control displays the form with four tabs, each with a different dataset
binding technique. Click to select a tab, and then click the Build Report From button to create the report with
unbound data.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Data\UnboundData\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Data\UnboundData\C#
Runtime Features
Unbound data with a DataSet
Creates a data set from the included Northwind sample database inside the SectionReport object and
uses the FetchData event to populate the internal Fields collection to display the report data.
Unbound data with a DataReader
Creates a data reader from the included Northwind sample database inside the SectionReport object and
uses the FetchData event to populate the internal Fields collection to display the report data.
Unbound data with a Text File
Sets the Invoice.txt file as a datasource for the SectionReport object and uses the FetchData event to
populate the internal Fields collection to display the report data.
Unbound data with a Data Array
Creates a data array from the included sample text file inside the SectionReport object and uses the
FetchData event to populate the internal Fields collection to display the report data.
Project Details
MainForm
This is the main form of the sample that uses the ActiveReports Viewer control in the bottom section of the form,
and a panel docked to the top contains four tabs, each with a different data binding technique. Click to select a
tab, and then click the button on the tab to display the report with unbound data.
UnboundDAInvoice report
XML
The XML sample displays customer order list using the XML data source. The sample demonstrates how to create a
report with XML data, using a SubReport or using the XML hierarchical structure.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Data\XML\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Data\XML\C#
Runtime Features
When you run the sample, you will be asked to select between the following.
Run Customers XML Report
Demonstrates a two level Master/Detail XML Data Source. Uses a SubReport to print the orders of each customer.
By selecting any of the radio buttons - Show All Data, Show Report where ID = 2301, or Show All Data with
an E-Mail address, you can change the creation option of the generated report.
Customer Orders (Leveled)
Displays customer's orders by using the XML hierarchical structure. The Master/Detail is implemented using the
XML hierarchy XPath selection patterns without any SubReports.
Project Details
StartForm
This is the main form of the sample. You see this form after you run the project and where you can select how to
display XML data.
Run Customers XML Report
Layout
Learn to create different layouts in a section report.
This section contains:
Annual Report
Demonstrates how to use subreports and nested subreports, how to modify data source properties at run time,
how to use parameters in the chart control, how to create alternate row highlighting and how to use the page
break control.
Category Selection
Demonstrates using the ad hoc report filter by modifying the report's SQL query at run time.
Charting
Demonstrates the use of the Chart control in both bound and unbound modes.
Cross Section Control
Demonstrates the use of the new cross section lines and boxes.
Cross Tab Report
Demonstrates using unbound data, conditional highlighting and distributing data across columns to create a cross-
tab view and data aggregation.
Annual Report
The AnnualReport sample demonstrates the use of SubReports, section report properties, and Chart control. It
includes a StartupForm and AnnualReport, ProductSalesByCategory, Top10, Top10Customers, Top10Products
reports.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Layout\AnnualReport\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Layout\AnnualReport\C#
Runtime features
When you run this sample, a three page report appears wherein the first page mentions the name of the trader
and year of the report, the second page displays company information along with a SubReport displaying category
wise sales and the third page displays data in form of charts. The AnnualReport fetches data from
ProductSalesByCategory report and Top10 report and displays it in the Viewer control. The Top10 report
further fetches data from Top10Customers subreport and Top10Products subreport.
Note: To run this sample, you must have access to the Nwind.mdb. A copy is located at [User Documents
folder]\GrapeCity Samples\ActiveReports 9\Data\NWIND.mdb. If you are unable to access the data
files in the sample, create the Data folder and place all the data files to this folder, or change the reference
path to the data files within the folder according to your environment.
Project Details
StartupForm
This form contains the ActiveReports Viewer control. The Dock property of the viewer is set to Fill so that it
resizes automatically with the form at run time. Right-click and select View Code to see the code that displays the
AnnualReport when the form loads.
AnnualReport report
This is the main report for the project.
ReportHeader section
This report features a two-page ReportHeader section that uses a PageBreak control to separate the two pages,
and breaks to the second page by setting the ReportHeader section's NewPage property to After. This report
shows how you can use the BackColor and ForeColor properties of labels to create a distinctive look for your
reports.
Tip: It is recommended that you initialize reports in the ReportStart event rather than a section Format
event so that a new report is not initialized every time the section runs. If the SubReport control is in a
section that prints multiple times, you need to assign the report in the section Format event while still
initializing in the ReportStart event.
The yellow background in the right half of the ReportHeader section below the page break control is achieved by
using the Shape control and setting its BackColor property. The image to the left is a Picture control.
Detail section
The Detail section contains one SubReport control that link in the code behind the report to the Top10 reports.
In most reports, the Detail section would run multiple times. In this report, the Detail section has only labels, and
no bound textboxes, so it will only run once. Therefore, the Top10 report can be assigned to the SubReport control
in the ReportStart event where it is initialized.
Notice that the ReportFooter section has its Height property set to 0. This is because, except for the Detail
section, all sections come in pairs. In order to use the ReportHeader section, you must also have a ReportFooter
section. If you do not want to use it, you can set its Height to 0.
ProductSalesByCategory report
This is the report that is assigned to the SubReport control in the ReportHeader section of the Annual Report.
Tip: This report has the ReportHeader/Footer and PageHeader/Footer sections removed. These sections are
not printed within the SubReport control, so removing the sections saves processing time.
Notice also that the PrintWidth property of this report is only 2.677 inches. This is so that it fits easily within the
SubReport control on the Annual Report.
This report uses the GroupHeader section to display labels for the data fields that fill the Detail section. The
fields in the Detail section repeat once for each row of data in the database.
Right-click in the grey area around the report and select View Code to see the code that sets the data source for
the report. Notice that the background color of the Detail section is set to yellow on every second row of data.
Top10 report
This report only has a Detail section. The Detail section contains two SubReport controls that linked to
Top10Customers and Top10Products reports in code.
Top10Customers and Top10Products reports
The Top10Customers and Top10Products reports use only two sections, GroupHeader and Detail. The PrintWidth
property of each report is set to 3.135 inches so that it fits into the SubReport control in the Top10 report. The
GroupHeader section of each report is filled with a Chart control. The Detail section of each report has two bound
TextBoxes and a Label controls. Right-click and select View Code to see the code that sets the data source for
the report, passes data to the Chart control, alternates the background color of the Detail section, and sets the
Text property of the label.
Category Selection
The CategorySelection sample demonstrates passing a SQL string into a report at run time. It consists of a
CategorySelectForm and CategoryProducts report.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Layout\CategorySelection\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Layout\CategorySelection\C#
Runtime Features
When you run this sample, a form containing a Viewer control and a ComboBox control within a panel is
displayed. The Select a Product Category ComboBox at the top of the form allows the users to select the type of
data they want to display in the Viewer control.
Note: To run this sample, you must have access to the Nwind.mdb. A copy is located at [User Documents
folder]\GrapeCity Samples\ActiveReports 9\Data\NWIND.mdb. If you are unable to access the data
files in the sample, create the Data folder and place all the data files to this folder, or change the reference
path to the data files within the folder according to your environment.
Project Details
CategorySelectForm
The Viewer control fills most of the form, and a ComboBox at the top allows the user to select which data to send
to the Viewer control.
To see how all of this works, right-click the form and select View Code.
The getCategories code populates the ComboBox with the category names.
The runCategoryReport code runs the report with a SQL string with the CategoryName passed in by
the ComboBox selection.
The SelectIndexChanged event calls runCategoryReport and passes the CategoryName.
CategoryProducts
This report lists the products in the selected category, and summarizes the number of products.
ReportHeader section
This section cannot be deleted, because the related ReportFooter section is used and thus the Height property is
set to 0.
PageHeader section
This section uses Label controls, Line controls and a TextBox. DataField property of txtCategory TextBox is set
to CategoryName. Two Line controls and three Label controls create the report title and the column headers for
this report.
Detail section
This section contains two bound TextBox controls to display each product in the selected category along with its
price. Although the form passes data to the report at run time, the report's data source is set for design time use.
At design time, it is easier to drag bound fields onto the report from the Report Explorer than it is to create them
and set their properties. The data source also allows you to preview the report while you are designing it.
PageFooter section
This section uses the ReportInfo control to display Page N of M. In the Properties window, you can select a way
Charting
The Charting sample provides an option to choose from various chart types and a button to display the
selected chart in a Viewer control.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Layout\Charting\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Layout\Charting\C#
Runtime Features
Chart type combobox
Select from the following ChartType options.
2D Bar Chart - Use this chart to compare values of items across categories.
3D Pie Chart - Use this chart to display data in 3D format to depict how percentage of each data item
contributes to a total percentage. Selecting this ChartType provides an option to set the Direction of
rotation of 3D Pie chart to Clockwise or Counterclockwise.
3D Bar Chart - Use this chart to compare values of items across categories and to display the data in a
3D format.
Finance Chart -Use this chart to display the stock information using High, Low, Open and Close values.
The size of the wick line is determined by the High and Low values, while the size of the bar is
determined by the Open and Close values.
Stacked Area Chart - Use this chart to demonstrate how each value contributes to the total.
Report Display button
Click this button to display the selected chart type in a Viewer control.
Note: To run rpt2DBar, rpt3DPie and rpt3DBar report, you must have access to the Nwind.mdb database. A
copy is located at [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data\NWIND.mdb.
If you are unable to access the data files in the sample, create the Data folder and place all the data files to
this folder, or change the reference path to the data files within the folder according to your environment.
Project Details
ViewerForm
The ViewerForm contains the Viewer control, with the Dock property set to Fill. This enables the viewer to
automatically resize along with the form. Right-click the form and select View Code to see the code used to run
the report and display it in the viewer.
rpt2DBar report
Displays bar chart on a report. Retrieves the data to be displayed in a chart from Orders table in Nwind.mbd
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Layout\CrossSectionControls\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Layout\CrossSectionControls\C#
Runtime Features
When you run this sample, a form with three different tab options and each tab option displaying a report in a
Viewer control is displayed. Click any tab option at the bottom of the form to display the selected tab feature
applied to the report in a Viewer control. Select from the following tab options.
Cross Section Controls
Draws table style gridlines easily through multiple sections without any gap.
Detail RepeatToFill
The Detail RepeatToFill tab has the RepeatToFill property set to True. This ensures that the formatting
(alternating purple and white rows and CrossSection controls) fills space as needed to keep the same layout
between pages.
GroupFooter PrintAtBottom
The GroupFooter section has the PrintAtBottom property set to True. This pulls the GroupFooter section to the
Note: To run this sample, you must have access to the Nwind.mdb. A copy is located at [User Documents
folder]\GrapeCity Samples\ActiveReports 9\Data\NWIND.mdb. If you are unable to access the data
files in the sample, create the Data folder and place all the data files to this folder, or change the reference
path to the data files within the folder according to your environment.
Project Details
ViewerForm
The ViewerForm has three tabs-Cross Section Controls, Detail RepeatToFill, GroupFooter PrintAtBottom,
each with an ActiveReports Viewer control on it. Right-click the form and select View Code to see the code used
to change the Invoice report's section properties at run time.
Invoice Report
The Invoice report demonstrates the usage of the following features.
PageHeader section
This section contains Shape, Label and TextBox controls. The Shape control provides a border around the Order
ID and Order Date fields and labels. The orderDateTextBox has the OutputFormat property set to d to display a
short date. The Label controls use the BackColor, ForeColor, and Font properties to add a distinctive style to
the report.
customerGroupHeader section
The CrossSectionBox control is hosted in the GroupHeader section, and spans the Detail section to end in the
GroupFooter section, forming a rectangle around the details of the invoice at run time. Three of
the CrossSectionLine controls are hosted in the GroupHeader section, and span the Detail section to end in the
GroupFooter section, forming vertical lines between columns of invoice details at run time.
Note: If you try to drop a CrossSectionBox or CrossSectionLine control into a section other than a header or
footer, the mouse pointer changes to unavailable, and you cannot drop the control.
Tip: In the Report Explorer, expand the Fields node, then Calculated to see all of the calculated
fields. Select BillingAddress or ShippingAddress to take a look at the Formula used in the Properties
window.
The Line control is used below the column header labels to draw a horizontal line across the width of the report.
(It is not visible at design time unless you make the Height of the GroupHeader section larger.) The DataField
property of the customerGroupHeader section is set to the OrderID field, so that the section (followed by related
details and GroupFooter) prints once per order.
Detail section
This section contains four bound TextBox controls. The four TextBox controls display each row of data associated
with the current GroupHeader OrderID. The OutputFormat property of the UnitPrice and Total fields is set to C to
display currency. The Line control is used below the TextBox controls to draw horizontal lines across the width of
the report under each row of data. (It is not visible at design time unless you make the Height of the Detail section
larger.)
Right-click the report and select View Code to see the code used in the Detail Format event to create a colored
bar (in this case, purple bar) report by alternating the BackColor property of the section. Click the Data Source
Icon on the Detail band to view the Connection String used in the report.
customerGroupFooter section
This section has the NewPage property set to After so that a new page is printed for each OrderID (the
associated GroupHeader's DataField). The Subtotal TextBox uses the following properties.
The DataField property uses a Total CalculatedField.
The SummaryFunc property is set to Sum, to add the values of the field in the detail section.
The SummaryGroup property is set to the name of the customerGroupHeader, to reset the summary
value each time the GroupHeader section runs.
The SummaryRunning property is set to Group so that the value accumulates for the group rather
Tip: In order to easily select a control within the report, in the Report explorer, expand the section node and
select the control. The control is highlighted in the Report Explorer and on the report design surface.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Layout\CrossTabReport\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Layout\CrossTabReport\C#
Runtime Features
When you run the sample, a report displaying a list of weekly sales for current week, month, quarter or year for
each product category is displayed in the Viewer control. The values highlighted in red represent negative values.
Note: To run this sample, you must have access to the Nwind.mdb. A copy is located at [User Documents
folder]\GrapeCity Samples\ActiveReports 9\Data\NWIND.mdb. If you are unable to access the data
files in the sample, create the Data folder and place all the data files to this folder, or change the reference
path to the data files within the folder according to your environment.
Project Details
StartForm
The Viewer control has the Dock property set to Fill. This ensures that the viewer resizes along with the form at
run time. Right-click the form and select View Code to see the code used to run the report and display it in the
viewer.
ProductWeeklySales Report
This report features a number of accumulated values using summary function property settings and
calculated values in the code.
The summary function displays a list of summary values only for weekly sales total in group footer without
ReportHeader section
This section of the report features static controls including Labels, a Picture, a Line, and a Shape control. The
report header prints only once on the first page of the report, thus report title, company information, and a logo
are added in this section.
PageHeader section
The page header section contains static Label controls that print at the top of each page and serve as column
headers for the group header sections.
ghCategory section
This group header section has the DataField property set to CategoryName. This setting, along with data sorted
by the same field, produces a report grouped by category. The section contains one bound TextBox control to
display the category name at the beginning of each group. The section's UnderlayNext property is set to True so
that the category prints to the left of the top line of data instead of above it.
ghProduct section
Although this group header contains no controls and is hidden by setting the Height property to 0 and Visible
property to False, it still performs two important functions. First, the DataField property is set to ProductName,
to sort the data inside each category by product, and second, the related group footer section displays the bulk of
the data for the report.
Detail section
The detail section of this report is hidden by setting the Height property to 0 and Visible property to False, but it
does contain four bound fields whose values are used in the code. In the Detail Format event, the value from the
hidden txtDetProduct TextBox is collected and passed to the _sProductName variable. For more information on
section events, see Section Report Events.
gfProduct section
This group footer section displays the bulk of the data for the report in TextBox controls that have values passed in
code, or are bound to fields from the report's Fields collection (see FetchData and DataInitialize events in the
code) using the DataField property.
In the gfProduct Format event for the inner group footer section, the product name collected from the Detail
Format event is passed to the txtProduct TextBox. The Value for the txtPQTDChange TextBox is calculated by
subtracting the prior year's quarter-to-date sales figure from the current quarter-to-date sales figure. The
BackColor of the txtPQTDChange TextBox is set to Red if the value is negative.
The total units and sales for each product is summarized using the following properties.
SummaryFunc: Sum (the default value)
Adds values rather than counting or averaging them.
SummaryGroup: ghProduct
Summarizes the values that fall within the current product group.
SummaryRunning: None (the default value)
Ensures that this value is reset each time the product group changes.
SummaryType: SubTotal
Summarizes the current group rather than a page or report total.
gfCategory section
This group footer section displays totals of the gfProduct data in TextBox controls that have values passed in code,
or are bound to fields from the report's Fields collection (see FetchData and DataInitialize events in the code)
using the DataField property.
The total units and sales for each category is summarized using the following properties.
SummaryFunc: Sum (the default value)
Inheritance
This sample explains the method to inherit a report at runtime and design time. The Inheritance sample solution
comprises of two classes - the parent class and the child class for both inheritance at runtime and design time.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Layout\Inheritance\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Layout\Inheritance\C#
Runtime Features
When you run the sample, the report is created and displayed, providing you with the choice of two options -
Inheritance Report created at RunTime and Inheritance Report created at Design Time. By clicking a
button on the form, you get a report that inherits another class at runtime or at design time.
Caution: If you have not run the project even once, an error occurs when you try to open the report
designers of the inherited classes rptInheritChild or rptDesignChild from the solution explorer. In case this
error occurs, Build the project once before opening the report.
Project Details
ViewerForm
Creates an instance of specified report and display the report in Viewer control.
rptDesignBase
The rptDesignBase class that defines the layout of PageHeader section and PageFooter section.
rptDesignChild
The rptDesignChild designer defines the layout on Detail section and sets the value of DataField property of the
controls placed in Detail section. Also set the data source to output using Report Data Source dialog.
rptInheritBase
The class to set values for data field and rendering of csv file using DataInitialize event FetchData event.
rptInheritChild
The designer that sets layout for each control and it's DataField property.
Style Sheets
This sample demonstrates how you can change styles at run time to provide a different look to a same report. The
project includes two reports, three reportstyles and a form containing the ActiveReports Viewer control and other
controls that allow you to select any combination of styles and reports.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Layout\Stylesheets\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Layout\Stylesheets\C#
Runtime Features
Choose Report
Choose between the type of report, Categories and Product List, you want to display in the Viewer control.
Choose Style
Choose between Classic, Colored and External style sheet options to apply the style to the selected report.
Clicking the Choose button option for External style sheet displays the Open dialog that shows only
*.reportstyle files, and passes the selected reportstyle path and file name string to the externalStyleSheet
variable.
Run Report button
SubReport
The SubReports sample demonstrates how SubReport control can be used to generate nested and hierarchical
reports.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Layout\SubReport\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Layout\SubReport\C#
Runtime Features
When you run this sample, the blank Viewer form appears, with the drop-down list of the sample reports on
the top of the form. Select the report from the drop-down list to have it displayed in the Viewer control. You can
select from the following options.
Simple SubReport - the basic sample report that demonstrates how to embed a report into another
report. See rptSimpleMain and rptSimpleSub for details.
Nested SubReport - the report demonstrates how to nest subreports to display main, child, and
grandchild levels in a report. See rptNestedParent, rptNestedChildMain and rptNestedChildSub for
details.
Hierarchical SubReport - the main report dataset with the SHAPE statement defines the hierarchical
structure of the report that uses a subreport. See rptHierarchicalMain and rptHierarchicalSub for details.
SubReport using the data set that contains relationship - the main report having dataset with the
relation that is defined in code, in the DataSet.Relations property of the main rptDSRelationParent
report. See rptDSRelationParent, rptDSRelationChildMain and rptDSRelationChildSub for details.
Master-detail report containing a SubReport - the sample report that demonstrates how to create a
master detail report that uses a subreport. See rptMasterMain and rptMasterSub for details.
Bookmark in SubReport - the sample report that uses bookmarks from the subreport. See
rptBookmarkMain and rptBookmarkSub for details.
Use a parameter in the SubReport - the sample report demonstrates how to set up a parameter in
the data source of the subreport. See rptParamMain and rptParamSub for details.
To view the Dataset with multiple tables using SubReports - the sample report with the dataset
that contains multiple data tables. The main report uses subreports to output multiple tables in a single
report. See rptUnboundDSMain and rptUnboundDSSub for details.
Note: To run this sample, you must have access to the Nwind.mdb. A copy is located at [User
Documents folder]\GrapeCity Samples\ActiveReports 9\Data\NWIND.mdb. If you are
unable to access the data files in the sample, create the Data folder and place all the data files to
this folder, or change the reference path to the data files within the folder according to your
environment.
Project Details
ViewerForm
The ViewerForm uses the ActiveReports Viewer control in the bottom section of the form, and a panel docked to
the top with the drop-down list. The Viewer displays a report once it is selected from the list.
rptBookmarkMain
This report is displayed when you select the Bookmark in SubReport option in the drop-down list of the
ViewerForm.
Preview
Learn to create an interactive section report during preview.
This section contains:
Custom Annotation
Demonstrates adding the Custom Annotation button to the report Viewer toolbar and adding a new annotation to
the report.
Custom Preview
Demonstrates using Viewer control customization, export filters, rich edit control and mail-merge, parameters in
the chart control, and grouping.
Hyperlinks and Drill Down
Demonstrates using hyperlinks and the viewer hyperlink event to simulate drill-down from one report to another.
Print Multiple Pages Per Sheet
Demonstrates printing a document with multiple pages per sheet by using the common PrintDocument class of the
NET.Framework.
RDF Viewer
Demonstrates creating the Rdf Viewer with an ActiveReports Viewer control and an ExportForm with a Property
Grid.
Custom Annotation
The Custom Annotation sample demonstrates how to add the Custom Annotation button to the Viewer toolbar
and depicts the method to add any annotation (seal image in this case) to the report. Only one annotation can be
used per page.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Preview\CustomAnnotation\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Preview\CustomAnnotation\C#
Runtime Features
When you run the sample, the report appears in the Viewer control. The Viewer control toolbar contains the
Custom Annotation button that opens the report annotation.
Note: To run this sample, you must have access to the Nwind.mdb. A copy is located at [User Documents
folder]\GrapeCity Samples\ActiveReports 9\Data. If you are unable to access the data files in the
sample, create the Data folder and place all the data files to this folder, or change the reference path to the
data files within the folder according to your environment.
SummaryGroup: ghOrderID summarizes the values that fall within the current order id.
SummaryRunning: None (the default value) ensures that this value is reset each time the order id
changes.
SummaryType: SubTotal summarizes the current group rather than a page or report total.
Resources folder
This folder holds the icon used for adding annotation (seal image) to the report.
Resource1.resx
This file contains the string for the message box that appears when Custom Annotation button is clicked again to
add the annotation.
Custom Preview
The Custom Preview sample demonstrates how to create various type of reports, customize the Viewer toolbar,
load or save a report document file (RDF). The sample also provides six types of export options and demonstrates
the use of print settings.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Preview\CustomPreview\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Preview\CustomPreview\C#
Runtime Features
Note: To run this sample, you must have access to the Nwind.mdb. A copy is located at [User Documents
folder]\GrapeCity Samples\ActiveReports 9\Data. If you are unable to access the data files in the
sample, create the above folder to place all the data files or change the reference path to the data files within
the folder according to your environment.
Project Details
CustomPreviewForm
This is the main form that gets displayed when you run the sample.
The CustomPreviewForm has its IsMdiContainer property set to True. This ensures that the child PreviewForm
is embedded into the parent CustomPreviewForm.
This form has a menu bar, mnuMain, with three menus: File, Reports, and Window. The MergeType property
of the File menu is set to MergeItems, which adds the menu items from any child PreviewForms to the
CustomPreviewForm. The form also has two dialogs: dlgOpenFile, and dlgPrint.
Right-click the form and select View Code to see how reports selected from the Reports menu are run and passed
to the PreviewForm, using the ShowReport method.
PreviewForm
This is the form that gets displayed when you select a report in the Reports menu of the main Custom Preview
Sample form (CustomPreviewForm).
The PreviewForm has the ActiveReports Viewer control with it Dock property set to Fill. This ensures that the
viewer resizes along with the form at run time.
The form has the File menu with its MergeType set to MergeItems. This ensures that the File menu on the
CustomPreviewForm displays the Export, Save menu items when a report is open. The form also has one dialog:
dlgPrint.
Right-click the form and select View Code to see how two custom buttons are added to the toolbar in the
PreviewForm_Load event. The ToolClick event of the Viewer calls the SaveDocument and ExportDocument
functions for the new buttons. The menu item click events call the same functions for the related menu items.
The SaveDocument function opens the dialog dlgSave, while the ExportDocument function opens the new
ExportForm.
ExportForm
This is the form that gets displayed when you select Export in the File menu of the opened report. In the Export
form, you can select from the following export file format options.
HTML
Excel
Text
PDF
RTF
TIFF
Invoice
PageHeader section
This section contains a Picture control with a logo, a number of Label controls, and two bound TextBox controls.
The TextBoxes are bound using the DataField property in the Properties window, and the date is formatted using
the OutputFormat property.
ghOrderID section
The DataField property of this section is also set to OrderID. This allows subtotal summary functions in the
related GFOrderID section to calculate properly.
This section contains a number of labels and bound text boxes, as well as two Line controls.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Preview\Hyperlinks and DrillThrough\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Preview\Hyperlinks and DrillThrough\C#
Runtime Features
When you run this sample, a report displaying bound fields with a link created on CustomerID is displayed in a Viewer
control. DrillThrough feature allows users to navigate to another report containing detailed data. Clicking the CustomerID
hyperlink takes you to the second report which displays detailed information of the selected CustomerID. On further
clicking the OrderID hyperlink the third report displaying the details of the selected order is opened in the Viewer. This
feature enables the users to systematically go through the detailed data of the desired CustomerID.
Note: To run this sample, you must have access to the Nwind.mdb. A copy is located at [User Documents
folder]\GrapeCity Samples\ActiveReports 9\Data\NWIND.mdb. If you are unable to access the data files in
the sample, create the Data folder and place all the data files to this folder, or change the reference path to the data
files within the folder according to your environment.
Project Details
ViewerForm
This form contains only the Viewer control with its Dock property set to Fill. This ensures that the viewer resizes along
with the form at run time.
Right-click the form and select View Code to see the code that allows multiple ViewerForms to display for the reports, and
see the Form Load event for the code that loads the main report into the viewer.
See the Viewer Hyperlink event for the code that collects a string value from the Hyperlink property of the clicked
TextBox on the main report and passes it into the customerID Parameter of the report DrillThrough1, or collects a
numeric value and passes it to the orderID Parameter of the report DrillThrough2. This code then runs the report with the
parameter value and displays it in another instance of the ViewerForm.
DrillThroughMain Report
The main report that is loaded in the ViewerForm by default uses the PageHeader and Detail sections.
PageHeader section
This section contains three Label controls to serve as column headers for the details, and a CrossSectionBox control. For
more information, see Cross Section Controls.
Detail section
The Detail section has the BackColor property set to Thistle, and its RepeatToFill property set to True. This ensures
that the background color reaches all the way to the bottom of the page when there is not enough data to fill it.
Right click on the form, select View code to see the Connection String and SQL Query that provide data for the bound
fields.
The Detail section has three bound TextBox controls that display a list of customer information. Select CustomerID and
you will see that the HyperLink property is not set in the Properties window. To see the code that assigns the data from
the TextBox to its HyperLink property, right-click the report and select View Code. The HyperLink property is set in the
Detail BeforePrint event.
PageFooter Section
This section is not in use, so it is hidden by setting the Visible property to False. This section cannot be deleted, because
its related PageHeader section is in use.
DrillThrough1 Report
This report looks similar to the DrillThroughMain report, but the main difference is that it has a CustomerID parameter in
its SQL Query.
GroupHeader section
Since this report only displays order information for the CustomerID from the clicked hyperlink, the PageHeader section
could have been used, but this report uses the GroupHeader section. To make this section print at the top of each
page, the RepeatStyle property is set to OnPage. This section consists of five label controls to serve as column headers
for the Detail section and a CrossSectionBox control.
Detail section
Right click on the form, select View code to see the parameter in the SQL Query that collects the value from the
ViewerForm.
Parameters in SQL Queries are denoted by the <% and %> symbols that trigger ActiveReports to add them to the report's
Parameters collection. For more information, see Parameters.
The Detail section has five bound TextBox controls that display a list of order information for the customer. Select OrderID
and you will see that the HyperLink property is not set in the Properties window. To see the code that assigns the data
from the TextBox to its HyperLink property, right-click the report and select View Code. The HyperLink property is set in
the Detail BeforePrint event.
GroupFooter section
This section is not in use, so it is hidden by setting the Visible property to False. This section cannot be deleted, because
it is related GroupHeader section is in use.
DrillThrough2 Report
Like DrillThrough1, this report has a parameter in a SQL Query, but unlike the other two reports, this one has no hyperlink.
It displays order details for the OrderID value passed into it from the clicked hyperlink in DrillThroguh1.
GroupHeader section
Like in the previous report, this section contains Label controls to serve as column headers for the details, and a
CrossSectionBox control.
Detail section
Right click on the form, select View code to see the parameter in the SQL Query that collects the value from the
ViewerForm.
Sample Location
Visual Basic.NET
Note: To run this sample, you must have access to the Nwind.mdb. A copy is located at [User Documents
folder]\GrapeCity Samples\ActiveReports 9\Data\NWIND.mdb. If you are unable to access the data files in
the sample, create the Data folder and place all the data files to this folder, or change the reference path to the data
files within the folder according to your environment.
Project details
PrintMultiplePagesForm
This form contains the ActiveReports Viewer control. The Dock property of the viewer is set to Fill so that it resizes
automatically with the form at run time. The top section of Viewer contains a panel in which two
tabs, ComboBox control, Label and two Print buttons are placed. ComboBox control lets you select the number of pages
per sheet (2,4 or 8)and the Print button in PrintMultiple Pages using PrintOptions API and PrintMultiple Pages
using Custom Code tab, print the selected number of pages in one sheet. The form also has two dialogs - dlgPrint and
PrintDocument which assist in displaying the Print dialog box and printing the document.
Right-click and select View Code to see the code that displays the Invoice report when the form loads. Also the
code demonstrates the different ways of printing a document - the Print button in PrintMultiple Pages using Custom
Code tab uses the PrintDocument class and the Print button in PrintMultiple Pages using PrintOptions
API tab uses the PrintOptions class.
Invoice report
The Invoice report uses a PageHeader section, GroupHeader section, Detail section, GroupFooter section as well as a
PageFooter section to display data in a Label control.
PageHeader section
This section contains a Picture control to display the logo along with several Label and TextBox controls to
display company name, order date, address, Order number etc.
ghOrderID section
The DataField property of this section is set to OrderID. This allows subtotal summary functions in the related
GFOrderID section to calculate properly. This section contains a number of labels and bound TextBox controls, as well as
two Line controls.
Detail section
This section contains bound TextBox controls. These render once for each row of data found in the current OrderID before
the report moves on to the Footer sections.
GFOrderID section
The NewPage property of this section is set to After. This causes the report to break to a new page and generate a new
invoice after this section prints its subtotals.
This section contains several Label and TextBoxe controls. Subtotal and Freight TextBox use the following properties to
summarize the detail data: SummaryFunc, SummaryGroup, and SummaryType. However, the Total TextBox does
not use the DataField property or any of the summary properties, or even any code. To find the functionality of this
TextBox, in the design view, click the Script tab at the bottom of the report.
PageFooter section
This section has one simple Label control. The CanGrow property is set to False.
RDF Viewer
The RDF Viewer sample is used to view RDF files. It consists of an RdfViewerForm with an ActiveReports Viewer
control and an ExportForm with a Property Grid. The sample also contains a RDFs folder of saved reports.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Preview\RDFViewer\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Preview\RDFViewer\C#
Runtime features
When you run the sample, a Viewer control containing File and View menu appears on the top. Following options
are available in given menus.
File menu
Open: Loads any of the six given RDF files
Export: Exports file to HTML, Excel, Text, PDF, RTF or TIFF format
Print: Prints the loaded RDF file
Exit: Closes the application
View menu
TocView: Shows or hides all the report pages as thumbnails in the left pane
Toolbar: Shows or hides Viewer toolbar
Project Details
ExportForm
This form contains a Combobox to collect the user-selected export format, a property grid to display properties for
the selected format, and an OK button to export the report to the selected format. It also contains a Save dialog.
Right-click the form and select View Code to see how this is done.
The Export Format ComboBox's SelectedIndexChanged event sets the cmbExportFormat variable to the
selected export type. The cmbExportFormat variable is picked up in the OK button Click event, and then the
report Document is pulled from the Viewer and exported to the selected format.
RdfViewerForm
This form contains an ActiveReports Viewer control with its Dock property set to Fill. This ensures that the viewer
resizes along with the form at run time. It also contains a MenuStrip and an OpenFile dialog. To see the code
implementation of this form, right-click the form and select View Code.
The Click event of the Open option in the File menu filters to show only RDF files and opens the Open File dialog
to the RDFs folder. The dlgOpenFile_FileOK event loads the selected RDF file into the Viewer control.
The Click event of the Export option in the File menu opens a new ExportForm. For more information on the
Viewer control, see Using the Viewer.
RDFs folder
An RDF file is a static copy of a report saved to the native Report Document Format. This can be loaded into the
Viewer control without running it or accessing data. For more information, see Save and Load RDF Report Files.
The following five reports are included in this sample:
Catalog.rdf
Summary
Learn to display summarized data in a section report.
This section contains:
Calculated Fields
Demonstrates using an unbound data field to perform a calculation which can then be aggregated.
Data Field Expressions
Demonstrates the use of expressions in the DataField properties of controls.
Calculated Fields
The CalculatedFields sample demonstrates the use of calculated fields in a report, where the field values are
calculated in code. A custom field is added to the Fields collection in the DataInitialize event and the field value is
calculated in the FetchData event.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Summary\CalculatedFields\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Summary\CalculatedFields\C#
Runtime Features
When you run the sample, a report displaying ProductID, UnitPrice, Quantity, Discount, Extended Price and Total
value for each OrderID is displayed in the Viewer control. The Extended Price value is a calculated field that
displays the result of the formula specified in FetchData event.
Note: To run this sample, you must have access to the Nwind.mdb. A copy is located at [User Documents
folder]\GrapeCity Samples\ActiveReports 9\Data\NWIND.mdb. If you are unable to access the data
files in the sample, create the Data folder and place all the data files to this folder, or change the reference
path to the data files within the folder according to your environment.
Project Details
StartForm
The Viewer control has the Dock property set to Fill. This ensures that the viewer resizes along with the form at
run time. Right-click the form and select View Code to see the code used to run the report and display it in the
Note: Except for the Detail section, all sections come in header and footer pairs. Unused sections have their
Height properties set to 0 and their Visible properties set to False.
ghOrderID section
This group header section has the DataField property set to OrderID. This setting, along with data sorted by the
same field, displays a report grouped by OrderID. The section contains one bound TextBox control to display
the OrderID at the beginning of each group.
Detail section
Detail section of this report contains 5 bound TextBox controls that render for each row of data of the OrderID.
gfOrderID section
This group footer section displays total of the gfOrderID data in TextBox controls that have values passed in code,
or are bound to fields from the report's Fields collection using the DataField property. The total extended price for
the OrderID is summarized using the following properties:
SummaryFunc: Sum (the default value)
Adds values rather than counting or averaging them.
SummaryGroup: ghOrderID
Summarizes the values that fall within the current OrderID group.
SummaryRunning: Group
Calculates a running summary (each value is the sum of the current value and all preceding values)
within the same group level.
SummaryType: SubTotal
Summarizes the current group rather than a page or report total.
PageFooter section
The page footer section contains a static Label control that prints at the bottom of each page and contains the note
on the number of pages in the report.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Summary\DataFieldExpressions\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Section Reports\Summary\DataFieldExpressions\C#
Runtime Features
When you run the sample, the DataFieldExpressionsReport appears in the Viewer control. The
DataFieldExpressionsReport displays data, using the Fields collection from the OrderDetail class.
Note: Before running this sample, in the Solution Explorer, click the Licenses.licx file and then, from the
Build menu, select Build Runtime License. Please see To license Web Forms projects made on the trial
version for details.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\Standard Edition Web\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\Standard Edition Web\C#
Note: To run this sample, you must have access to the Nwind.mdb. A copy is located at [User Documents
folder]\GrapeCity Samples\ActiveReports 9\Data\NWIND.mdb. If you are unable to access the data
files in the sample, create the Data folder and place all the data files to this folder, or change the reference
path to the data files within the folder according to your environment.
Project Details
Reports folder
The Reports folder contains two rpx reports - the Invoice report and the NwindLabels report.
Invoice Report
The Invoice report uses three GroupHeader sections, a Detail section and a GroupFooter section as well as a label
in the PageFooter section to display data.
Note: Except for the Detail section, all sections come in header and footer pairs. Unused sections have their
Height properties set to 0 and their Visible properties set to False.
ghOrderHeader section
The DataField property of this section is set to OrderID. This setting, in conjunction with data ordered by the
OrderID field, causes the report to print all of the information for one order ID value, including all of the related
details and footers, before moving on to the next order ID. For more information on grouping, see Grouping Data
in Section Reports.
This section also contains a Picture control, a number of Label controls, and two bound TextBox controls. The
TextBoxes are bound using the DataField property in the Properties window, and the date is formatted using the
OutputFormat property.
ghOrderID section
The DataField property of this section is also set to OrderID. This allows subtotal summary functions in the
related GFOrderID section to calculate properly.
This section contains a number of labels and bound text boxes, as well as two Line controls.
ghTableHeader section
This section contains only labels for the data to follow in the Detail section.
Detail section
This section contains bound TextBox controls. These TextBoxes render once for each row of data found in the
current OrderID before the report moves on to the GroupFooter sections.
GFOrderID section
The NewPage property of this section is set to After. This causes the report to break to a new page and generate
a new invoice after this section prints its subtotals.
This section contains several labels and several TextBoxes. Two of the TextBox controls use the following
properties to summarize the detail data: SummaryFunc, SummaryGroup, and SummaryType. For more
information, Create a Summary Report.
The Total TextBox does not use the DataField property or any of the summary properties, or even any code. To
find the functionality of this TextBox, in design view, click the Script tab at the bottom of the report.
PageFooter section
This section has one simple Label control. For more information about report sections and the order in which they
print, see Section Report Structure and Section Report Events.
NwindLabels Report
TheNwindLabels report only uses the Detail section to display the report data.
Note: Except for the Detail section, all sections come in header and footer pairs. Unused sections have their
Detail section
This section contains bound TextBox controls and Label controls. This section prints 30 labels per 8½ x 11 sheet.
The Detail section uses the CanGrow property set to False to maintain the label size and the ColumnCount,
ColumnDirection, and ColumnSpacing properties to accommodate multiple labels in a single page.
ActiveReports.ReportService.asmx
The report web service required for the proper functioning of the Web Viewer. The
ActiveReports.ReportService.asmx is added automatically to the project when you place the WebViewer control on
the form. You can also add this service by using Add New Item in the Visual Studio Project menu.
For the information on how to use the WebViewer control, see Getting Started with the Web Viewer.
CustomExportHtml.aspx
This Web form is displayed by clicking the Custom Exporting HTML Example option on the Default.aspx page.
In CustomExportHtml.aspx, report is outputted to the ReportOutput folder using the CustomHtmlOutput class
and the exported HTML is displayed in the browser. The CustomHtmlOutput class implements the required
IOutputHtml in the HTML export and saves the output results to a file with a unique name.
Note: This sample requires write permissions to the ReportOutput folder that is located in the web samples
directory.
CustomExportPdf.aspx
The Web form is displayed by clicking the Custom Exporting PDF Example option on the Default.aspx page.
In CustomExportPdf.aspx, the report is exported to memory stream and then outputted in the browser.
Note: This sample requires write permissions to the ReportOutput folder that is located in the web samples
directory.
Default.aspx
This is the main Web form of the sample that shows the introductory text and links to other sample pages that
demonstrate the following web features.
Custom Exporting PDF Example - This link opens the Invoice report in the PDF Reader by exporting it
to memory stream and then outputting it in the browser.
Custom Exporting HTML Example - This link opens the NWindLabels report. This report is outputted
to the ReportOutput folder by using the CustomHtmlOutput class and the exported HTML is displayed in
the browser.
Web.config
This configuration file contains the httpHandlers that allow ActiveReports to process reports on the Web.
Note that you need to manually update version information here when you update your version of ActiveReports.
WPF Viewer
The WPF Viewer samples demonstrates the use of WPF Viewer and its options to view the rdlx and rpx reports.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 9\WPF Viewer\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 9\WPF Viewer\C#
Runtime Features
When you run the sample, MainWindow.xaml containing the WPF Viewer, Select Report ComboBox, Preview
button and Add Custom Button CheckBox appears.
Select Report
In the Select Report ComboBox, you can select from a list of 6 sample reports. The ComboBox contains the
following reports - Catalog.rdlx, EmployeeSales.rdlx, Invoice1.rdlx, Invoice2.rpx, LabelReport.rpx, and
PaymentSlip.rpx.
Preview
The Preview button opens the report selected in Select Report ComboBox in the WPF Viewer.
Add custom button
The Add custom button CheckBox demonstrates the customization options of the WPF Viewer. To see the About
Us custom button appear in the WPF Viewer toolbar, select the Add custom button CheckBox and click the
Preview button. To remove the About Us custom button from the WPF Viewer toolbar, click to clear the Add
custom button CheckBox and then click the Preview button.
Note: Preview button and Add custom button CheckBox are only enabled when a report is selected from
the Select Report ComboBox.
Project Details
Reports folder
The folder contains the following reports.
Walkthroughs
The Walkthroughs section of the User Guide provides you with step-by-step tutorials that you can follow as you
create projects in Visual Studio. These walkthroughs cover the key features of Page Reports, RDL Reports and
Section Reports in different scenarios. The walkthroughs progress from basic through advanced for Standard and
Professional Editions of ActiveReports.
This section contains information about:
Page Report/RDL Report Walkthroughs
Learn the dynamic features through easy to implement scenarios for Page Report and RDL Report.
Section Report Walkthroughs
Use the walkthroughs under this section to understand key features of a section report through simple scenarios.
Common Walkthroughs
Common walkthroughs comprise of scenarios to introduce the key features of page, RDL and section reports.
Data
This section contains the following walkthroughs that fall under the Data category.
Master Detail Reports
This walkthrough demonstrates how to create a master detail report using the Table control and grouping.
Reports with Parameterized Queries
This walkthrough demonstrates how to create a simple dynamic query.
Reports with Stored Procedures
This walkthrough demonstrates how to create a report that uses a stored procedure as a data set.
Reports with XML Data
This walkthrough demonstrates how to connect a report to an XML data source and to create a data set.
Expressions in Reports
This walkthrough demonstrates how to use expressions to achieve different effects in a report.
Note:
This walkthrough uses the Customer table from the Reels database. By default, in ActiveReports,
the Reels.mdb file is located in the [User Documents folder]\GrapeCity Samples\ActiveReports
9\Data folder.
Although this walkthrough uses Page reports, but this can be implemented using RDL reports also.
When you complete this walkthrough you get a layout that looks similar to the following at design time and at
runtime.
Runtime Layout
2. In the Report Data Source Dialog that appears, select the General page and in the Name field, enter a
name like ReportData.
3. On this page, create a connection to the Reels database. See Connect to a Data Source for information on
connecting to a data source.
To add a dataset
1. In the Report Explorer, right-click the data source node and select the Add Data Set option or select Data
Set from the Add button.
2. In the DataSet Dialog that appears, select the General page and enter the name of the dataset as
CustomerOrders. This name appears as a child node to the data source icon in the Report Explorer.
3. On the Query page of this dialog, in the Query field enter the following SQL query.
SQL Query
SELECT CustomerID, Title, LastName, Quantity, Price, [Quantity]*[Price] AS
Total FROM CustomerOrders WHERE CustomerID < 1010
4. Click the Validate DataSet icon at the top right hand corner above the Query box to validate the query.
5. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
To create a layout for the report
To add a table with grouping to the report
1. From the toolbox, drag a Table data region onto the report design surface and go to the Properties
Note: You cannot change the name of a table group until after you have set the expression.
6. Click OK to close the dialog. The group header and footer rows are added to the table.
To add a fourth column to the table
1. Select the second column and in the Properties Window, change its Width property to 0.92in.
2. Select the third column and in the Properties Window, change its Width property to 1.04in.
3. Select the first column and in the Properties Window, change its Width property to 3.5in.
Tip: Making some columns narrower before making other columns wider prevents your report width
from changing.
4. Right-click the column handle above the third column and select Insert Column to the Right. The
inserted fourth column has the same width as the third column, which is 1.04in.
To add data to the table
1. Place your mouse over the Textbox located in the first column of the group header row of the table to
display the field selection adorner.
2. Click the adorner to display the list of available fields from the DataSet and select LastName. This
automatically places an expression in the group header row and simultaneously places a static label in the
table header row.
3. In the Properties window, set the FontSize property of this textbox to 12pt.
4. In the table header row, delete the static label Last Name.
5. To display static labels at the beginning of each new group, right-click the row handle to the left of the
group header row and select Insert Row Below.
6. In the first column of the detail row, use the field selector adorner to select the Title field.
7. In the textbox immediately above it, type Title.
8. In the table header row, delete the static label Title.
9. In the second column of the detail row, use the field selector adorner to select the Quantity field. This
automatically places an expression in the detail row and simultaneously places a static label in the header
row of the same column.
10. In the Properties window, set the TextAlign property of the Quantity field to Left.
11. Cut the static label and paste it into the inserted row immediately above the detail row.
12. In the third column of the detail row, use the field selector adorner to select the Price field.
13. In the Properties window, set the following properties.
14. Cut the static label from the group header and paste it into the inserted row immediately above the detail
row.
15. Select the Total field for the fourth column of the detail row of the table.
16. In the Properties window, set the following properties.
17. Cut the static label from the group header and paste it into the inserted row immediately above the detail
4. From the Report Explorer, drag the Total field into the group footer row in the fourth column to add
subtotaling to the group. Notice that the expression automatically uses the Sum function.
5. Go to the Properties window to set the following properties.
6. From the Report Explorer, drag the Total field into the table footer row in the fourth column. This adds
grand totaling to the table.
7. Go to the Properties window to set the following properties.
10. From the toolbox, drag the TextBox control onto the PageHeader section to span the entire width of the
report.
11. Go to the Properties Window to set the following properties.
12. For an page report, in the Report Explorer select the Table data region and set its FixedSize property to
6.5in, 7in.
To view the report
Click the preview tab to view the report at design time.
OR
Open the report in the Viewer. See Using the Viewer for further information.
Note:
This walkthrough uses the MovieType table from the Reels database. By default, in ActiveReports,
the Reels.mdb file is located at [User Documents folder]\GrapeCity Samples\ActiveReports
10\Data\Reels.mdb.
Although this walkthrough uses Page reports, you can also implement this using RDL reports.
When you complete this walkthrough you get a layout that looks similar to the following at design time and at
runtime.
Runtime Layout
2. In the Report Data Source Dialog that appears, select the General page and in the Name field, enter a
name like ReportData.
3. On this page, create a connection to the Reels database. See Connect to a Data Source for information on
connecting to a data source.
To add a dataset
1. In the Report Explorer, right-click the data source node and select the Add Data Set option or select Data
Set from the Add button.
4. Click the Validate DataSet icon at the top right hand corner above the Query box to validate the query.
5. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
To create a layout for the report
1. From the toolbox, drag a Table data region onto the report design surface and set the following properties
in the Properties Window:
2. In the Report Explorer from the Products dataset, drag the following fields onto the detail row of the table.
Note: This automatically places an expression in the detail row and simultaneously places a static
label in the header row of the same column.
3. Select the header row, click the table handle to the left of the row and in the Properties Window, set the
following properties:
4. Select the StorePrice field in the detail row and in the Properties Window, set its Format property to
Currency.
5. Click the column handle at the top of each column in turn to select it, and in the Properties Window, set the
Width property as indicated in the table.
Column Width
First 4.5in
Second 1in
4. Click the Validate icon to validate the query and to populate the Fields list.
5. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
To add parameters to the report
1. In the Report Explorer, select the Parameters node.
2. Right-click the node and select Add Parameter to open the Report - Parameters dialog.
3. In the dialog box that appears, select the parameter from the parameters list.
4. Set properties in the following fields below the parameters list.
In the General tab:
Name: MediaType
DataType: String
Text for prompting users for a value: Select a media type
In the Available Values tab select From query:
DataSet: MediaType
Value: MediaID
Label: Description
5. Click OK to close the dialog and add the parameter to the collection. This parameter appears under the
Parameters node in the Report Explorer.
To modify the Products dataset to use a dynamic query
1. In the Report Explorer, right-click the Products dataset and select Edit.
2. In the DataSet dialog that appears, select the Query page.
3. In the Query field, change the query to the following expression:
Query
="SELECT Movie.Title, Product.InStock, Product.StorePrice,
MediaType.Description FROM MediaType INNER JOIN (Movie INNER JOIN
(Product INNER JOIN MovieProduct ON Product.ProductID =
MovieProduct.ProductID) ON Movie.MovieID = MovieProduct.MovieID) ON
MediaType.MediaID = MovieProduct.MediaType" &
IIf(Parameters!MediaType.Value = 0, ""," WHERE (MediaType = " &
Parameters!MediaType.Value & ")") & " ORDER BY Movie.Title"
Note: Using Label instead of Value in the expression displays a more readily understandable
Description field instead of the MediaID field we used for the parameter's value.
Note:
This walkthrough uses a table from the Reels database. By default, in ActiveReports, the Reels.mdb
file is located in the [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data folder.
Although this walkthrough uses Page reports, but this can be implemented using RDL reports also.
When you complete this walkthrough you get a layout that looks similar to the following at design time and at
runtime.
Runtime Layout
2. In the Report Data Source Dialog that appears, select the General page and in the Name field, enter a
name like Reels.
3. On this page, create a connection to the Reels database. See Connect to a Data Source for information on
connecting to a data source.
To add a dataset with a parameter
1. In the Report Explorer, right-click the data source node and select the Add Data Set option or select Data
Set from the Add button.
2. In the DataSet Dialog that appears, select the General page and enter the name of the dataset as
SalesDataForStore. This name appears as a child node to the data source icon in the Report Explorer.
3. On the Query page of this dialog, set the Command Type to Stored Procedure.
4. On the Query page of this dialog, in the Query field enter the stored procedure name (e.g.
SalesDataForStore).
5. Click the Validate icon to validate the query. You may receive an error at this point since the required
parameters have not yet been added.
6. Go to the Parameters page and add a Parameter using the Add(+) button.
7. On the same page, enter Name as StoreID and Value as 1002.
8. Select the Query page of DataSet dialog, and click the Validate icon to validate the query and load the
fields.
9. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
To create a layout for the report
1. From the toolbox, drag a Table data region onto the report design surface.
2. In the Table data region, place your mouse over the cells of the table details row to display the field
selection adorner.
3. With the Table selected, right-click and open the Properties Window to set the following properties:
4. Click the adorner to show a list of available fields from the SalesDataForStore dataset and add the following
fields to the cells of the table details row.
Cell Field
Left Cell StoreID
Middle Cell UnitsSold
Right Cell NetSales
This automatically places an expression in the detail row and simultaneously places a static label in the
6. Click the column handle at the top of each column in turn to select it, and in the Properties Window, set the
Width property as indicated in the table:
Column Width
First 3.5in
Second 2in
Third 1in
Tip: In a RDL report, you can also add a Page Header to place the Textbox control.
Note:
This walkthrough uses the Factbook sample database. By default, in ActiveReports, the
Factbook.rdsx file is located at [User Documents folder]\GrapeCity Samples\ActiveReports
9\Data\Factbook.rdsx.
Although this walkthrough uses Page reports, but this can be implemented using RDL reports also.
When you complete this walkthrough you get a layout that looks similar to the following at design time and at
runtime.
Runtime Layout
2. In the Report Data Source Dialog that appears, select the General page and in the Name field, enter a
name like Factbook.
3. On this page, check the Shared Reference checkbox.
4. Click the Browse button and select Factbook.rdsx, which is located in [User Documents folder]\GrapeCity
Samples\ActiveReports 9\Data. See Connect to a Data Source for information on connecting to a data
source.
To add a dataset
1. In the Report Explorer, right-click the data source node and select the Add Data Set option or select Data
Set from the Add button.
2. In the DataSet Dialog that appears, select the General page and enter the name of the dataset as
ExchangeRates.
3. On the Query page, enter the following XML path into the Query text box to access data for every country
except "World":
//country [@name != 'World']
4. On the Fields page, enter the values in the table below to create fields for your report. Values for XML data
fields must be valid XPath expressions.
5. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
To add controls to the report
1. From the toolbox, drag a List data region onto the design surface of the report and go to the Properties
window to set the DataSetName property to ExchangeRates.
2. From the Report Explorer, drag the Name field onto the list, center it at the top and go to the Properties
window to set the FontSize property to 14pt.
3. From the Report Explorer, drag the following fields onto the list with properties set as described in the table
below.
Note: You will notice that the expressions created for these fields are different than usual. Because
Visual Basic syntax does not allow an identifier that begins with a number, any numeric field names
must be treated as strings in expressions.
4. From the toolbox, drag a TextBox onto the list and go to the Properties window to set the properties as
described in the table below to combine static text with a field value.
5. From the toolbox, drag TextBox controls onto the list and go to the Properties window to set the properties
as described in the table below to create static labels.
TextBox1
TextBox2
TextBox3
TextBox4
TextBox5
TextBox6
Expressions in Reports
You can use expressions in the control's properties to calculate values. You can also use expressions to concatenate fields, to
Note:
This walkthrough uses the MovieProduct table from the Reels database. By default, in ActiveReports, the Reels.mdb file
is located in the [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data folder.
Although this walkthrough uses Page reports, but this can be implemented using RDL reports also.
When you complete this walkthrough you get a layout that looks similar to the following at design time and at runtime.
Runtime Layout
2. In the Report Data Source Dialog that appears, select the General page and in the Name field, enter a name like ReportData.
3. On this page, create a connection to the Reels database. See Connect to a Data Source for information on connecting to a data
source.
To add a dataset
1. In the Report Explorer, right-click the data source node and select the Add Data Set option or select Data Set from the Add
button.
2. In the DataSet Dialog that appears, select the General page and enter the name of the dataset as DVDStock. This name appears
as a child node to the data source icon in the Report Explorer.
3. On the Query page of this dialog, in the Query field enter the following SQL query.
SQL Query
SELECT * FROM DVDStock
4. Click the Validate DataSet icon at the top right hand corner above the Query box to validate the query.
5. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
4. In the Report Explorer from the DVDStock dataset, drag the following fields into the detail row and set their properties as follows.
5. Select detail row cell containing the StorePrice values in the TableColumn2 and in the Properties Window, set the Format
property to Currency.
6. Select the header row using the row handle to the left and in the Properties Window, set the FontWeight property to Bold.
7. For an Page report, in the Report Explorer select the Table control and in the Properties window, set the FixedSize property to
6.5in, 7in.
To add a field expression to a text box to multiply two field values
1. In the detail row of the fourth column, enter the following expression: = Fields!InStock.Value* Fields!StorePrice.Value
2. Go to the Properties Window to set the Format property of the textbox to Currency formatting.
3. In the header row immediately above this Textbox, enter Stock Value for the static label.
To add an Immediate If expression to show or hide a report control
1. Select the cell in which we multiplied two field values (in the detail row of the fourth column) and in the Properties window,
expand the Visibility property.
2. In the Hidden property, enter the following immediate if expression to hide the textbox if there is no stock for the item.
=iif(Fields!InStock.Value=0, True, False)
To add a Data Visualization expression to display data graphically
The ColorScale3 visualizer function displays a range of colors to indicate minimum, average, and maximum values in the data. See the
Data Visualizers topic for further information.
Select the cell in the detail row under the In Stock label and in the Properties window, set the BackgroundColor property to the
following expression:
=ColorScale3(Fields!InStock.Value, 0, Avg(Fields!InStock.Value), Max(Fields!InStock.Value), "Red", "Yellow", "Green")
Note: The parameters of the ColorScale3 function evaluate to Value, Minimum, Average, Maximum, StartColor, MiddleColor
and EndColor. Note that aggregate functions (Avg and Max) are used within the ColorScale3 function. See Functions for details on
these and other aggregate functions.
Layout
This section contains the following walkthroughs that fall under the Layout category.
BandedList Reports
This walkthrough demonstrates how to create a grouped BandedList report.
Collate Multiple Copies of a Report
This walkthrough demonstrates how to use the collation feature in a report that contains layouts on two page tabs.
Columnar Layout Reports (RDL)
BandedList Reports
You can create a freeform report with groups using the BandedList control. This walkthrough illustrates how to
create a grouped BandedList report.
The walkthrough is split up into the following activities:
Adding an ActiveReport to a Visual Studio project
Connecting the report to a data source
Adding a dataset
Adding a banded list with grouping
Adding controls to the banded list
Viewing the report
Note:
This walkthrough uses the Movie table from the Reels database. By default, in ActiveReports, the
Reels.mdb file is located in the [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data
folder.
Although this walkthrough uses Page reports, but this can be implemented using RDL reports also.
When you complete this walkthrough you get a layout that looks similar to the following at design time and at
runtime.
Runtime Layout
2. In the Report Data Source Dialog that appears, select the General page and in the Name field, enter a
name like ReportData.
3. On this page, create a connection to the Reels database. See Connect to a Data Source for information on
connecting to a data source.
To add a dataset
1. In the Report Explorer, right-click the data source node and select the Add Data Set option.
2. In the DataSet Dialog that appears, select the General page and enter the name of the dataset as Movies.
This name appears as a child node to the data source icon in the Report Explorer.
3. On the Query page of this dialog, change the Command Type to TableDirect and enter Movie into the
Query text box.
4. Click the Validate DataSet icon at the top right hand corner above the Query box to validate the query.
5. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
To add the BandedList with grouping
1. From the toolbox, drag a BandedList data region onto the design surface and go to the properties window
to set the DataSetName property to Movies.
Note: To select the banded list, click inside any band in the list and click the four-way arrow that
appears at the top left of the control.
2. Right-click inside the banded list and select Footer. This removes the footer band that we are not using in
this walkthrough.
3. Right-click inside the banded list and select Insert Group. This adds a group header between the
BandedList header and the detail section, and a group footer below the detail section, and opens the
BandedList - Groups dialog.
4. In the BandedList - Groups dialog, drop down the list of expressions in the Group on expression box and
select =Fields!YearReleased.Value to group the movies based on the year in which they were released.
5. In the same dialog, change the Name to Year.
6. In the same dialog under Layout, clear the Include group footer checkbox to remove the group footer.
7. Click the Add icon. This adds a second group header under the first, and a group footer below the detail
section.
8. In the same dialog, select the newly added group from the list of groups, drop down the list of expressions
in the Group on expression box and select =Fields!MPAA.Value to group the movies based on the rating
(for example, G, PG, etc).
9. In the same dialog, change the Name to MPAA.
10. In the same dialog under Layout, clear the Include group footer checkbox to remove the group footer.
11. Click OK to close the dialog.
2. Click the BandedList1_Header band adorner (the grey bar along the top of the band) to select the
banded list header.
3. In the Properties window, set the following properties for the banded list header:
4. From the Report Explorer drag the YearReleased field onto the first grouping band (Year_Header) of the
banded list.
5. With this field selected, go to the Properties window to set the following properties:
6. Click the Year_Header band adorner (the grey bar along the top of the band) to select it and go to the
properties window to set the Height property of the header band to 0.25in.
7. From the Report Explorer, drag the MPAA field into the second grouping band (MPAA_Header) of the
banded list.
8. Go to the Properties window to set the following properties:
Note: The Value property is automatically set to an expression using the First aggregate. This
displays the movie rating for each group.
Note: When you drag and drop fields from a dataset in the Report Explorer onto the design
surface, these fields are automatically converted to Textbox controls that you can modify by setting
the control properties in the Properties Window.
12. Once you've arranged the fields, select the IsColor field and in the properties window, change the Value
property to the following expression so that instead of "True" or "False," it will read "Color" or "Black and
White."
=Iif(Fields!IsColor.Value=True, "Color", "Black and White")
13. From the toolbox, drag six TextBox controls onto the detail band and in the properties window, set their
properties as indicated.
TextBox1
TextBox2
TextBox3
TextBox5
TextBox6
14. From the toolbox, drag a Line control onto the detail band and in the Properties window, set the properties.
15. For a Page report, in the Report Explorer select the BandedList control and in the Properties window, set
its FixedSize property to 6.5in, 7in.
To view the report
Click the preview tab to view the report at design time.
OR
Open the report in the Viewer. See Using the Viewer for further information.
Note:
This walkthrough uses the CustomerOrders table from the Reels database. By default, in ActiveReports, the
Reels.mdb file is located at [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data\Reels.mdb.
Although this walkthrough uses Page reports, but this can be implemented using RDL reports also.
When you complete this walkthrough you get a report that looks similar to the following. These images show the result of the Value
collation mode.
Note: The information provided henceforth is an extension of the Overflow Data in Multiple Pages walkthrough, so we
recommend that you go through this topic before moving to the next procedure.
5. In the Theme Editor, click OK and in the Save As dialog that opens, choose a directory on your local machine and enter the
name, Default Theme for your new theme.
6. Click Save to save the theme at the desired location.
7. Repeat steps 3-6 above to add another theme to the report. Define the colors and constant expressions of the theme under the
corresponding tabs as follows:
Theme 2
4. In the Report Explorer, select Page 2 node to open the layout for the second page of the report.
5. In the Properties window, go to the BackgroundColor property and click the arrow to display the drop-down list of values.
6. In the list that appears, go to the Theme button and select Light1.
7. From the Visual Studio toolbox, ActiveReports 9 Page Report tab, drag the Textbox control and drop it onto the Page 1
design surface.
8. With this TextBox control selected, set the following properties in the properties window. This is to display a constant value
associated with the Theme.
9. From the Visual Studio toolbox, drag the Textbox control and drop it onto the Page 2 design surface. Set the properties
specified in step 8 above in the properties window.
Your layout now contains two themes and a constant expression displaying the theme you are using on the top left corner of the page.
To set up collation
Collation is set to determine the order in which the report pages are rendered when you have multiple themes in the report. In order
to define the order, you need to set the CollateBy ('CollateBy Property' in the on-line documentation) property.
1. In the Designer, click the gray area around the report page to select the report.
2. In the Properties Window, go to the CollateBy property and select the Simple mode. The report will be rendered in the
following way - the report renders all pages with theme 1, then all pages with theme 2.
3. In the Properties Window, go to the CollateBy property and select the ValueIndex mode. The report will be rendered by page
number. For example, if you have a report with 2 themes, the report renders page 1 for theme 1 and 2, then page 2 for theme
1 and 2, and so on.
4. In the Properties Window, go to the CollateBy property and select the Value mode. The report will be rendered by the grouping
expression that you specify in the FixedPage dialog. For example, if you have a report comprising of 2 themes with grouping,
Note: This walkthrough uses the CustomerMailingList table from the Reels database. By default, in
ActiveReports, the Reels.mdb file is located in the [User Documents folder]\GrapeCity Samples\ActiveReports
9\Data folder.
When you complete this walkthrough you get a layout that looks similar to the following at design time and at
runtime.
Runtime Layout
2. In the Report Data Source Dialog that appears, select the General page and in the Name field, enter a
name like ReportData.
3. On this page, create a connection to the Reels database. See Connect to a Data Source for information on
connecting to a data source.
To add a dataset
1. In the Report Explorer, right-click the data source node and select the Add Data Set option or select Data
Set from the Add button.
2. In the DataSet Dialog that appears, select the General page and enter the name of the dataset as
CustomerList. This name appears as a child node to the data source icon in the Report Explorer.
3. On the Query page of this dialog, in the Query field enter the following SQL query.
SQL Query
SELECT TOP 100 * FROM CustomerMailingList
UNION
SELECT TOP 100 * FROM CustomerMailingList WHERE Country = "USA"
ORDER BY 8 DESC
4. Click the Validate DataSet icon at the top right hand corner above the Query box to validate the query.
5. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
To create a column layout for the report
1. In the Report Explorer, select Body and set the following properties in the properties window.
2. In the Visual Studio toolbox, go to the ActiveReports 9 Page Report tab and drag the List data region
onto the design surface.
3. In the Properties Window, set the following properties for the List.
4. In the Visual Studio toolbox, go to the ActiveReports 9 Page Report tab and drag three TextBox controls
onto the List data region added above.
5. In the Properties Window, set the following properties for TextBox1.
Matrix Reports
Use nested grouping and subtotals in the Matrix data region, to replicate a drilldown report. This walkthrough
illustrates a step by step overview of a Matrix report through a simple example.
The walkthrough is split into the following activities:
Adding an ActiveReport to a Visual Studio project
Connecting the report to a data source
Adding a dataset with calculated fields
Creating a layout for the report
Adding nested grouping and drill-down to the matrix
Adding subtotals to the matrix
Enhancing the appearance of the report
Viewing the report
When you complete this walkthrough you get a layout looks similar to the following at design time and at runtime.
Runtime Layout
2. In the Report Data Source Dialog that appears, select the General page and in the Name field, enter a
name like ReportData.
3. On this page, create a connection to the Reels database. See Connect to a Data Source for information on
connecting to a data source.
To add a dataset
1. In the Report Explorer, right-click the data source node and select the Add Data Set option or select Data
Set from the Add button.
2. In the DataSet Dialog that appears, select the General page and enter the name of the dataset as Sale.
This name appears as a child node to the data source icon in the Report Explorer.
3. On the Query page of this dialog, in the Query field enter the following SQL query.
SQL Query
SELECT Store, SaleDate, SalesAmount FROM Sale ORDER BY Store, SaleDate
4. Click the Validate DataSet icon at the top right hand corner above the Query box to validate the query.
6. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
To create a layout for the report
1. Click the gray area below the design surface to select the report, go to the Properties Window, expand the
PageSize property and set the Width to 10in and Height 11in.
2. From the toolbox, drag a Matrix data region onto the body of the report in the top left corner. The matrix
initially has four textbox cells.
3. In the Report Explorer from the Sale dataset, drag the Store field into the bottom left cell in the matrix.
This is the row header, and dragging a field into it automatically adds a Row Group which groups data by
store in rows down the page at run time.
4. Go to the Properties Window to set the Value property to ="Store #" & Fields!Store.Value. This
concatenates a string with the field value and makes the Store value more user-friendly at run time.
5. In the Report Explorer from the Sale dataset, drag the Year field into the top right cell in the matrix. This
is the column header, and automatically groups data in columns to the right at runtime.
6. With the Year cell selected, go to the Properties window to set the TextAlign property to Center.
7. In the Report Explorer from the Sale dataset, drag the SalesAmount field into the bottom right cell in the
matrix. This is the detail data cell, and displays aggregated data for the intersection of each column and
row at run time.
8. With the SalesAmount cell selected, in the Properties window set the Format property to Currency and the
Value property to =Sum(Fields!SalesAmount.Value).
To add nested grouping and drilldown features to the matrix
1. In the Report Explorer from the Sale dataset, drag the Quarter field to the top right Year cell and move
the cursor down slightly so that the bar appears at the bottom edge of the cell before dropping it.
This adds a cell below the Year cell and automatically adds a Quarter grouping to the Column Groups for
the matrix.
2. With the new Quarter cell selected, go to the Properties window to set the TextAlign property to Center.
3. Select the Matrix data region and under the Properties Window select Property dialog command to open
the Matrix dialog. See Properties Window for details on commands.
4. On the Column Groups page, select the Matrix1_Quarter group and go to the Visibility tab.
5. Under Visibility, change the Initial visibility to Hidden and select the check box next to Visibility can be
toggled by another report control.
Tip: In order to provide drill-down functionality, we must set visibility on the group we want to hide.
6. In the drop down enabled below, enter TextBox3 (Textbox containing Year values in the Matrix) and click
OK to close the dialog.
This adds a cell below the Year cell and automatically adds a Month grouping to the Column Groups for the
matrix.
8. Select the Matrix data region and under the Properties Window select Property dialog command to open
the Matrix dialog.
9. On the Column Groups page, select the Matrix1_Month group and go to the Visibility tab.
10. Under Visibility, change the Initial visibility to Hidden and select the check box next to Visibility can
be toggled by another report control.
11. In the drop down enabled below, enter TextBox5 (Textbox containing Quarter values in the Matrix) and
click OK to close the dialog.
This enables users to click the plus sign next to the quarter to view the monthly details at runtime.
12. Click OK to close the dialog.
To add subtotals to the matrix
Without subtotals, viewing the report at run time shows data for each year, or if expanded, for each quarter or
month. Adding subtotals displays totals for each group in a new column to the right of the group.
1. Right-click the Year cell and select Subtotal. A new column appears to the right with the text Total and a
green mark at the top right corner (Clicking the green mark displays the MatrixSubtotal properties in the
Properties Window).
2. Select the new Total cell and go the Properties Window to set the following properties:
Note: Changing the textbox value does not affect the grouping value, so the data is still grouped by
month.
2. Holding down the Shift key, select the two textboxes in the top row containing the Year and Grand Total
cells and make the following changes in the Properties window:
3. Holding down the Shift key, select the two textboxes in the second row containing the expressions
=Fields!Quarter.Value and =Fields!Year.Value & " Total" and make the following changes in the Properties
Window:
4. Holding down the Shift key, select the two textboxes in the third row containing the month and quarterly
total cells and make the following changes in the Properties Window:
5. Holding down the Shift key, select the two textboxes in the fourth row containing the store number and
detail cells and make the following change in the Properties Window:
6. From the toolbox, drag a Textbox control onto the design surface to span the entire width of the report.
Tip: In a RDL report, you can place the Textbox in the PageHeader.
Note: This topic uses the Movie table in the Reels database. By default, in ActiveReports, the Reels.mdb file
is located at [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data\Reels.mdb.
When you complete this walkthrough you get a layout that looks similar to the following at design time and at
runtime.
Notice that the runtime report layout below is similar to the one you see at design time except for the data which
you see at runtime or when you preview the report.
Runtime Layout
2. In the Report Data Source Dialogthat appears, select the General page and in the Name field, enter a
name like ColumnData.
3. On this page, create a connection to the Reels database. See Connect to a Data Source for information on
connecting to a data source.
To add a dataset
1. In the Report Explorer, right-click the data source node and select the Add Data Set option or select Data
Set from the Add button.
2. In the DataSet Dialog that appears, select the General page and enter the name of the dataset as
MovieList. This name appears as a child node to the data source icon in the Report Explorer.
3. On the Query page of this dialog, in the Query field enter the following SQL query.
SQL Query
SELECT * FROM Movie
4. Click the Validate DataSet icon at the top right hand corner above the Query box to validate the query.
5. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
To create a layout for the report
1. In the Visual Studio toolbox, go to ActiveReports 9 Page Report tab and drag a TextBox control onto the
design surface.
2. Select the TextBox control and go to the properties window to set the following properties. This TextBox
functions as the title in the report layout.
3. From the Visual Studio toolbox, drag and drop a Table data region onto the design surface and set its
following properties in the properties window.
4. In the Table data region, right click the footer row and select Table Footer from the context menu to
delete the unnecessary footer row.
5. In the table details row, add the following fields using the field selection adorner:
6. In the table details row, select the left cell containing the Title field and go to the Properties window to set
the ShrinkToFit property to True. This will avoid clipping of longer movie titles and fit the string in the
same cell in a smaller font size.
7. In the design view, select the following rows of the Table data region by clicking the table handle to the left
of the row and go to the Properties window to set the following properties:
8. From the Visual Studio toolbox, drag and drop three OverflowPlaceHolder controls onto the design surface
and the set the following properties in the Properties window for each of them so that the data appears in a
columnar format.
Note: Notice that the OverflowName property is set to link each OverflowPlaceHolder control to the
next one.
Note: This walkthrough uses the CustomerOrders table from the Reels database. By default, in
ActiveReports, the Reels.mdb file is located at [User Documents folder]\GrapeCity Samples\ActiveReports
9\Data\Reels.mdb.
When you complete this walkthrough you get a layout that looks similar to the following at design time and at run
time.
Page 1 Page 2
Notice that the runtime report layout below is similar to the one you see at design time except for the data which
is added to the report at runtime or when you preview it.
Runtime Layout
Page 1 Page 2
2. In the Report Data Source Dialog that appears, select the General page and in the Name field, enter a
name like CustomerData.
3. On this page, create a connection to the Reels database. See Connect to a Data Source for information on
connecting to a data source.
To add a dataset
1. In the Report Explorer, right-click the data source node and select the Add Data Set option or select Data
Set from the Add button.
2. In the DataSet Dialog that appears, select the General page and enter the name of the dataset as
OrdersList. This name appears as a child node to the data source icon in the Report Explorer.
3. On the Query page of this dialog, in the Query field enter the following SQL query.
SQL Query
Select * from customerorders
4. Click the Validate DataSet icon at the top right hand corner above the Query box to validate the query.
5. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
To create a layout for the first page
1. Click the design surface to select the page, go to the properties window and set the FixedLayout -
Grouping property to =Fields!SalesID.Value. See Grouping in a FixedPage to understand grouping
further.
Control Properties
Textbox Color: DarkSlateBlue
Font: Normal, Arial, 11pt, Bold
Location: 0in, 1in
Size: 2in, 0.25in
TextAlign: Center
Value: 5473 Sidelong Street
Textbox Color: DarkSlateBlue
Font: Normal, Arial, 11pt, Bold
Location: 0in, 1.25in
Size: 2in, 0.25in
TextAlign: Center
Value: Siler City, NC. 27344
Textbox Font: Normal, Arial, 10pt, SemiBold
Location: 0in, 2in
Size: 1in, 0.25in
TextAlign: Right
Value: Sales Date :
Textbox Font: Normal, Arial, 10pt, SemiBold
Location: 0in, 2.25in
Size: 1in, 0.25in
TextAlign: Right
Value: Sales ID :
Textbox Font: Normal, Arial, 10pt, SemiBold
Location: 3in, 2in
Size: 1.5in, 0.25in
TextAlign: Right
Value: Customer Name :
Textbox Font: Normal, Arial, 10pt, SemiBold
Location: 3in, 2.25in
Size: 1.5in, 0.25in
TextAlign: Right
Value: Address :
Textbox Font: Normal, Arial, 10pt, SemiBold
Location: 3in, 2.50in
Size: 1.5in, 0.25in
TextAlign: Right
Value: City :
Textbox Font: Normal, Arial, 10pt, SemiBold
Location: 3in, 2.75in
Size: 1.5in, 0.25in
TextAlign: Right
Value: Country :
Textbox Font: Normal, Arial, 10pt, SemiBold
Location: 0in, 4in
Size: 1.5in, 0.25in
TextAlign: Right
Value: Account Number:
RepeatHeaderOnNewPage: True
Size: 6.5in, 0.75in
5. From the Report Explorer drag and drop the following fields onto the Page 1 design surface and set the
following properties in the properties window.
Fields
Field Properties
SaleDate Format: D
Location: 1in, 2in
Size: 2in, 0.25in
TextAlign: Left
SalesID Location: 1in, 2.25in
Size: 2in, 0.25in
TextAlign: Left
FirstName Location: 4.5in, 2in
Size: 2in, 0.25in
TextAlign: Left
Address1 Location: 4.5in, 2.25in
Size: 2in, 0.25in
TextAlign: Left
City Location: 4.5in, 2.5in
Size: 2in, 0.25in
TextAlign: Left
Country Location: 4.5in, 2.75in
Size: 2in, 0.25in
TextAlign: Left
AccountNumber Location: 1.5in, 4in
Size: 2in, 0.25in
TextAlign: Left
6. Hover your mouse over the columns of the Table Details row to access the field selection adorner and set
the following fields in the table cells along with their properties.
This automatically places an expression in the details row and simultaneously places a static label in the
header row of the same column.
7. Select the Table Header row and set the following properties in the properties window.
8. Set the properties of the following cells on the Table Footer row through the properties window.
Cell Properties
Middle Cell Font: Normal, Arial, 10pt, Bold
TextAlign: Right
Value: Total:
Right Cell Font: Normal, Arial, 10pt, Bold
Format: c
TextAlign: Center
Value: =Sum(Fields!Price.Value)
9. In the Report Explorer, expand the Common Values node and drag and drop the Page N of M (Section)
field onto the Page 1 design surface and set its Location property to 0in, 8in in the properties window.
To create a layout for subsequent Pages
1. Click the New tab to add a new page to the report layout. This page is named Page 2 by default.
2. From the Visual Studio toolbox, drag the following controls from the ActiveReports 9 Page Report tab,
drop it onto the Page 2 design surface and set the properties in the properties window.
Controls
Control Properties
Textbox Font: Normal, Arial, 12pt, Bold
Location: 0in, 1in
Size: 2.625in, 0.25in
TextAlign: Right
Value: Account Details:
Textbox Font: Normal, Arial, 12pt, Bold
Location: 2.625in, 1in
Size: 3.25in, 0.25in
Value:
=Fields!FirstName.Value + ", " + Fields!AccountNumber.Value
OverflowPlaceHolder Location: 0in, 2in
Textbox Location: 1.75in, 5in
Size: 3in, 0.25in
TextAlign: Center
Value: Thank You For Your Business!
3. In the Report Explorer, expand the Common Values node and drag and drop the Page N of M (Section)
field onto the Page 2 design surface and set its Location property to 0in, 8in in the properties window.
To view the report
Click the preview tab to view the report.
OR
See Using the Viewer to display report in the Viewer at runtime.
Note:
This walkthrough uses the Store table from the Reels database. By default, in ActiveReports, the
Reels.mdb file is located in the [User Documents folder]\GrapeCity Samples\ActiveReports
9\Samples\Data folder.
Although this walkthrough uses Page reports, but this can be implemented using RDL reports also.
When you complete this walkthrough you get a layout that looks similar to the following at design time and at
runtime.
Runtime Layout
2. In the Report Data Source Dialog that appears, select the General page and in the Name field, enter a
name like ReportData.
3. On this page, create a connection to the Reels database. See Connect to a Data Source for information on
connecting to a data source.
To create a dataset to populate the parameter values
1. In the Report Explorer, right-click the data source node and select the Add Data Set option or select Data
Set from the Add button.
4. Click the Validate DataSet icon at the top right hand corner above the Query box to validate the query.
5. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
To add a report parameter
1. In the Report Explorer, right-click the data source node and select the Parameters node or select
Parameter from the Add button.
2. In the Report - Parameters dialog that appears, set the following values:
In the General tab
Name: StoreID
DataType: Integer
Text for prompting users for a value: Select a store number
In the Available Values tab select From query
Dataset: Stores
Value: StoreID
Label: StoreID
3. Click OK to close the dialog and add the parameter under the Parameters node of the Report Explorer.
To add a dataset for the report
1. In the Report Explorer, right-click the data source node and select the Add Data Set option.
2. In the DataSet Dialog that appears, select the General page and enter the name of the dataset as
Employees. This name appears as a child node to the data source icon in the Report Explorer.
3. On the Parameters page, add a parameter with the following properties.
Parameter Name: @StoreID
Value: =Parameters!StoreID.Value
4. On the Query page of this dialog, change the Command Type to StoredProcedure and enter the following
stored procedure into the Query text box (the question mark denotes the parameter)
StoredProcedure Query
EmployeesForStore ?
EmployeesForStore ?
5. Click the Validate icon to validate the query and to populate the Fields list.
6. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
To create a layout for the report
1. From the toolbox, drag a Table control onto the body of the report and go to the Properties window to set
the following properties.
2. Click inside the table to display the row and column handles along the left and top edges of the table.
3. Select the columns by clicking the grey column header above the column and change the Width property
in the order as follows.
4. Right-click the grey column header above the third column and select Insert Column to the Right.
5. Select the fourth column and change its Width property to 1.75in.
Tip: Making some columns narrower before adding columns or making other columns wider prevents
your report width from changing.
6. In the Report Explorer from the Employees dataset, drag the following fields onto the detail row of the
table.
7. Select the LastName field in the second column of the detail row and in the Properties window, set the
Value property to =Fields!LastName.Value & " " & Fields!EmployeeID.Value. This will display the
Employee ID number along with each employee's last name.
8. Select the static label in the second column of the detail row of the table and in the properties window, set
its Value property to Last Name and ID.
9. Select the Supervisor field in the third column of the detail row and in the Properties window, set its
TextAlign property to Center.
10. Select the static label in the third column of the detail row and in the Properties window, set its Value
property to Supervisor ID.
11. Select the header row by clicking the table handle to the left of the row and in the Properties window, set
the following properties.
12. Select the detail row and in the Properties window, set the BorderStyle property to Solid.
13. Right-click the table handle to the left of the header row and select Insert Row Above.
14. While holding down the SHIFT key, click each of the cells in the newly added top row.
15. Right-click inside the selected cells and select Merge Cells to create a cell that spans the table.
16. Go to the Properties window to set the following properties.
17. Right-click the table handle to the left of the row and select Table Footer to remove the footer row from
the table.
18. Select the detail row and in the Properties window, set the BorderStyle property to Solid.
Note: In case you are setting a recursive hierarchy on a Page report, set the DataSetName property in the
FixedPage Dialog to Employees.
To use the Level function with themes in the BackgroundColor property of a textbox
1. Go to [User Documents folder]\GrapeCity Samples\ActiveReports 9\Page
Reports\RDL\Layouts\Reports\Reels.
Note: In Windows Vista, the path is [User Documents folder]\GrapeCity Samples\ActiveReports
9\Page Reports\RDL\Layouts\Reports\Reels.
2. Copy the file Reels.rdlx-theme and paste it into the folder in which you saved your report.
3. In the Report Explorer, select Report.
4. In the Properties window in the Theme property, enter the theme file name: Reels.rdlx-theme.
5. Click the table handle to the left of the detail row to select the entire row.
6. In the Properties window, set the BackgroundColor property to =Theme.Colors(Level() + 1, 4).
To view the report
Click the preview tab to view the report at design time.
OR
Open the report in the Viewer. See Using the Viewer for further information.
Note:
This walkthrough uses the DVDStock table from the Reels database. By default, in ActiveReports,
the Reels.mdb file is located at [User Documents folder]\GrapeCity Samples\ActiveReports
9\Samples\Data\Reels.mdb.
Although this walkthrough uses Page reports, but this can be implemented using RDL reports also.
When you complete this walkthrough you get a layout that looks similar to the following at design time and at
runtime.
Notice that the runtime report layout below is similar to the one you see at design time except for the data which
you see at runtime or when you preview the report.
Runtime Layout
2. In the Report Data Source Dialog that appears, select the General page and in the Name field, enter a
name like ReportData.
3. On this page, create a connection to the Reels database. See Connect to a Data Source for information on
connecting to a data source.
4. Click the Validate DataSet icon at the top right hand corner above the Query box to validate the query.
5. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
To create a layout for the report
1. In the Visual Studio toolbox, go to the ActiveReports 9 Page Report tab and drag a TextBox control onto
the design surface.
2. Select the TextBox control and go to the Properties window to set the following properties.
3. From the Visual Studio toolbox, drag a Table data region and place it on the design surface.
4. Select the Table and go to the Properties window to set the following properties.
5. In the Table data region, place your mouse over the cells of the table details row to display the field
selection adorner.
6. Click the adorner to show a list of available fields from the DataSet and add the following fields to the cells
of the table details row.
Cell Field
Left Cell Title
Middle Cell InStock
Right Cell StorePrice
This automatically places an expression in the details row and simultaneously places a static label in the
header row of the same column.
Tip: You can also directly drag fields from the Report Explorer onto the textbox cells of the Table
data region.
7. Select the columns of the Table and set their Width property as follows:
Cell Field
Left Cell 2.5in
Middle Cell 1.75in
Right Cell 1.75in
8. Select the following table rows and go to the Properties window to set their following properties.
Row Properties
Table Header BorderStyle: Solid
Color: Maroon
Font: Normal, Arial,
12pt, Bold
TextAlign: Left
Table Details BorderStyle: Solid
Font: Normal, Arial,
10pt, Bold
TextAlign: Left
Note: This topic uses the Employee, Sale and SaleDetails tables in the Reels database. By default, in
ActiveReports, the Reels.mdb file is located at [User Documents folder]\GrapeCity Samples\ActiveReports
When you complete this walkthrough you get a layout that looks similar to the following at design time and at
runtime.
Runtime Layout
2. In the Report Data Source Dialog that appears, select the General page and in the Name field, enter a
name like Reels.
3. On this page, create a connection to the Reels database. See Connect to a Data Source for information on
connecting to a data source.
To add a report parameter to the subreport
1. In the Report Explorer, right-click the Parameters node and select the Add Parameter option or select
Parameter from the Add button.
2. Under Name, enter EmployeeID.
3. Under Data type, select Integer.
4. Click OK to close the dialog.
6. Click the Validate DataSet icon at the top right hand corner above the Query box to validate the query.
7. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
To add controls to display data on the subreport
1. From the toolbox, drag a Table data region onto the body of the report and go to the properties window to
set the DataSetName property to EmployeeSales.
2. Click inside the table to display the column and row handles along the top and left sides of the table.
3. Right-click the handle above the rightmost column and select Insert Column to the Right to add another
column.
4. Click the column handle at the top of each column in turn to select it, and in the property grid, set the
Width property as indicated in the table.
Column Width
First 1.5in
Second 1.5in
Third 1.2in
Fourth 1.55in
Tip: In most cases it is easier to resize existing columns before adding new columns because this
prevents the table from growing horizontally and pushing the report width beyond what will fit on
paper.
5. Right-click the handle to the left of the table detail row and select Insert Group to open the Table-Groups
dialog.
6. Under Expression select =Fields!EmployeeID.Value. This groups all details from each employee.
7. Change the Name to Employee and click OK to close the dialog. A grouping row is added to the table.
Note: You cannot change the name of a table group until after you have set the expression.
8. Right-click the handle to the left of the table detail row and select Edit Group to access the Table-Detail
Grouping dialog.
9. Under Expression select =Fields!SaleID.Value and click OK to close the dialog. This lists the total amount
of each sale instead of listing each item sold within each SaleID.
10. Right-click the handle to the left of the grouping row and select Insert Row Below. We will use this new
row for static labels that repeat at the top of each new group.
11. Right-click any handle to the left of the table and select Table Header to toggle off the table header.
12. Right-click any handle to the left of the table and select Table Footer to toggle off the table footer.
13. In the Report Explorer, select the Body node and go to the Properties window to set the Size property to
5.75in, 1in so that it fits inside the subreport control on the main report.
To add data fields to the Table data region
1. In the Report Explorer, from the EmployeeSales dataset, drag the following field onto the first group header
2. Use the Shift key and the mouse to select the first two cells in the first group header row, right-click and
select Merge Cells. This allows the employee name to span two columns in the table.
3. Using the handle to the left of the first group header row, select the row and set the BackgroundColor
property to LightSteelBlue.
Tip: Even if you do not want to use colors in your finished report, it is often helpful to do so during
the design of a report to make identification of the various sections easier for troubleshooting when
you preview it.
4. Enter the following text into the cells in the second group header row of the table.
5. Using the handle to the left of the second group header row, select the row and set the BackgroundColor
property to LightGray.
6. In the Report Explorer, drag the following fields from the EmployeeSales dataset onto the detail row of the
table.
7. In the detail row of the table, select the textbox with the Quantity data field and go to the Properties
window to change the Value property to =Sum(Fields!Quantity.Value). This adds the Sum aggregate to
the expression for the field and shows a summary of the quantity field for each SalesID.
8. In the detail row of the table, select the textbox with the Total data field and go to the Properties window
to change the Value property to =Sum(Fields!Total.Value). This adds the Sum aggregate to the
expression for the field and shows a summary of the total field for each SalesID.
9. In the Report Explorer, from the EmployeeSales dataset, drag the following fields onto the group footer
row of the table.
10. Enter the following text into the indicated cell in the group footer row of the table.
13. From the File menu, select Save and save this file. This report functions as the subreport you use in the
main report.
To create the main report
1. From the Visual Studio Project menu, select Add New Item.
2. In the Add New Item dialog that appears, select ActiveReports 9 Page Report and in the Name field,
rename the file as Employees.rdlx.
3. Click the Add button to open a new fixed page report in the designer.
4. From the Report menu, select Convert to RDL Report.
To connect the main report to a data source
1. In the Report Explorer, right-click the Data Sources node and select the Add Data Source option or select
Data Source from the Add button.
2. In the Report Data Source Dialog that appears, select the General page and in the Name field, enter a
name like Reels.
3. On this page, create a connection to the Reels database. See Connect to a Data Source for information on
connecting to a data source.
To add a dataset to the main report
1. In the Report Explorer, right-click the data source node and select the Add Data Set option or select Data
Set from the Add button.
2. In the DataSet Dialog that appears, select the General page and enter the name of the dataset as
EmployeeInfo. This name appears as a child node to the data source icon in the Report Explorer.
3. On the Query page of this dialog, in the Query field enter the following SQL query.
SQL Query
SELECT * FROM EmployeeInfo
4. Click the Validate icon to validate the query and to populate the Fields list.
5. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
To add controls to display data on the main report
The following steps demonstrate how you can add controls and create the main report:
To add a static label to the top of the main report
From the toolbox, drag a TextBox control onto the body of the report and set the following properties:
To add a List data region that repeats data for each city
1. Drag a List data region from the toolbox onto the body of the report and with the data region selected, go
to the Properties Window to set the following properties:
2. At the bottom of the Properties Window, select the Property dialog command. See Properties Window for
further details on accessing commands.
3. In the List dialog that appears, select Detail Grouping.
4. Under Expression, select =Fields!City.Value
5. Click OK to close the dialog.
6. From the Report Explorer, drag the City field onto the List data region and set the following properties:
To nest a second List data region that repeats data for each store within the city
1. Drag a List data region from the toolbox onto the the first list and with the data region selected, go to the
Properties Window to set the following properties:
2. At the bottom of the Properties Window, select the Property dialog command. See Properties Window for
further details on accessing commands.
3. In the List dialog that appears, select Detail Grouping.
4. Under Expression, select =Fields!StoreName.Value
5. Click OK to close the dialog.
6. From the Report Explorer, drag the StoreName field onto the list and set the following properties:
To nest a third List data region that repeats data for each employee in the store
1. Drag a List data region from the toolbox onto the second list and with the data region selected, go to the
2. At the bottom of the Properties Window, select the Property dialog command. See Properties Window for
further details on accessing commands.
3. In the List dialog, select Detail Grouping.
4. Under Expression, select =Fields!EmployeeID.Value
5. Click OK to close the dialog.
6. From the Report Explorer, drag the following fields onto the list and set the following properties:
7. From the toolbox, drag five text boxes onto the List and set the following properties:
2. At the bottom of the Properties Window, select the Property dialog command. See Properties Window for
further details on accessing commands.
3. On the Parameters page of the Subreport dialog, set the Parameter Name to EmployeeID. This name
must match the parameter in the subreport exactly.
4. Set the Parameter Value to =Fields!EmployeeID.Value.
Note: You can use the option of having the subreport automatically apply the same theme as the
hosting report. This option is available on the General page of the Subreport Properties.
Note: Click the + to the left of Sales Record to see the subreport.
Chart
This section contains the following walkthroughs that fall under the Chart category.
Charts
This walkthrough demonstrates how to create a report with a chart.
Charts
You can create a page report with a chart using the ActiveReports Chart control. This walkthrough illustrates how
to create a report with a chart.
The walkthrough is split into the following activities:
Adding an ActiveReport to a Visual Studio project
Connecting the report to a data source
Adding a dataset
Adding a chart control with data and grouping to the report
Configuring the appearance of the chart
Viewing the report
Note:
This walkthrough uses the Sales table from the Reels database. By default, in ActiveReports, the
Reels.mdb file is located in the [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data
When you complete this walkthrough you get a layout that looks similar to the following at design time and at
runtime.
Runtime Layout
2. In the Report Data Source Dialog that appears, select the General page and in the Name field, enter a
name like ReportData.
3. On this page, create a connection to the Reels database. See Connect to a Data Source for information on
connecting to a data source.
4. Click the Validate DataSet icon at the top right hand corner above the Query box to validate the query.
5. On the Fields page, add a new field by clicking the Add (+) button above the fields list.
6. Set the Name to Month and the Value of the new field to =Fields!SaleDate.Value.Month
This parses out the month from the date field.
7. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
To add chart control with data and grouping to the report
1. From the toolbox, drag the Chart control onto of the report design surface.
2. In the wizard Select a Chart Type that appears, select the chart type Column and go to the Properties
Window to set the following properties:
3. Double-click inside the chart to display the UI along the top, right, and bottom of the chart to drop fields in.
4. From the Report Explorer, drag the Month field into the area below the chart labeled "Drop category fields
here." This automatically binds the Month field to the X axis.
5. Right-click the month category group and select Edit to open the Chart Data - Category Groups dialog.
6. In the dialog that appears on the General page, go to the Label field and enter the following expression:
=MonthName(Fields!Month.Value) and click OK to close the dialog.
7. From the ReportExplorer, drag the Profit field into the area above the chart labeled "Drop data fields here."
This plots the profits to the Y axis of the chart.
8. In the Report Explorer, drag the GenreName field into the area to the right of the chart labeled "Drop
series fields here." This sets the series to be charted in the chart area.
9. Right-click the genre series group and select Edit to open the Chart Data - Series Groups dialog.
10. In the dialog that appears on the General page, go to the Label field and enter the following expression:
=Fields!GenreName.Value. This shows genre names in the legend.
11. Click OK to close the dialog.
12. Select the chart and at the bottom of the Properties Window, select the Chart Data command. See
Properties Window for further details on accessing commands.
13. In the Chart Data dialog that appears, under Series Values go to the Value field and make sure it is set
to =Sum(Fields!Profit.Value).
Map
This section contains the following walkthrough that fall under the Map category.
Reports with Map
This walkthrough demonstrates how to create a report with a map.
Note:
This walkthrough use tables from the Reels database. By default, in ActiveReports, the Reels.mdb
file is located in the [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data folder.
Although this walkthrough uses Page reports, but this can be implemented using RDL reports also.
When you complete this walkthrough you get a layout that looks similar to the following at design time and at
runtime.
Runtime Layout
2. In the Report Data Source Dialog that appears, select the General page and in the Name field, enter a
name like ReportData.
3. On this page, create a connection to the Reels database. See Connect to a Data Source for information on
connecting to a data source.
To add a dataset
1. In the Report Explorer, right-click the data source node and select the Add Data Set option or select Data
Set from the Add button.
2. In the DataSet Dialog that appears, select the General page and enter the name of the dataset as
Customers. This name appears as a child node to the data source icon in the Report Explorer.
3. On the Query page of this dialog, in the Query field enter the following SQL query.
SQL Query
SELECT Address.Region, Customer.CustomerID FROM (Address INNER JOIN Person ON
Address.[AddressID] = Person.[AddressID]) INNER JOIN Customer ON Person.[PersonID]
= Customer.[PersonID];
4. Click the Validate DataSet icon at the top right hand corner above the Query box to validate the query.
5. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
To add a Map data region and configure its data
1. From the Visual Studio toolbox, drag and drop a Map control onto the design surface.
2. In the Select a Map Template wizard that appears, select the USA Map template.
3. Click the Map until the map panes appear.
4. In the layers pane, right click PolygonLayer1 and select Layer Data to open Map Layer Data
Properties dialog.
5. In the Map Layer Data Properties dialog that appears, go to the Analytical data page.
6. Select Customers from the Dataset property combo box and then click the Add (+) button located next
to the Match label. This creates an empty match item and enables its Spatial and Analytical fields editor.
Note: It is necessary to set match fields if you want to use a spatial data field from analytical data, or
if you want to visualize analytical data on the map layer. Match fields enable the report processor to
build a relationship between the analytical data and the spatial data.
7. In the Spatial field property, select STATE_ABBR from the combo box; and similarly, select
=Fields!Region.Value in the Analytical field property. This builds the match field expression and relates
the analytical data to map elements on a polygon layer.
8. Click OK to close the dialog.
To configure appearance of the Map
1. In the layers pane, right click PolygonLayer1 and select Edit to open Map Polygon Layer dialog.
2. In the General page of the dialog, select #STATE_NAME from the Label Text combo box to display as label
inside polygons at runtime.
3. Go to the Color Rule page of the dialog, and select Visualize data by using color palette option. This
activates the tabs below.
4. On the General tab, enter the following expression =Count([CustomerID]) in the Data field property and
set Palette property to SemiTransparent.
5. On the Distribution tab, set the Method property to EqualInterval.
6. On the Legends tab, click to select Show in Legend.
10. With the Map control selected, go to the Properties window, click the Legends (Collection) property and
then click the ellipsis button that appears.
11. In the LegendDesigner Collection Editor that appears, under the Members list, select the existing
legend and set the following properties:
Properties
Export
This section contains the following walkthroughs that fall under the Export category.
Custom Web Exporting
This walkthrough demonstrates how to export your report into several popular formats like PDF, HTML, Excel,
Image and Word.
Note: Although this walkthrough uses Page reports, you can also implement this using RDL reports.
Response.ContentType = "application/pdf"
Response.AddHeader("content-disposition", "inline;filename=MyExport.pdf")
Dim ms As New System.IO.MemoryStream()
CType(outputProvider.GetPrimaryStream().OpenStream(), System.IO.MemoryStream).WriteTo(ms)
Response.BinaryWrite(ms.ToArray())
Response.End()
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "inline;filename=MyExport.pdf");
System.IO.MemoryStream ms = new System.IO.MemoryStream();
outputProvider.GetPrimaryStream().OpenStream().CopyTo(ms);
Response.BinaryWrite(ms.ToArray());
Response.End();
Note: To use the one-touch printing option, add the following to the code above.
Visual Basic.NET code. Paste INSIDE the Page Load event.
' Replace the line reportDocument.Render(pdfRenderingExtension, outputProvider) in the code above with the following
Warning: You need to manually license your application in order to use PDF export.
To add code to the Web Form to create the HTML Export object and export a report
1. Double-click on the design view of the aspx page. This creates an event-handling method for the Page_Load event.
2. Add code like the following to the Page_Load event.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the Page Load event.
' Provide the page report you want to render.
Dim report As New GrapeCity.ActiveReports.PageReport(New System.IO.FileInfo(Server.MapPath("") +
"\CustomWebExporting.rdlx"))
Dim reportDocument As New GrapeCity.ActiveReports.Document.PageDocument(report)
Response.ContentType = "message/rfc822"
Response.AddHeader("content-disposition", "inline;filename=MyExport.mht")
Dim ms As New System.IO.MemoryStream()
CType(outputProvider.GetPrimaryStream().OpenStream(), System.IO.MemoryStream).WriteTo(ms)
Response.BinaryWrite(ms.ToArray())
Response.End()
Response.ContentType = "message/rfc822";
Response.AddHeader("content-disposition", "inline;filename=MyExport.html");
To add code to the Web Form to create the Excel Export - Data object and export a report(RDL Reports Only)
1. Double-click on the design view of the aspx page. This creates an event-handling method for the Page_Load event.
2. Add code like the following to the Page_Load event.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the Page Load event.
' Provide the page report you want to render.
Dim report As New GrapeCity.ActiveReports.PageReport(New System.IO.FileInfo(Server.MapPath("") +
"\CustomWebExporting.rdlx"))
Dim reportDocument As New GrapeCity.ActiveReports.Document.PageDocument(report)
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader("content-disposition", "inline;filename=MyExport.xls")
Dim ms As New System.IO.MemoryStream()
CType(outputProvider.GetPrimaryStream().OpenStream(), System.IO.MemoryStream).WriteTo(ms)
Response.BinaryWrite(ms.ToArray())
Response.End()
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("content-disposition", "inline;filename=MyExport.xls");
System.IO.MemoryStream ms = new System.IO.MemoryStream();
outputProvider.GetPrimaryStream().OpenStream().CopyTo(ms);
Response.BinaryWrite(ms.ToArray());
To add code to the Web Form to create the Excel Export - Layout object and export a report
1. Double-click on the design view of the aspx page. This creates an event-handling method for the Page_Load event.
2. Add code like the following to the Page_Load event.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the Page Load event.
' Provide the page report you want to render.
Dim report As New GrapeCity.ActiveReports.PageReport(New System.IO.FileInfo(Server.MapPath("") +
"\CustomWebExporting.rdlx"))
Dim reportDocument As New GrapeCity.ActiveReports.Document.PageDocument(report)
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader("content-disposition", "inline;filename=MyExport.xls")
Dim ms As New System.IO.MemoryStream()
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("content-disposition", "inline;filename=MyExport.xls");
System.IO.MemoryStream ms = new System.IO.MemoryStream();
outputProvider.GetPrimaryStream().OpenStream().CopyTo(ms);
Response.BinaryWrite(ms.ToArray());
Response.End();
To add code to the Web Form to create the Word Export object and export a report
1. Double-click on the design view of the aspx page. This creates an event-handling method for the Page_Load event.
2. Add code like the following to the Page_Load event.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the Page Load event.
' Provide the page report you want to render.
Dim report As New GrapeCity.ActiveReports.PageReport(New System.IO.FileInfo(Server.MapPath("") +
"\CustomWebExporting.rdlx"))
Dim reportDocument As New GrapeCity.ActiveReports.Document.PageDocument(report)
Response.ContentType = "application/msword"
Response.AddHeader("content-disposition", "inline;filename=MyExport.doc")
Dim ms As New System.IO.MemoryStream()
CType(outputProvider.GetPrimaryStream().OpenStream(), System.IO.MemoryStream).WriteTo(ms)
Response.BinaryWrite(ms.ToArray())
Response.End()
Response.ContentType = "application/msword";
Response.AddHeader("content-disposition", "inline;filename=MyExport.doc");
System.IO.MemoryStream ms = new System.IO.MemoryStream();
outputProvider.GetPrimaryStream().OpenStream().CopyTo(ms);
Response.BinaryWrite(ms.ToArray());
To add code to the Web Form to create the Image Export object and export a report
1. Double-click on the design view of the aspx page. This creates an event-handling method for the Page_Load event.
2. Add code like the following to the Page_Load event.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the Page Load event.
' Provide the page report you want to render.
Dim report As New GrapeCity.ActiveReports.PageReport(New System.IO.FileInfo(Server.MapPath("") +
"\CustomWebExporting.rdlx"))
Dim reportDocument As New GrapeCity.ActiveReports.Document.PageDocument(report)
Response.ContentType = "image/jpeg"
Response.AddHeader("content-disposition", "inline;filename=MyExport.jpg")
Dim ms As New System.IO.MemoryStream()
Response.ContentType = "image/jpeg";
Response.AddHeader("content-disposition", "inline;filename=MyExport.jpg");
System.IO.MemoryStream ms = new System.IO.MemoryStream();
// Get the first page of the report
outputProvider.GetSecondaryStreams()[0].OpenStream().CopyTo(ms);
Response.BinaryWrite(ms.ToArray());
Response.End();
To add code to the Web Form to create the XML Export object and export a report.
1. Double-click on the design view of the aspx page. This creates an event-handling method for the Page_Load event.
2. Add code like the following to the Page_Load event.
To write the code in Visual Basic.NET
Response.ContentType = "application/xml"
Response.AddHeader("content-disposition", "inline;filename=MyExport.xml")
Dim ms As New System.IO.MemoryStream()
outputProvider.GetPrimaryStream().OpenStream().CopyTo(ms)
Response.BinaryWrite(ms.ToArray())
Response.[End]()
Response.ContentType = "application/xml";
Response.AddHeader("content-disposition", "inline;filename=MyExport.xml");
System.IO.MemoryStream ms = new System.IO.MemoryStream();
outputProvider.GetPrimaryStream().OpenStream().CopyTo(ms);
Response.BinaryWrite(ms.ToArray());
Response.End();
Preview
This section contains the following walkthroughs that fall under the Preview category.
Drilldown Reports
This walkthrough demonstrates how to create a drilldown report using the Hidden and ToggleItem properties.
Drill-Through Reports
This walkthrough demonstrates how to create a drill-through link to another report containing details about the
linked item.
Parameterized Reports
This walkthrough demonstrates how to create a report with multivalue parameters and an option to select all of
the data.
Reports with Bookmarks
This walkthrough demonstrates how to set up bookmarks and links in a report.
Reports with TableOfContents
This walkthrough demonstrates how to create a report that includes the TableOfContents (ToC) control
and displays the document map on a report page.
Drilldown Reports
This walkthrough expands upon the report created in the Master Detail Reports walkthrough. If you have not
created the Master Detail report (CustomerOrders.rdlx) already, please do so before continuing.
This walkthrough illustrates how to create a drilldown report using the Hidden and ToggleItem properties.
The walkthrough is split up into the following activities:
Opening the Master Detail Report
Hiding table rows and setting a toggle item
Viewing the report
Note: This walkthrough uses the Customer table from the Reels database. By default, in ActiveReports, the
Reels.mdb file is located in the [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data folder.
When you complete this walkthrough you get a layout that looks similar to the following at runtime.
Drill-Through Reports
The following procedures illustrate how to create a drill-through link to another report containing details about the
linked item.
The walkthrough is split into the following activities:
Creating a main report
Connecting the main report to a data source and adding a dataset
Adding controls to the main report to contain data
Creating a detail report
Connecting the detail report to a data source
Adding a dataset with a parameter
Creating a dataset to populate the parameter values
Adding a report parameter
Adding controls to the detail report to contain data
Adding a drill-through link in the main report
Viewing the report
When you complete this walkthrough you get a layout that looks similar to the following at runtime.
2. In the Report Data Source Dialog that appears, select the General page and in the Name field, enter a
name like MainReportData.
3. On this page, create a connection to the Reels database. See Connect to a Data Source for information on
connecting to a data source.
7. Click the Validate DataSet icon at the top right hand corner above the Query box to validate the query.
8. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
To create a layout for the main report
1. In the Visual Studio toolbox, go to the ActiveReports 9 Page Report tab and drag a TextBox control onto
the design surface.
2. Select the TextBox control and go to the Properties window to set the following properties.
3. From the Visual Studio toolbox, drag a Table data region and place it on the design surface.
4. Select the Table and go to the Properties window to set the following properties.
5. In the Table data region, place your mouse over the cells of the table details row to display the field
selection adorner.
6. Click the adorner to show a list of available fields from the DataSet and add the following fields to the cells
of the table details row.
Cell Field
Left Cell MovieID
Middle Cell Title
Right Cell YearReleased
This automatically places an expression in the details row and simultaneously places a static label in the
header row of the same column.
Tip: You can also directly drag fields from the Report Explorer onto the textbox cells of the Table
data region.
7. Select the following table rows and go to the Properties window to set their properties.
Table Header
Table Details
2. In the Report Data Source Dialog that appears, select the General page and in the Name field, enter a
name like ReportData.
3. On this page, create a connection to the Reels database. See Connect to a Data Source for information on
connecting to a data source.
To add a dataset with a parameter
1. In the Report Explorer, right-click the data source node and select the Add Data Set option.
2. In the DataSet Dialog that appears, select the General page and enter the name of the dataset as
MovieInfo. This name appears as a child node to the data source icon in the Report Explorer.
3. On the Parameters page under Parameter Name enter MovieID.
4. Under Value enter =Parameters!MovieID.Value
5. On the Query page of this dialog, in the Query field enter the following SQL query.
SQL Query
Select * from MovieCastInformation
6. Click the Validate DataSet icon at the top right hand corner above the Query box to validate the query.
7. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
8. In an Page report, set the Dataset name in the FixedPage dialog > General tab to MovieInfo. For more
information, see FixedPage Dialog.
Caution: In an Page report, you may get an error if the Dataset name for the FixedPage is not be specified
explicitly.
4. Click the Validate DataSet icon at the top right hand corner above the Query box to validate the query.
5. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
To add a parameter to the report
1. In the Report Explorer, select the Parameters node.
2. Right-click the node and select Add Parameter to open the Report - Parameters dialog.
3. Set properties in the following fields below the parameters list.
In the General tab:
Name: MovieID
DataType: Integer
In the Available Values tab select From query:
DataSet: MovieTitles
Value: MovieID
Label: Title
4. Click OK to close the dialog and add the parameter to the collection. This parameter appears under the
Parameters node in the Report Explorer.
To create a layout for the detail report
1. Click the gray area below the design surface to select the report.
2. Go to the Properties window, expand the PageSize property and set the Width to 8.5in and Height to 3in.
3. From the toolbox, drag a List control onto the design surface and in the Properties window, set the
following properties:
4. With the List control selected, at the bottom of the Properties Window, select the Property dialog
command.
5. In the List dialog that appears, on the Detail Grouping page, set the Group on: Expression
to =Fields!MovieID.Value.
6. Click OK to close the dialog.
7. From the Report Explorer, go to the MovieInfo dataset and drag the following five fields onto the MovieList
data region. In the properties window, set their properties as indicated.
Title
YearReleased
MPAA
UserRating
Length
Note: When you drag and drop fields from a dataset in the Report Explorer onto the design surface,
these fields are automatically converted to Textbox controls that you can modify by setting the control
properties in the Properties Window.
8. From the Report Explorer, drag four TextBox controls onto the MovieList data region and in the properties
window, set their properties as indicated.
TextBox1
TextBox2
TextBox3
TextBox4
Parameterized Reports
You can create a parameterized report with ActiveReports and provide an "All" choice for users who want to see all of the data
as well as the ability to select multiple values for those who want to see data for several items.
This walkthrough illustrates how to create a report with multivalue parameters and an option to select all of the data.
The walkthrough is split up into the following activities:
Adding an ActiveReport to a Visual Studio project
Connecting the report to a data source
Adding a Dataset with a parameter
Creating a Dataset to populate the parameter values
Adding a Report Parameter
Adding controls to the report to contain data
Viewing the report
Note:
This walkthrough uses the Movie table from the Reels database. By default, in ActiveReports, the Reels.mdb
file is located in the [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data folder.
When you complete this walkthrough you get a layout that looks similar to the following at design time and at runtime.
Runtime Layout
2. In the Report Data Source Dialog that appears, select the General page and in the Name field, enter a name like
ReportData.
3. On this page, create a connection to the Reels database. See Connect to a Data Source for information on connecting
to a data source.
To add a dataset to populate the parameter values
1. In the Report Explorer, right-click the data source node and select the Add Data Set option.
2. In the DataSet Dialog that appears, select the General page and enter the name of the dataset as Producers. This
name appears as a child node to the data source icon in the Report Explorer.
3. On the Query page of this dialog, in the Query field enter the following SQL query.
SQL Query
SELECT -1 AS ProductionID, "(All)" AS Name
FROM Producers
UNION
SELECT ProductionID, Name
FROM Producers;
4. Click the Validate DataSet icon at the top right hand corner above the Query box to validate the query.
5. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
To add a parameter to the report
1. In the Report Explorer, select the Parameters node.
Note: The name of the parameter you enter must exactly match the name of the parameter in the
linked report, and it is case sensitive. You can pass a value from the current report to the parameter in
the Value column of the list. If a value is not supplied for an expected parameter in the linked report,
or if the parameter names do not match, the linked report will not run.
5. Click OK to close the dialog and add the parameter to the collection. This parameter appears under the Parameters
node in the Report Explorer.
To add a dataset with a parameter
1. In the Report Explorer, right-click the data source node and select the Add Data Set option.
2. In the DataSet Dialog that appears, select the General page and enter the name of the dataset as Movies. This name
appears as a child node to the data source icon in the Report Explorer.
3. On the Parameters page under Parameter Name enter Param1.
4. Under Value enter =Parameters!ProductionID.Value
5. On the Parameters page under Parameter Name enter Param2.
6. Under Value enter =Parameters!ProductionID.Value
7. On the Query page of this dialog, in the Query field enter the following SQL query.
SQL Query
SELECT Movie.Title, Movie.YearReleased, Movie.UserRating, Producers.Name
FROM Producers INNER JOIN (Movie INNER JOIN MovieProducers ON Movie.MovieID =
MovieProducers.MovieID) ON Producers.ProductionID = MovieProducers.ProductionID
WHERE (MovieProducers.ProductionID IN (?)) OR (-1 IN (?))
ORDER BY MovieProducers.ProductionID, Movie.YearReleased;
8. Click the Validate DataSet icon at the top right hand corner above the Query box to validate the query.
9. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
To create a layout for the report
1. From the toolbox, drag a Table control onto the design surface and in the Properties window, set the following
properties.
2. Click inside the table to display the column and row handles along the top and left sides of the table.
3. To visually group the data within the report, right-click the icon to the left of the detail row and select Insert Group.
4. In the Table - Groups dialog that appears, under Expression select =Fields!Name.Value to group all details from
each producer.
5. Change the Name to Producer.
Note: You cannot change the name of a table group until after you have set the expression.
6. On the Layout tab of the Table - Groups dialog, select the check box next to Repeat group header to ensure that
the header is printed at the top of each page.
10. Static labels with the field names are automatically created in the table header row. To improve the appearance of the
report, select the table header row, and set the text to Bold and change the FontSize to 11pt.
11. From the Report Explorer, the Movies dataset drag the Name field into the first column of the group header row of
the table and set the following properties.
Tip: Use the Shift key to select all three text boxes in the group header row, right-click and select Merge Cells to
prevent long production company names from wrapping.
Note:
This walkthrough uses the Factbook sample database. By default, in ActiveReports, the
Factbook.rdsx file is located at [User Documents folder]\GrapeCity Samples\ActiveReports
9\Data\Factbook.rdsx.
Although this walkthrough uses Page reports, but this can be implemented using RDL reports also.
Note: If you have already created the report outlined in the Reports with XML Data walkthrough, you can
open that report and go directly to the Assigning a Bookmark ID section of this walkthrough.
When you complete this walkthrough you get a layout that looks similar to the following at design time and
at runtime.
Runtime Layout
2. In the Report Data Source Dialog that appears, select the General page and in the Name field, enter a
name like Factbook.
3. On this page, check the Shared Reference checkbox.
4. Click the Browse button and select Factbook.rdsx, which is located in [User Documents folder]\GrapeCity
Samples\ActiveReports 9\Data. See Connect to a Data Source for information on connecting to a data
source.
To add a dataset
1. In the Report Explorer, right-click the data source node and select the Add Data Set option or select Data
Set from the Add button.
5. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
To add controls to the report
1. From the toolbox, drag a List data region onto the design surface of the report and go to the Properties
window to set the DataSetName property to ExchangeRates, Location property to 0in, 0in and Size
property to 6.5in, 3in.
2. From the Report Explorer, drag the Name field onto the list, center it at the top and go to the Properties
window to set the FontSize property to 14pt and the BorderStyle property to Solid.
3. From the Report Explorer, drag the following fields onto the list with properties set as described in the table
below.
Note: You will notice that the expressions created for these fields are different than usual. Because
Visual Basic syntax does not allow an identifier that begins with a number, any numeric field names
must be treated as strings in expressions.
4. From the toolbox, drag a TextBox onto the list and go to the Properties window to set the properties as
described in the table below to combine static text with a field value.
5. From the toolbox, drag TextBox controls onto the list and go to the Properties window to set the properties
as described in the table below to create static labels.
TextBox1
TextBox2
TextBox3
TextBox4
TextBox5
TextBox6
Note: Every bookmark ID in a report must be a unique string. If you have duplicates, a link to it will
navigate only to the first one it finds.
2. At the bottom of the Properties Window, select the Property dialog command.
3. In the Textbox dialog that appears, go to the Navigation page.
4. On the Navigation page, select the Jump to Bookmark radio button and enter the bookmark ID
(Name) created in the procedure above.
5. Click OK to close the dialog.
To view the report
Open the report in the Viewer. See Using the Viewer for further information.
Runtime Layout
2. In the Report Data Source Dialog that appears, select the General page and in the Name field, enter a
name like ReportData.
3. On this page, create a connection to the Reels database. See Connect to a Data Source for information on
connecting to a data source.
To add a dataset
1. In the Report Explorer, right-click the data source node and select the Add Data Set option or select Data
Set from the Add button.
2. In the DataSet Dialog that appears, select the General page and enter the name of the dataset as
MovieCatalog. This name appears as a child node to the data source icon in the Report Explorer.
3. On the Query page of this dialog, in the Query field enter the following SQL query.
SQL Query
SELECT Genre.GenreName, Movie.Title, Movie.YearReleased, Movie.UserRating,
Movie.Country FROM Genre INNER JOIN (Movie INNER JOIN MovieGenres ON Movie.MovieID
= MovieGenres.MovieID) ON Genre.GenreID = MovieGenres.GenreID ORDER BY
YearReleased ASC
4. Click the Validate DataSet icon at the top right hand corner above the Query box to validate the query.
5. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
2. With the List data region selected, under the Properties window, click the Property dialog link to open the
List dialog
3. Go to the Detail Grouping page and on the General tab, under Group on, set the Expression field to
=Fields!GenreName.Value.
4. Click OK to close the dialog
5. In the Report Explorer, from the MovieCatalog dataset, drag and drop the GenreName field inside the List
data region and in the Properties window, set the following properties.
6. From the toolbox, drag and drop the Table data region inside the List data region and in the Properties
window, set the following properties.
7. In the Table data region, place your mouse over the cells of the table details row to display the field
selection adorner.
8. Click the adorner to show a list of available fields from the MovieCatalog dataset and add the following
fields to the cells of the table details row.
Cell Field
Left Cell Title
Middle Cell Country
Right Cell UserRating
This automatically places an expression in the details row and simultaneously places a static label in the
header row of the same column.
Tip: You can also directly drag fields from the Report Explorer onto the textbox cells of the Table
data region.
9. Select the table header row using the row handle to the left and in the Properties Window set the
following properties.
10. Select the table detail row using the row handle to the left, and in the Properties Window set the following
properties.
11. Right-click the table detail row using the row handle to the left, and select Insert Group...
12. In the Table - Groups dialog that appears, on the General tab, under Group on, set the Expression field
TextAlign Center
Value ="Movies Released in " &
Fields !YearReleased.Value
16. From the Visual Studio toolbox, drag a TableOfContents control onto the design surface and in the
Properties window, set the following properties.
Advanced
This section contains the following walkthroughs that fall under the Advanced category.
Reports with Custom Code
This walkthrough demonstrates how to create a simple report with custom code.
Custom Resource Locator
This walkthrough is based on the Custom Resource Locator sample and illustrates how to load pictures from the
user's My Pictures directory.
Custom Data Provider
This walkthrough demonstrates how to create a solution with projects that create a custom data provider and
demonstrate how it pulls data from a comma separated values (CSV) file.
Note:
This walkthrough uses the Store table from the Reels database. By default, in ActiveReports, the
Reels.mdb file is located at [User Documents folder]\GrapeCity Samples\ActiveReports
9\Data\Reels.mdb.
Although this walkthrough uses Page reports, but this can be implemented using RDL reports also.
When you complete this walkthrough you get a layout that looks similar to the following at design time and at
runtime.
2. In the Report Data Source Dialog that appears, select the General page and in the Name field, enter a
name like ReportData.
3. On this page, create a connection to the Reels database. See Connect to a Data Source for information on
connecting to a data source.
To add a dataset
1. In the Report Explorer, right-click the data source node and select the Add Data Set option or select Data
Set from the Add button.
2. In the DataSet Dialog that appears, select the General page and enter the name of the dataset as
Districts. This name appears as a child node to the data source icon in the Report Explorer.
3. On the Query page of this dialog, in the Query field enter the following SQL query.
SQL Query
SELECT Store.StoreName, Address.City, Address.Region AS StateProvince,
Address.Country, Districts.District
FROM Address INNER JOIN (Districts INNER JOIN Store ON Districts.DistrictID =
Store.DistrictID) ON Address.AddressID = Store.Address WHERE NOT
Districts.DistrictID = 0 ORDER BY Districts.District
4. Click the Validate DataSet icon at the top right hand corner above the Query box to validate the query.
5. Click OK to close the dialog. Your data set and queried fields appear as nodes in the Report Explorer.
To create a layout for the report
1. From the toolbox, drag the TextBox control onto the design surface and go to the Properties window to set
the following properties:
2. From the toolbox, drag a Table data region onto the design surface and go to the Properties window to set
the DataSetName property to Districts.
3. Set the following properties for the table:
Property Property
Name Value
Location 0in, 0.5in
FixedSize 6in, 7in
Note:
FixedSize
property
is set
only in
Page
report.
4. Click inside the table to display the column handles at the top and in the Properties window, set the
Width property of following columns:
Column Width
TableColumn1 3in
TableColumn2 1.5in
TableColumn3 1.5in
5. Click inside the table to display the row handles along the left of the table and right-click any of the row
handles to select Insert Group.
6. In the Table - Groups dialog that appears, under Group on, select the following expression:
=Fields!District.Value
7. On the same dialog set the Name to District and click OK to close the dialog. The header and footer rows
for the new group appear.
8. In the Report Explorer from the Districts dataset, drag the District field into the second column of the
group header row of the table. This automatically places an expression in the group header row and
simultaneously places a static label in the table header row.
9. In the first column of the group header row, just to the left of the District field, in the Properties window set
the Value property to District Name:.
10. Click the row handle to the left of the group header row to select the entire row and in the Properties
window, set the properties as follows:
11. Right-click any row handle to the left of the table and select Table Header to remove the table header.
12. Right-click any row handle to the left of the table and select Table Footer to remove the table footer.
13. In the Report Explorer, drag the following fields from the Districts dataset onto the detail row of the table
as follows.
Field Column
14. Remove the static label State Province from the group header for the third column.
15. Right-click the row handle for the group header row and select Insert Row Below to add a row for static
labels that will appear once for each group.
16. In the new row, enter the following values for static label in table columns.
TableColumn1
TableColumn2
TableColumn3
Note: The expression in the third column displays the label "State" when the country is USA, and
displays "Province" when it is not.
Return Link
End Function
Note: Custom code is helpful if you intend to reuse code throughout the report or if code is too
complex to use in an expression. Code must be instance based and written in Visual Basic.NET. You
can include multiple methods, but if you want to use classes or other .NET languages, create a custom
assembly. See Using Script in a Page Report for further details.
Note: Although this walkthrough uses Page reports, but this can be implemented using RDL reports also.
When you complete this walkthrough you get a layout that looks similar to the following at runtime.
2. From the toolbox, drag another Image control onto the design surface and in the Properties window, set the following
properties.
3. In the Solution Explorer, select DemoReport.rdlx and in the Properties window, set Build Action to Embedded
Resource.
2. From the Visual Studio toolbox, drag the Viewer control onto the PreviewForm and in the Properties window, set the
following properties.
3. Double-click the PreviewForm to create an instance for the Load event and add the following code.
To write the code in Visual Basic.NET
6. From the toolbox ActiveReports 9 tab, drag a Designer control and drop it on the empty part of the form.
7. Set the Dock property to Fill, then right-click the Designer control on the form and select Bring to front.
8. Select the ReportExplorer control and in the Properties window, drop down the ReportDesigner property
and select Designer1.
9. Double-click on the form's title bar to create a form Load event, and add code like the following above the
class.
Visual Basic code. Paste above the class.
Imports System.Xml
Imports System.IO
Imports GrapeCity.ActiveReports.Design
5. In the Solution Explorer, right-click the project and select Add, then New Item.
6. In the dialog that appears, select Text File, name it Categories.csv, and click Add.
7. In the Solution Explorer, click to select the file, and in the Properties window, change the Copy to Output
Directory property to Copy always.
8. Paste the following text into the file and save it.
Paste into the text file.
EmployeeID(int32),LastName,FirstName,Role,City
1,James,Yolanda,Owner,Columbus
7,Reed,Marvin,Manager,Newton
9,Figg,Murray,Cashier,Columbus
12,Snead,Lance,Store Keeper,Columbus
15,Halm,Jeffry,Store Keeper,Columbus
17,Hames,Alma,Store Keeper,Oak Bay
18,Nicki,Aubrey,Store Keeper,Columbus
24,Cliett,Vikki,Store Keeper,Newton
To add a report to show the data from the custom data provider
1. In the Solution Explorer, right-click the project and select Add, then New Item.
2. In the dialog that appears, select ActiveReports 9 RDL Report, name it DemoReport, and click Add.
3. In the Solution Explorer, click to select the report, and in the Properties window, change the Copy to
Output Directory property to Copy always.
4. From the ActiveReports 9 RDL Report Toolbox, drag a Table report control onto the report.
Note: In case you are still working on Page report layout, set the FixedSize property of the Table
control to display all data on one page.
5. Click inside the table to reveal the table adorners, then right-click the table adorner to the left of the footer
row and select Delete Rows. The footer row is removed from the table.
6. In the Report Explorer, select each of the textboxes in turn and set the properties as in the following table.
(If you do not see the Report Explorer, from the View menu, select Other Windows, then Report Explorer
8.)
7. In the Report Explorer, select the Table1 node and in the Properties window, set the Location property to
1in, 1in and the Size property to 6in, 0.5in to make the table wide enough to see all of the data.
8. With Table1 still selected in the Properties window, in the DataSetName property, enter the text
DataSet1.
To add a class library project to the solution to contain the custom data provider
1. From the File menu, select Add, then New Project.
2. In the Add New Project dialog, select Class Library, and name the project CustomDataProvider.
3. In the Solution Explorer, right-click the default class and select Delete. (We will add our classes to a folder
below.)
4. Right-click the CustomDataProvider project and select Add Reference, and in the Add Reference dialog that
' Gets the name of the field represented by this instance of the
CsvColumn.
Public ReadOnly Property FieldName() As String
Get
Return _fieldName
End Get
End Property
' Gets the the Type of the field represented by this instance of
the CsvColumn.
Public ReadOnly Property DataType() As Type
Get
Return _dataType
End Get
End Property
C# code
C# code. Paste it to replace the default stub in the class.
using System;
namespace CustomDataProvider.CSVDataProvider
{
// Represents information about fields in the data source.
internal struct CsvColumn
{
private readonly string _fieldName;
private readonly Type _dataType;
if (obj is CsvColumn)
{
flag = Equals((CsvColumn) obj);
}
else
{
flag = false;
}
return flag;
}
7. Right-click the CSVDataProvider folder and select Add, then Class, then name the class CsvDataReader
and add code like the following to replace the default stub in the class.
Visual Basic code
Visual Basic code. Paste it to replace the default stub in the class.
Namespace CSVDataProvider
' Provides an implementation of IDataReader for the .NET Framework CSV Data
Provider.
Friend Class CsvDataReader
Implements IDataReader
'NOTE: HashcodeProvider and Comparer need to be case-insensitive since
TypeNames are capitalized differently in places.
'Otherwise data types end up as strings when using Int32 vs int32.
Private _typeLookup As New
Hashtable(StringComparer.Create(CultureInfo.InvariantCulture, False))
'A hashtable is used to return a type for the string value used in the
header text.
Private Sub FillTypeLookup()
_typeLookup.Add("string", GetType([String]))
_typeLookup.Add("byte", GetType([Byte]))
_typeLookup.Add("boolean", GetType([Boolean]))
_typeLookup.Add("datetime", GetType(DateTime))
_typeLookup.Add("decimal", GetType([Decimal]))
_typeLookup.Add("double", GetType([Double]))
_typeLookup.Add("int16", GetType(Int16))
_typeLookup.Add("int32", GetType(Int32))
_typeLookup.Add("int", GetType(Int32))
_typeLookup.Add("integer", GetType(Int32))
_typeLookup.Add("int64", GetType(Int64))
_typeLookup.Add("sbyte", GetType([SByte]))
_typeLookup.Add("single", GetType([Single]))
_typeLookup.Add("time", GetType(DateTime))
_typeLookup.Add("date", GetType(DateTime))
_typeLookup.Add("uint16", GetType(UInt16))
_typeLookup.Add("uint32", GetType(UInt32))
_typeLookup.Add("uint64", GetType(UInt64))
End Sub
' Returns a type based on the string value passed in from the header text
string. If no match is found,
' a string type is returned.
' The fieldType parameter represents the String value from the header
command text string.
Private Function GetFieldTypeFromString(fieldType As String) As Type
If _typeLookup.Contains(fieldType) Then
Return TryCast(_typeLookup(fieldType), Type)
End If
Return GetType([String])
End Function
' Parses the first line in the passed-in command text string to create the
field names and field data types.
' The field information is stored in a CsvColumn struct, and these column
info items are stored
' in an ArrayList. The column name is also added to a hashtable for easy
lookup later.
' The header parameter represents the header string that contains all the
fields.
' Returns True if it can parse the header string; otherwise False.
Private Function ParseHeader(header As String) As Boolean
Dim fieldName As String
Dim index As Integer = 0
If header.IndexOf("(") = -1 Then
Return False
End If
Return True
End Function
' Ensures that the header contains columns in the form of name(type)
' The line parameter represents the raw header line from the file to fix
up.
' Returns a modified header with default types appended to column names.
Private Shared Function AddDefaultTypeToHeader(line As String) As String
Const ColumnWithDataTypeRegex As String = "[""]?\w+[\""]?\(.+\)"
Dim columns As String() = line.Split(New String() {","},
StringSplitOptions.None)
Dim ret As String = Nothing
For Each column As String In columns
If Not String.IsNullOrEmpty(ret) Then
ret += ","
End If
If Not Regex.Match(column, ColumnWithDataTypeRegex).Success Then
ret += column + "(string)"
Else
ret += column
End If
Next
Return ret
End Function
' Parses a row of data using a regular expression and stores the
information inside an object
' array that is the current row of data.
' If the row does not have the correct number of fields, an exception is
raised.
' The dataRow parameter represents the String value representing a comma
delimited data row.
' Returns True if it can parse the data string; otherwise False.
Private Function ParseDataRow(dataRow As String) As Boolean
Dim index As Integer = 0
Dim tempData As String() = _rxDataRow.Split(dataRow)
' Coverts the string value coming from the command text to the appropriate
data type, based on the field's type.
' This also checks a few string value rules to decide if a String.Empty of
System.Data.DBNull needs to be returned.
' The type parameter represents the Type of the current column the data
belongs to.
' The originalValue parameter represents the String value coming from the
command text.
' Returns the object resulting from the converted string, based on the
type.
Private Function ConvertValue(type As Type, originalValue As String) As
Object
Dim fieldType As Type = type
Dim invariantCulture As CultureInfo = CultureInfo.InvariantCulture
Try
If originalValue = """""" OrElse originalValue = " " Then
Return String.Empty
End If
If originalValue = "" Then
Return DBNull.Value
End If
If originalValue = "DBNull" Then
Return DBNull.Value
End If
If fieldType.Equals(GetType([String])) Then
Return originalValue.Trim()
End If
If fieldType.Equals(GetType(Int32)) Then
Return Convert.ToInt32(originalValue, invariantCulture)
End If
If fieldType.Equals(GetType([Boolean])) Then
Return Convert.ToBoolean(originalValue, invariantCulture)
End If
If fieldType.Equals(GetType(DateTime)) Then
Return Convert.ToDateTime(originalValue, invariantCulture)
End If
If fieldType.Equals(GetType([Decimal])) Then
Return Convert.ToDecimal(originalValue, invariantCulture)
End If
If fieldType.Equals(GetType([Double])) Then
Return Convert.ToDouble(originalValue, invariantCulture)
End If
If fieldType.Equals(GetType(Int16)) Then
Return Convert.ToInt16(originalValue, invariantCulture)
End If
If fieldType.Equals(GetType(Int64)) Then
Return Convert.ToInt64(originalValue, invariantCulture)
End If
If fieldType.Equals(GetType([Single])) Then
Return Convert.ToSingle(originalValue, invariantCulture)
End If
If fieldType.Equals(GetType([Byte])) Then
Return Convert.ToByte(originalValue, invariantCulture)
End If
Return True
End Function
#End Region
_typeLookup = Nothing
_columnLookup = Nothing
_columns = Nothing
_currentRow = Nothing
End Sub
#End Region
' The name parameter represents the name of the field to find.
' Returns the index of the named field.
Public Function GetOrdinal(name As String) As Integer Implements
IDataRecord.GetOrdinal
Dim value As Object = _columnLookup(name)
If value Is Nothing Then
Throw New IndexOutOfRangeException("name")
End If
Return CInt(value)
End Function
Return _currentRow.GetValue(i)
End Function
#End Region
End Class
End Namespace
C# code
namespace CustomDataProvider.CSVDataProvider
{
FillTypeLookup();
if (!ParseHeader(header))
throw new InvalidOperationException(
"Field names and types are not defined.
The first line in the CommandText must contain the field names and data types. e.g
FirstName(string)");
}
//A hashtable is used to return a type for the string value used
in the header text.
private void FillTypeLookup()
{
_typeLookup.Add("string", typeof (String));
_typeLookup.Add("byte", typeof (Byte));
_typeLookup.Add("boolean", typeof (Boolean));
_typeLookup.Add("datetime", typeof (DateTime));
_typeLookup.Add("decimal", typeof (Decimal));
_typeLookup.Add("double", typeof (Double));
_typeLookup.Add("int16", typeof (Int16));
_typeLookup.Add("int32", typeof (Int32));
_typeLookup.Add("int", typeof (Int32));
_typeLookup.Add("integer", typeof (Int32));
_typeLookup.Add("int64", typeof (Int64));
_typeLookup.Add("sbyte", typeof (SByte));
_typeLookup.Add("single", typeof (Single));
_typeLookup.Add("time", typeof (DateTime));
_typeLookup.Add("date", typeof (DateTime));
_typeLookup.Add("uint16", typeof (UInt16));
_typeLookup.Add("uint32", typeof (UInt32));
_typeLookup.Add("uint64", typeof (UInt64));
}
return true;
}
string.Format(CultureInfo.InvariantCulture,
"Invalid row \"{0}\". The
row does not contain the same number of data columns as the table header
definition.",
dataRow);
throw new InvalidOperationException(error);
}
for (int i = 0; i < tempData.Length; i++)
{
string value = tempData[i];
if (value.Length > 1)
{
if (value.IndexOf('"', 0) == 0 &&
value.IndexOf('"', 1) == value.Length - 1)
value = value.Substring(1,
value.Length - 2);
}
// Coverts the string value coming from the command text to the
appropriate data type, based on the field's type.
// This also checks a few string value rules to decide if a
String.Empty of System.Data.DBNull needs to be returned.
// The type parameter represents the Type of the current column
the data belongs to.
// The originalValue parameter represents the String value coming
from the command text.
// Returns the object resulting from the converted string, based
return true;
}
#endregion
_typeLookup = null;
_columnLookup = null;
_columns = null;
_currentRow = null;
}
#endregion
return _currentRow.GetValue(i);
}
#endregion
}
}
8. Right-click the CSVDataProvider folder and select Add, then Class, then name the class CsvCommand and
Namespace CSVDataProvider
' Provides the IDbCommand implementation for the .NET Framework CSV Data
Provider.
Public NotInheritable Class CsvCommand
Implements IDbCommand
Private _commandText As String
Private _connection As IDbConnection
Private _commandTimeout As Integer
Private _commandType As CommandType
' Creates a new instance of the CsvCommand class with command text.
' The commandText parameter represents the command text.
Public Sub New(commandText As String)
Me.New(commandText, Nothing)
End Sub
' Creates a new instance of the CsvCommand class with command text and a
CsvConnection.
' The commandText parameter represents the command text.
' The connection parameter represents a CsvConnection to a data source.
Public Sub New(commandText As String, connection As CsvConnection)
_commandText = commandText
_connection = connection
End Sub
' Gets or sets the wait time before terminating an attempt to execute the
command and generating an error.
Public Property CommandTimeout() As Integer Implements
IDbCommand.CommandTimeout
Get
Return _commandTimeout
End Get
Set(value As Integer)
_commandTimeout = value
End Set
End Property
Set(value As CommandType)
_commandType = value
End Set
End Property
' Gets or sets the CsvConnection used by this instance of the CsvCommand.
Public Property Connection() As IDbConnection
Get
Return _connection
End Get
Set(value As IDbConnection)
_connection = value
End Set
End Property
' Returns a string that represents the command text with the parameters
expanded into constants.
Public Function GenerateRewrittenCommandText() As String Implements
IDbCommand.GenerateRewrittenCommandText
Return _commandText
End Function
Set(value As IDbTransaction)
Throw New NotImplementedException()
End Set
End Property
End Sub
#End Region
#End Region
End Class
End Namespace
C# code
C# code. Paste it to replace the default stub in the class.
using System;
using System.IO;
using GrapeCity.ActiveReports.Extensibility.Data;
namespace CustomDataProvider.CSVDataProvider
{
// Provides the IDbCommand implementation for the .NET Framework CSV Data
#endregion
#endregion
}
}
9. Right-click the CSVDataProvider folder and select Add, then Class, then name the class CsvConnection
and add code like the following to replace the default stub in the class.
Visual Basic code
Visual Basic code. Paste it to replace the default stub in the class.
Imports System
Imports System.Collections.Specialized
Imports GrapeCity.ActiveReports.Extensibility.Data
Namespace CSVDataProvider
' Provides an implementation of IDbConnection for the .NET Framework CSV Data
Provider.
Public NotInheritable Class CsvConnection
Implements IDbConnection
Private _localizedName As String
Set(value As String)
End Set
End Property
' Gets the amount of time to wait while trying to establish a connection
before terminating
' the attempt and generating an error.
' Remarks: We don't use this one for the Csv Data Provider.
Public ReadOnly Property ConnectionTimeout() As Integer Implements
IDbConnection.ConnectionTimeout
Get
Throw New NotImplementedException()
End Get
End Property
End Sub
' Closes the connection to the data source. This is the preferred method
of closing any open connection.
Public Sub Close() Implements IDbConnection.Close
Dispose()
End Sub
' Allows an Object to attempt to free resources and perform other cleanup
operations
' before the Object is reclaimed by garbage collection.
Protected Overrides Sub Finalize()
Try
Dispose(False)
Finally
MyBase.Finalize()
End Try
End Sub
#End Region
#End Region
End Class
End Namespace
C# code
C# code. Paste it to replace the default stub in the class.
using System;
using System.Collections.Specialized;
using GrapeCity.ActiveReports.Extensibility.Data;
namespace CustomDataProvider.CSVDataProvider
{
// Gets or sets the string used to open the connection to the data
source.
// Remarks: We don't use this one for the Csv Data Provider.
public string ConnectionString
{
get { return string.Empty; }
set { ; }
}
#endregion
#endregion
#endregion
}
10. Right-click the CSVDataProvider folder and select Add, then Class, then name the class
CsvDataProviderFactory and add code like the following to replace the default stub in the class.
Visual Basic code
Visual Basic code. Paste it to replace the default stub in the class.
Imports GrapeCity.ActiveReports.Extensibility.Data
Imports GrapeCity.BI.Data.DataProviders
Namespace CSVDataProvider
' Implements the DataProviderFactory for .NET Framework CSV Data Provider.
Public Class CsvDataProviderFactory
Inherits DataProviderFactory
C# code
C# code. Paste it to replace the default stub in the class.
using GrapeCity.ActiveReports.Extensibility.Data;
using GrapeCity.BI.Data.DataProviders;
namespace CustomDataProvider.CSVDataProvider
{
End Function
End Using
End Sub
End Class
End Namespace
C# code
namespace CustomDataProvider.CSVDataProvider
{
public sealed class QueryEditor : UITypeEditor
{
public override UITypeEditorEditStyle
GetEditStyle(System.ComponentModel.ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.DropDown;
}
btn.Click += delegate
{
using (var openDlg = new
OpenFileDialog())
{
openDlg.Filter = "CSV Files
(*.csv)|*.csv|All Files (*.*)|*.*";
edSvc.DropDownControl(btn);
return path;
}
}
}
2. In the Solution Explorer, right-click the CustomDataProviderDemo project and select Add Reference. In the
Add Reference dialog that appears, on the Projects tab, select CustomDataProvider and click OK.
3. Run the project, and follow the instructions in the RichTextBox to see the custom data provider in action.
Data
This section contains the following walkthroughs that fall under the Data category.
Basic Data Bound Reports
This walkthrough demonstrates the basics of setting up bound section reports.
Basic XML-Based Reports (RPX)
This walkthrough demonstrates how to create a simple section report, using the XML-based report template.
Note: This walkthrough uses the Northwind database. By default, in ActiveReports, the Northwind.mdb file is
located at [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data\NWIND.mdb.
When you complete this walkthrough you get a layout that looks similar to the following at design time and at
runtime.
Runtime Layout
2. In the Report Data Source dialog that appears, on the OLE DB tab, next to Connection String, click the
Build button.
3. In the Data Link Properties window that appears, select Microsoft Jet 4.0 OLE DB Provider and click the
Next button to move to the Connection tab.
4. Click the ellipsis (...) button to browse to your database, for example the NWind.mdb sample database.
Click Open once you have selected the appropriate database path.
5. Click the Test Connection button to see if you have successfully connected to the database.
8. Click OK to save the data source and return to the report design surface.
To create a layout for the report
1. In the Visual Studio toolbox, expand the ActiveReports 9 Section Report node and drag three TextBox
controls onto the detail section and set the properties of each textbox as indicated:
TextBox1
TextBox2
TextBox3
2. Click just below the fields to select the Detail section, and in the Properties Window, set the CanShrink
property to True to eliminate white space in the rendered report.
To view the report
Click the preview tab to view the report at design time.
OR
Open the report in the Viewer. See Using the Viewer for further information.
Note: This walkthrough uses the Northwind database. By default, in ActiveReports, the NWind.mdb file is
located in the [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data folder.
When you have finished this walkthrough, you get a report that looks similar to the following at design time and at
runtime.
Runtime Layout
TextBox2
TextBox3
2. Click just below the fields to select the Detail section, and in the Properties Window, set the CanShrink
property to True to eliminate white space in the rendered report.
To add scripting to the report to supply data for the controls
1. Click the Script tab located at the bottom of the report designer to access the script editor.
2. Add the scripting code.
The following example shows what the scripting code looks like.
Warning: Do not access the Fields collection outside the DataInitialize and FetchData events.
Accessing the Fields collection outside of these events is not supported, and has unpredictable
results.
if(m_cnn.State == System.Data.ConnectionState.Closed)
Sub Detail1_Format
if b then
Me.Detail1.BackColor = Color.AliceBlue
b= false
else
me.Detail1.BackColor = Color.Cyan
b = true
End If
End Sub
Note: This walkthrough uses the Northwind database. By default, in ActiveReports, the Northwind.mdb file is
located at [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data\NWIND.mdb.
When you complete this walkthrough you get a layout that looks similar to the following at design time and at
runtime.
Runtime Layout
Tip: Even if you will change the data source at run time, setting a design time data source allows you to
drag fields onto the report from the Report Explorer.
2. In the Report Data Source dialog that appears, on the OLE DB tab, next to Connection String, click the
Build button.
3. In the Data Link Properties window that appears, select Microsoft Jet 4.0 OLE DB Provider and click the
Next button to move to the Connection tab.
4. Click the ellipsis (...) button to browse to your database, for example the NWind.mdb sample database.
Click Open once you have selected the appropriate database path.
5. Click the Test Connection button to see if you have successfully connected to the database.
6. Click OK to close the Data Link Properties window and return to the Report Data Source dialog. Notice that
the Connection String field gets filled automatically.
7. In the Query field on the OLE DB tab, enter the following SQL query.
SQL Query
SELECT * FROM Products
8. Click OK to save the data source and return to the report design surface.
To create a layout for the report
1. On the design surface of the report, select the detail section and in the Properties window, set
the CanShrink property to True.
2. In the Report Explorer, expand the Fields node, then the Bound node. Drag the following fields onto
the detail section and in the Properties window, set the following properties.
TextBox1 (ProductID)
TextBox2 (ProductName)
TextBox3 (UnitsInStock)
TextBox4 (UnitsOnOrder)
TextBox5 (UnitPrice)
Layout
This section contains the following walkthroughs that fall under the Layout category.
Address Labels
This walkthrough demonstrates how to create a report that repeats labels using the LayoutAction property.
Columnar Reports
This walkthrough demonstrates how to create a simple report using columns.
Group On Unbound Fields
This walkthrough demonstrates how to set up grouping in an unbound section report.
Mail Merge with RichText
This walkthrough demonstrates how to create a mail-merge report using the RichText control.
Overlaying Reports (Letterhead)
This walkthrough demonstrates how to overlay an ActiveReport with a static letterhead report.
Run Time Layouts
Describes how to create and modify report layouts dynamically.
Subreports with XML Data
Learn how to use XML data with subreports.
Subreports with Run-Time Data Sources
Learn how to embed a subreport in a main report, passing the data source from the main report to the subreport
at run time.
Address Labels
ActiveReports can be used to print any label size by using the newspaper column layout.
This walkthrough illustrates how to create a report that repeats labels using the LayoutAction property and prints labels to a laser printer. The labels in this example are 1" x 2.5" and print
30 labels per 8½" x 11" sheet.
The walkthrough is split up into the following activities:
Connecting the report to a data source
Adding controls to the report to display data
Adding code to the detail_Format event to repeat labels
Viewing the report
Note: This walkthrough uses the Northwind database. By default, in ActiveReports, the NWind.mdb file is located in the [User Documents folder]\GrapeCity Samples\ActiveReports
9\Data folder.
When you have finished this walkthrough, you get a report that looks similar to the following at design time and at runtime.
Runtime Layout
2. In the Report Data Source dialog that appears, on the OLE DB tab, next to Connection String, click the Build button.
3. In the Data Link Properties window that appears, select Microsoft Jet 4.0 OLE DB Provider and click the Next button to move to the Connection tab.
4. Click the ellipsis (...) button to browse to your database, for example the NWind.mdb sample database. Click Open once you have selected the appropriate database path.
5. Click the Test Connection button to see if you have successfully connected to the database.
6. Click OK to close the Data Link Properties window and return to the Report Data Source dialog. Notice that the Connection String field gets filled automatically.
7. In the Query field on the OLE DB tab, enter the following SQL query.
SQL Query
SELECT ContactName, CompanyName, Address, City, PostalCode, Country FROM Customers
8. Click OK to save the data source and return to the report design surface.
To create a layout for the report
1. Right-click the PageHeader section and select Delete to remove the PageHeader and Footer sections from the report.
2. In the Report menu, select Settings and change the margins as follows:
Top margin: 0.5
Bottom margin: 0.5
Left margin: 0.2
Right margin: 0.2
3. In the Report Explorer, select Report and in the Properties Window, set the PrintWidth property to 8.1 (the width of the label sheet less the Left and Right margins).
4. Click the detail section of the report to select it and in the Properties window, set the properties as follows.
5. From the toolbox, drag six TextBox controls onto the detail section and set the properties of each textbox as follows.
TextBox1
TextBox2
TextBox3
TextBox4
TextBox5
TextBox6
6. Select all of the textboxes, and in the Properties Window, set the CanGrow property to False. This prevents overlapping text, but may crop data if one of the fields contains more
data than the control size allows.
If you preview the report at this point, one copy of each label appears on the page.
To add code to the detail_Format event to repeat labels
1. Double-click in the detail section to create a detail_Format event.
2. Add the following code to the event to repeat each label across all three columns.
To write the code in Visual Basic.NET
counter = 0;
}
Columnar Reports
ActiveReports supports newspaper column layouts in both the Detail and Group sections. You can render the
columns either horizontally or vertically in the section with options to break the column on the Group section (i.e.
start a new column on the change of a group).
There is also a Boolean ColumnGroupKeepTogether property on the GroupHeader. When set to True, the
ColumnGroupKeepTogether property attempts to prevent a group from splitting across columns. If a group cannot
fit in the current column, it tries the next. If the group is too large for a single column, the property is ignored.
This walkthrough illustrates how to create a simple report using columns, and is split up into the following
activities:
Connecting the report to a data source
Adding controls to the report to display data
Viewing the report
Note: This walkthrough uses the Northwind database. By default, in ActiveReports, the Northwind.mdb file is
When you complete this walkthrough you get a layout that looks similar to the following at design time and at
runtime.
Runtime Layout
2. In the Report Data Source dialog that appears, on the OLE DB tab, next to Connection String, click the
Build button.
3. In the Data Link Properties window that appears, select Microsoft Jet 4.0 OLE DB Provider and click the
Next button to move to the Connection tab.
4. Click the ellipsis (...) button to browse to your database, for example the NWind.mdb sample database.
Click Open once you have selected the appropriate database path.
5. Click the Test Connection button to see if you have successfully connected to the database.
6. Click OK to close the Data Link Properties window and return to the Report Data Source dialog. Notice that
the Connection String field gets filled automatically.
7. In the Query field on the OLE DB tab, enter the following SQL query.
SQL Query
SELECT Country, CompanyName, ContactName, Phone FROM Customers ORDER
BY Country
8. Click OK to save the data source and return to the report design surface.
To create a layout for the report
1. Right-click the design surface of the report and select Insert, then Group Header/Footer to add a
GroupHeader/Footer section.
2. Select the group header and in the Properties Window, set the properties as follows.
3. Select the group footer and in the Properties window, set the BackColor property to Goldenrod.
4. In the Report Explorer, drag the Country field onto the GroupHeader section and in the Properties window,
set its properties as follows.
5. Select the PageHeader section and in the Properties window, set the BackColor property to Linen.
6. From the toolbox, drag a Label control onto the PageHeader section and in the Properties window, set the
properties as follows:
7. Select the Detail section and in the Properties window, set the properties as follows.
8. In the Report Explorer, expand the Fields node, then the Bound node. Drag the following fields onto the
Detail section and set the properties of each textbox as indicated.
TextBox1
TextBox2
TextBox3
Note: This walkthrough uses the Northwind database. By default, in ActiveReports, the Northwind.mdb file is
located at [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data\NWIND.mdb.
When you complete this walkthrough you get a layout that looks similar to the following at design time and at
runtime.
Runtime Layout
//Retrieve data
reader = command.ExecuteReader();
3. Select the group footer, and in the Properties Window, change the Name property to gfCategories.
4. Select the Detail section, and in the Properties Window, change the CanShrink property to True.
5. From the toolbox, drag the following controls to the Group Header section (drag the bottom edge of the
section down to display all of the controls) and in the Properties window, set the properties of each control
as follows.
TextBox1
TextBox2
Label1
Label2
6. From the toolbox, drag two Textbox controls to the Detail section and in the Properties window, set the
properties of each control as follows.
TextBox1
TextBox2
7. From the toolbox, drag the following controls to the Group Footer section and in the Properties window, set
the properties of each control as follows.
Label
TextBox
Line
Warning: Do not access the Fields collection outside the DataInitialize and FetchData events. Accessing
the Fields collection outside of these events is not supported, and has unpredictable results.
Note: This walkthrough uses the Northwind database. By default, in ActiveReports, the Northwind.mdb file is
located at [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data\NWIND.mdb.
When you complete this walkthrough you get a layout that looks similar to the following at design time and at
runtime.
Runtime Layout
2. In the Report Data Source dialog that appears, on the OLE DB tab, next to Connection String, click the
Build button.
3. In the Data Link Properties window that appears, select Microsoft Jet 4.0 OLE DB Provider and click the
Next button to move to the Connection tab.
4. Click the ellipsis (...) button to browse to your database, for example the NWind.mdb sample database.
Click Open once you have selected the appropriate database path.
5. Click the Test Connection button to see if you have successfully connected to the database.
6. Click OK to close the Data Link Properties window and return to the Report Data Source dialog. Notice that
the Connection String field gets filled automatically.
7. In the Query field on the OLE DB tab, enter the following SQL query.
SQL Query
SELECT Customers.CustomerID, Customers.CompanyName,
Customers.ContactName, Customers.Address, Customers.City,
Customers.Region, Customers.Country, Customers.PostalCode,
Orders.OrderID, Orders.OrderDate, [Order Subtotals].Subtotal
FROM Customers INNER JOIN ([Order Subtotals] INNER JOIN Orders ON
[Order Subtotals].OrderID = Orders.OrderID) ON Customers.CustomerID =
Orders.CustomerID
8. Click OK to save the data source and return to the report design surface.
To create a layout for the report
1. On the design surface of the report, right-click and select Insert, then Group Header/Footer to add
group header and footer sections.
2. On the design surface, select the grey area outside the report and in the Properties window, set the
PrintWidth property to 6.5.
3. Select the group header and in the Properties window, set the properties as follows.
4. On the design surface of the report, select the group footer section and in the Properties window, set the
following properties.
5. On the design surface of the report, select the detail section and in the Properties window, set
the CanShrink property to True.
6. On the design surface of the report, select the pageHeader section and in the Properties window, set
the following properties.
7. From the toolbox, drag the Label control to the pageHeader section and in the Properties window, set the
properties as follows.
Label
8. In the Report Explorer, expand the Fields node, then the Bound node. Drag the SubTotal field onto the
groupHeader section and in the Properties window, set the following properties.
Note: Even though txtSubtotal1 is hidden, setting its properties is important as it provides the value
and the formatting that is displayed in the RichText control.
9. From the toolbox, drag the following controls to the groupHeader section and in the Properties window, set
the properties as follows.
RichTextBox
Label1
Label2
Label3
10. In the Report Explorer, expand the Fields node, then the Bound node. Drag the following fields onto the
detail section and in the Properties window, set the properties of each textbox as follows.
TextBox1 (OrderID)
TextBox2 (OrderDate)
TextBox3 (Subtotal)
11. From the toolbox, drag the following controls to the groupFooter section and in the Properties window, set
the properties as follows.
Label1
Label2
12. From the toolbox, drag a Label control to the pageFooter section and in the Properties window, set the
properties as follows.
Label
Thank you for your business. Below is a list of your orders for the past year with
a total of [!SubTotal].
Please take this opportunity to review each order and total for accuracy. Call us
at 1-800-DNT-CALL with
any questions or concerns.
8. Arrange the text and fields within the control as you would in any text editor.
To use the FetchData event to conditionally format data
To write the code in Visual Basic
To add code to update RichText fields with the current date and conditional values
1. Double-click in the group header section of the report to create an event-handling method for the group
header's Format event.
2. Add code to the handler to:
Replace the Date field in the RichText control with the current system date
Replace the Region field with the conditional value created in the FetchData event
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the Group Header Format event.
'Use the current date in the letter
Me.RichTextBox1.ReplaceField("Date", System.DateTime.Today.Date.ToShortDateString())
'Use the value returned by the FetchData event
Me.RichTextBox1.ReplaceField("Region", region)
To add code to send the group subtotal value to the RichText field
Note: We use the BeforePrint event instead of the Format event to get the final value of the subtotal
field just prior to printing. For more information on section event usage, see the Section Events topic.
4. Add code to the handler to replace the value of the Subtotal field in the RichText control with the value of
the hidden textbox in the group header.
Visual Basic.NET code. Paste INSIDE the Group Header BeforePrint event.
'Use the value from the hidden group subtotal field
Me.RichTextBox1.ReplaceField("SubTotal", Me.txtSubtotal1.Text)
Note: This walkthrough uses the Northwind database. By default, in ActiveReports, the Northwind.mdb file is
located at [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data\NWIND.mdb.
When you complete this walkthrough you get a layout that looks similar to the following at design time and at
runtime.
Runtime Layout
2. In the Report Data Source dialog that appears, on the OLE DB tab, next to Connection String, click the
Build button.
3. In the Data Link Properties window that appears, select Microsoft Jet 4.0 OLE DB Provider and click the
Next button to move to the Connection tab.
4. Click the ellipsis (...) button to browse to your database, for example the NWind.mdb sample database.
Click Open once you have selected the appropriate database path.
5. Click the Test Connection button to see if you have successfully connected to the database.
6. Click OK to close the Data Link Properties window and return to the Report Data Source dialog. Notice that
the Connection String field gets filled automatically.
7. In the Query field on the OLE DB tab, enter the following SQL query.
8. Click OK to save the data source and return to the report design surface.
To create a layout for the rptData
1. Select the PageHeader section and in the Properties Window, set the Height property to 0.65. (This will
match the height of the page header in the template.)
2. On the design surface, select the grey area outside the report and in the Properties window, set the
PrintWidth property to 6.5.
3. Right-click the report and select Insert > GroupHeader/Footer to add group header and group footer
sections.
4. Select the group header and in the Properties window, set the properties as follows.
5. From the toolbox, drag the following controls to ghCustomers and in the Properties window, set the
properties as follows.
TextBox1
Label1
Label2
Label4
6. Click the Detail section and in the Properties window, set the properties as follows.
7. From the toolbox, drag four TextBox controls onto the Detail section and set the properties of each textbox
as follows.
TextBox1
TextBox2
TextBox3
TextBox4
8. Select the group footer and in the Properties window, set the Height property to 0.
To create a layout for the rptLetterhead
1. Select the Page Header and in the Properties window, set the properties as follows.
2. From the toolbox, drag a Label control onto the Page Header and in the Properties window, set the
properties as follows.
Label1
3. Select the Page Footer and in the Properties window, set the BackColor property to DarkSlateBlue.
4. From the toolbox, drag a Label control onto the Page Footer and in the Properties window, set the
properties as follows.
To add code to overlay the data report pages with the letterhead report
To write the code in Visual Basic.NET
Add the ActiveReports viewer control to the Windows Form. Then, double-click the top of the Windows
Form to create an event-handling method for the form's Load event. Add code to the handler to:
Set the viewer to display the rptData report document
Overlay rptLetterhead on rptData
The following example shows what the code for the method looks like.
Visual Basic.NET code. Paste INSIDE the Form Load event.
Dim rpt As New rptData()
rpt.Run()
Dim rpt2 As New rptLetterhead()
rpt2.Run()
Dim i As Integer
For i = 0 To rpt.Document.Pages.Count - 1
rpt.Document.Pages(i).Overlay(rpt2.Document.Pages(0))
Next
Note: Add controls dynamically in the ReportStart event, otherwise, results may be unpredictable. For more
information on events, see the Section Report Events topic.
Note: This walkthrough uses the NWind database. By default, in ActiveReports, the Nwind.mdb file is located in
the [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data folder.
When you complete this walkthrough you get a layout that looks similar to the following at design time and at
runtime.
Runtime Layout
3. From the Visual Studio toolbox, drag the following controls onto the Panel1 and in the Properties Window, set
the properties listed below.
Label
CheckedListBox
Button
CheckBox
4. From the Visual Studio toolbox, drag the Viewer control to the Windows Form and in the Properties Window, set
the properties as follows.
Viewer
5. Open the Form and from the Visual Studio toolbox, drag DataSet onto the Form.
6. From the Add DataSet dialog that appears, select Typed dataset and click OK.
Visual Basic.NET code. Paste JUST BELOW the statements at the top of the code view
Imports GrapeCity.ActiveReports.SectionReportModel
Visual Basic.NET code. Paste INSIDE the class declaration of the report.
Private m_arrayFields As ArrayList
Private m_useGroups As Boolean
'Create an array to hold the fields selected by the user
Public WriteOnly Property FieldsList() As ArrayList
Set(ByVal Value As ArrayList)
m_arrayFields = Value
End Set
End Property
C# code. Paste JUST BELOW the statements at the top of the code view
using GrapeCity.ActiveReports.SectionReportModel;
To add code to fill the check list with fields and to launch the report
1. Right-click the Windows Form and select View Code.
2. Add code within the class declaration of the form to:
Fill the check list with fields
Launch the report
To write the code in Visual Basic.NET
The following example shows what the code for the method looks like.
Visual Basic.NET code. Paste INSIDE the class declaration of the form.
Dim i As Integer
Dim c As Integer
Dim m_arrayField As New ArrayList()
Private Sub fillCheckBox()
For i = 0 To Me.NwindDataSet1.Tables.Count - 1
For c = 0 To Me.NwindDataSet1.Tables(i).Columns.Count - 1
Me.clbFields.Items.Add(Me.NwindDataSet1.Tables(i).Columns(c).ColumnName)
Next
Next
End Sub
Private Sub launchReport()
Dim rpt As New rptRunTime()
Dim dataAdapter As New NWINDDataSetTableAdapters.ProductsTableAdapter
To add code to the ReportStart event to call the report layout code
1. Double-click the gray area below rptRunTime to create an event-handling method for rptRunTime's ReportStart
event.
2. Add code to call the constructReport method.
To write the code in Visual Basic.NET
The following example shows what the code for the method looks like.
Visual Basic.NET code. Paste INSIDE the ReportStart event.
constructReport()
To add code to the button's Click event to collect the selected values and launch the report
1. Double-click btnGenRep to create an event-handling method for the button click event.
2. Add code to the handler to collect the selected values and launch the report.
To write the code in Visual Basic.NET
The following example shows what the code for the method looks like.
Visual Basic.NET code. Paste INSIDE the button click event.
Me.m_arrayField.Clear()
For Me.i = 0 To Me.clbFields.CheckedItems.Count - 1
m_arrayField.Add(Me.clbFields.CheckedItems(i).ToString)
Next
launchReport()
To add code to the Form_Load event to call the fill check list code
1. Double-click the title bar of the form. This creates an event-handling method for the Windows Form_Load
event.
2. Add code to the handler to call the fillCheckBox() method to populate clbFields with field values and to handle
exceptions.
To write the code in Visual Basic.NET
The following example shows what the code for the method looks like.
Note: This walkthrough uses Customer.xml. By default, in ActiveReports, the Customer.xml file is located in
the [User Documents folder]\GrapeCity Samples\ActiveReports 9\Samples\Data folder.
When you complete this walkthrough you get a layout that looks similar to the following at design time and at
runtime.
Runtime Layout
2. In the Report Data Source dialog, on the XML tab, click the ellipsis (...) button next to File URL field.
3. In the Open File window that appears, navigate to Customer.xml and click the Open button. (The default
installation path is C:\Users\YourUserName\Documents\GrapeCity Samples\ActiveReports
9\Data\customer.xml).
4. In the Recordset Pattern field, enter //CUSTOMER.
5. Click OK to save the data source and return to the report design surface.
To create a layout for the Parent Report (rptMain)
1. On the design surface, select the pageHeader section and in the Properties window, set the
Height property to 0.3.
2. On the design surface, select the grey area outside the report and in the Properties window, set the
PrintWidth property to 6.5.
3. On the design surface, select the detail section and in the Properties window, set the CanShrink property
to True to eliminate white space.
4. From the toolbox, drag the Label control onto the pageHeader section and in the Properties window, set
the properties as follows.
5. From the toolbox, drag the controls onto the detail section and in the Properties window, set the properties
of each control as follows.
TextBox1
Label1
Label2
Subreport
Tip: Even if you do not want colors in your finished reports, using background colors on subreports
can help in troubleshooting layout issues.
2. On the design surface, right-click the pageHeader or pageFooter section and select Delete. Subreports do
not render these sections, so deleting them saves processing time.
3. From the toolbox, drag the following controls to the detail section and in the Properties window, set the
properties as follows.
TextBox1
TextBox2
Warning: Do not create a new instance of the subreport in the Format event. Doing so creates a new
subreport each time the section Format code is run, which uses a lot of memory.
To add code to pass a subset of the Parent Report's data to the Child Report
To add code to pass a subset of the parent report's data to the subreport
1. Double-click in the detail section of the design surface of rptMain to create a detail_Format event.
2. Add code to the handler to:
Create a new GrapeCity XMLDataSource
Type cast the new data source as rptMain's data source and set the NodeList to the
"ORDER/ITEM" field
Display rptSub in the subreport control
Pass the new data source to the subreport
To write the code in Visual Basic
The following example shows what the code for the method looks like.
Visual Basic.NET code. Paste INSIDE the Format event.
Dim xmlDS As New GrapeCity.ActiveReports.Data.XMLDataSource
xmlDS.NodeList = CType(CType(Me.DataSource,
GrapeCity.ActiveReports.Data.XMLDataSource).Field("ORDER/ITEM", True),
System.Xml.XmlNodeList)
rpt.DataSource = xmlDS
SubReport1.Report = rpt
Note: This walkthrough uses tables from the NWind database. By default, in ActiveReports, the NWind.mdb
file is located in the [User Documents folder]\GrapeCity Samples\ActiveReports 9\Samples\Data folder.
When you complete this walkthrough you get a layout that looks similar to the following at design time and at
runtime.
Runtime Layout
2. In the Report Data Source dialog that appears, from the OLE DB tab, create a data source connection. See
Bind Reports to a Data Source for further details.
3. Once the connection string field is populated, in the Query field, enter the following SQL query.
SQL Query
SELECT * FROM Categories
4. Click OK to save the data source and return to the report design surface.
To create a layout for the Parent Report (rptMain)
1. In the Report Explorer, select the report and in the Properties window, set the PrintWidth property to
5.75.
2. On the design surface, select the detail section and in the Properties window, set the CanShrink property
to True to eliminate white space.
3. From the toolbox, drag a Label control onto the pageHeader section and in the Properties window, set the
properties as follows.
4. From the toolbox, drag the following controls onto the detail section and in the Properties window, set the
properties as follows.
TextBox1
TextBox2
Label1
Label2
Subreport
Tip: Even if you do not want colors in your finished reports, using background colors on subreports
can help in troubleshooting layout issues.
2. On the design surface, right-click the pageHeader or pageFooter section and select Delete. Subreports do
not render these sections, so deleting them saves processing time.
3. From the toolbox, drag a TextBox control to the detail section and in the Properties window, set the
following properties.
Warning: Do not create a new instance of the subreport in the Format event. Doing so creates a new
subreport each time the section Format code is run, which uses a lot of memory.
To add code to assign a data source for the Child Report (rptSub)
1. Back in design view of the Parent report (rptMain), double-click the detail section. This creates the
Detail_Format event handler.
2. Add code to the handler to:
Set the connection string for the OleDBDataSource for the subreport
Set the SQL query for the new data source and pass in the current record's CategoryID
Set the data source of the subreport to the data source
Assign rptSub to the SubReport control
To write the code in Visual Basic
The following example shows what the code for the method looks like.
Chart
This section contains the following walkthroughs that fall under the Chart category.
Bar Chart
Bar Chart
Bar charts are useful in comparing items across categories. This walkthrough illustrates how to create a simple bar chart using the ActiveReports chart
control.
The walkthrough is split up into the following activities:
Adding a chart control to the report
Setting a data source for the chart
Setting the chart's properties
Note: This walkthrough uses the Northwind database. By default, in ActiveReports, the Northwind.mdb file is located at [User Documents
folder]\GrapeCity Samples\ActiveReports 9\Data\NWIND.mdb.
When you complete this walkthrough you get a layout that looks similar to the following at runtime.
3. On the design surface, select the grey area outside the report and in the Properties window, set the PrintWidth property to 6.5.
4. In the Properties window, set the following properties.
5. In the Report Explorer, select Detail1 and go to the properties window to set the Height property to 3.5.
To connect the Chart to a data source
1. Select the Chart control and at the bottom of the Properties window, select the Data Source command. See Properties Window for further details on
accessing commands.
Tip: If the verb is not visible, right-click an empty space in the Properties Window and select Commands to display verbs.
2. In the Chart DataSource dialog box that appears, click the Build button.
3. In the Data Link Properties window, select Microsoft Jet 4.0 OLE DB Provider and click the Next button.
4. Click the ellipsis button (...) to browse to the Northwind database. Click Open once you have selected the file.
5. Click the OK button to close the window and fill in the Connection String.
6. In the Query field, enter the following SQL query.
SQL Query
SELECT ShipCountry, SUM(Freight) AS FreightSum FROM Orders GROUP BY ShipCountry
d. Click Axis Y on the left, and on the Common tab in the pane to the right, type Freight in the Title textbox and set the Font size to 12.
Titles
a. Click the Titles bar on the left to expand it. In the list of titles, the header is selected by default.
b. In the Caption textbox, type Simple Bar Chart and increase the Font size to 14.
c. In the list of titles to the left, select the footer and delete it by clicking the Delete icon on top of the list.
Series
a. Click the Series bar on the left. The Series1 is selected by default.
b. In the Data Binding box, set X (Name) to ShipCountry, and set Y to FreightSum.
c. In the list of series to the left, select Series2 and Series3 and delete them by clicking the Delete icon on top of the list.
Legend
a. Click the Legend bar on the left to expand it. The defaultLegend is selected by default.
b. On the Common tab, clear the Visible checkbox to hide the legend.
3. Click Finish to exit the Chart Designer.
To view the report
Click the preview tab to view the report at design time.
OR
Open the report in the Viewer. See Using the Viewer for further information.
3D Pie Chart
Pie charts are useful in showing how the percentage of each data item contributes to the total. This walkthrough
illustrates how to create a three dimensional pie chart.
The walkthrough is split up into the following activities:
Adding a chart control to the report
Adding a series and data points to the chart
Setting the chart's properties
When you complete this walkthrough you get a layout that looks similar to the following at design time and at
runtime.
Tip: If you do not want the chart wizard to appear each time you add a chart, clear the Auto Run
Wizard checkbox. You can still access the wizard via the command verbs (see below).
4. In the Report Explorer, select Detail1 and go to the properties window to set the Height property to 3.5.
5. On the design surface, select the grey area outside the report and in the Properties window, set the
PrintWidth property to 6.5.
To add a series and data points to the Chart
1. With the chart control selected, go to the Properties window and click the Series (Collection) property ,
then click the ellipsis button (...) that appears.
2. In the Series Collection Editor that appears, Series1 is selected by default. There, under Series1
properties, change the following.
3. Click the Points (Collection) property, then click the ellipsis button that appears.
4. In the DataPoint Collection that appears, click the Add button to add a data point.
5. In the DataPoint Collection Editor that appears, go to the Properties window to set the following
properties.
12. Click OK to save the data points and return to the Series Collection Editor.
13. In the Series Collection Editor under Members, select Series2 and Series3 and click the Remove
button.
14. Click OK to save the changes and return to the report design surface.
To configure the appearance of the Chart
1. With the chart control selected, go to the Properties window and click the ChartAreas (Collection)
property and then click the ellipsis button that appears.
2. In the ChartArea Collection Editor that appears, expand the Projection property node and set
the VerticalRotation property to 50. This allows you to see more of the top of the pie.
3. Click OK to return to the report design surface.
4. With the chart control highlighted, go to the Properties window and click the Titles (Collection) property
and then click the ellipsis button that appears.
5. In the Title Collection Editor that appears, under header properties, set the following properties.
6. Under Members, select the footer and click the Remove button.
7. Click OK to return to the report design surface.
To view the report
Click the preview tab to view the report at design time.
OR
Open the report in the Viewer. See Using the Viewer for further information.
Financial Chart
Financial charts are useful for displaying stock information using High, Low, Open and Close values. This
walkthrough illustrates how to create a Candle chart.
The walkthrough is split up into the following activities:
Adding a chart control to the report
Adding a series and data points to the chart
Setting the chart's properties
When you complete this walkthrough you get a layout that looks similar to the following at design time and at
runtime.
4. In the Report Explorer, select Detail1 and go to the properties window to set the Height property to
3.5.On the design surface, select the grey area outside the report and in the Properties window, set the
PrintWidth property to 6.5.
To add a series and data points to the Chart
1. With the chart control selected, go to the Properties window and click the Series (Collection) property
and then click the ellipsis button.
2. In the Series Collection Editor that appears, Series1 is selected by default. There, under Series1
properties, change the following.
3. Click the Points (Collection) property, then click the ellipsis button that appears.
4. In the DataPoint Collection window that appears, click Add to add a data point and set its YValues
property to 99; 37; 53; 88.
Note: The first Y value is the high figure or top of the wick; the second is the low figure, or bottom of
the wick; the third is the opening figure; the fourth is the closing figure. If the fourth figure is higher
than the third, the candle is DarkViolet, the BodyUpswingBackdrop.
5. Click Add to add another data point and set its YValues property to 115; 22; 101; 35.
6. Click Add to add another data point, and set its YValues property to 87; 1; 7; 80.
7. Click Add to add another data point, and set its YValues property to 63; 14; 57; 25.
8. Click Add to add another data point, and set its YValues property to 130; 25; 25; 120.
9. Click OK to save the data points and close the window.
10. In the Series Collection Editor under Members, select Series2 and Series3 and click the Remove
button.
11. Click OK to return to the report design surface.
To configure the appearance of the Chart
1. With the chart control selected, go to the Properties window and click the ChartAreas (Collection) property
and then click the ellipsis button that appears.
2. In the ChartArea Collection Editor that appears, under defaultArea properties, click the Axes (Collection)
Unbound Chart
The Chart control allows you to bind charts to any type of data source, including arrays. You can create a chart
without setting its data source and load the data into the control at run time. This walkthrough illustrates how to
create a simple unbound chart.
The walkthrough is split up into the following activities:
Adding the chart control to the report and setting chart properties
Note: This walkthrough uses the Northwind database. By default, in ActiveReports, the Northwind.mdb file is
located at [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data\NWIND.mdb.
When you complete this walkthrough you get a layout that looks similar to the following at runtime.
4. In the Report Explorer, select Detail and go to the properties window to set the Height property to 3.5.
5. On the design surface, select the grey area outside the report and in the Properties window, set the
PrintWidth property to 6.5.
To configure the appearance of the Chart
1. Select the Chart control and at the bottom of the Properties window, select the Customize command. See
Properties Window for further details on accessing commands.
Tip: If the verb is not visible, right-click an empty space in the Properties Window and select
Commands to display verbs.
2. In the ChartAreas view which displays by default, click the Axes bar to expand it.
3. Click Axis X, and on the Common tab in the pane to the right, type Company Name in the Title textbox
and set the font size to 12.
4. Click Axis Y on the left, and on the Common tab in the pane to the right, type Freight in US$ in the Title
textbox and increase the Font size to 12.
5. Click the Titles bar on the left. In the list of titles, header is selected by default.
6. On the Title properties page, type Unbound Chart in the Caption textbox and set the Font size to 14.
7. Under Titles, select the footer and delete it by clicking the Delete icon on top of the list.
8. Click the Series bar on the left.
9. Under Series, select Series1, Series2 and Series3 and delete them by clicking the Delete icon on top of
the list.
10. Click the Legends bar on the left. The defaultLegend is selected by default.
11. On the Common page, clear the Visible checkbox to hide the legend.
Export
This section contains the following walkthroughs that fall under the Export category.
Custom Web Exporting (Std Edition)
This walkthrough demonstrates how to set up report custom exporting to PDF, Excel, TIFF, RTF, and plain text
formats.
Custom HTML Outputter
This walkthrough demonstrates how to create a custom HTML outputter for your ActiveReports ASP.NET Web
Application.
rpt.Run();
GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport pdfExport1 = new
GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport();
pdfExport1.Export(rpt.Document, m_stream);
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "inline;filename=MyExport.pdf");
Response.BinaryWrite(m_stream.ToArray());
Response.End();
Note: To use the one-touch printing option, add the following to the code above.
Visual Basic.NET code. Paste INSIDE the Page Load event.
pdfExport1.Options.OnlyForPrint = True
Note: You cannot create a custom HTML outputter for a page report because the html rendering extension
does not support the custom output formatter.
The following example shows what the complete code for the method looks like.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste JUST ABOVE the class.
case HtmlOutputKind.HtmlPage:
{
//Store the name of the main page so we can
//redirect the browser to it
this.mainPage = this.GenUniqueFileNameWithExtension(".html");
FileStream fs = File.Create(this.mainPage);
this.WriteStreamToStream(info.OutputStream, fs);
fs.Close();
return this.mainPage;
}
case HtmlOutputKind.ImageJpg:
{
// Create a file with a .jpg extension:
temp = this.GenUniqueFileNameWithExtension(".jpg");
FileStream fs = File.Create(temp);
this.WriteStreamToStream(info.OutputStream, fs);
case HtmlOutputKind.ImagePng:
{
//Create a file with a .png extension:
temp = this.GenUniqueFileNameWithExtension(".png");
FileStream fs = File.Create(temp);
this.WriteStreamToStream(info.OutputStream, fs);
fs.Close();
return temp;
}
default:
{
//Default to html:
temp = this.GenUniqueFileNameWithExtension(".html");
FileStream fs = File.Create(temp);
this.WriteStreamToStream(info.OutputStream, fs);
fs.Close();
return temp;
}
}
}
rpt.Run(False)
Catch eRunReport As Exception
'If the report fails to run, report the error to the user
Response.Clear()
Response.Write("<h1>Error running report:</h1>")
Response.Write(eRunReport.ToString())
Return
End Try
Response.Buffer = True
'Clear any part of this page that might have already been buffered for output.
Response.ClearContent()
'Clear any headers that might have already been buffered (such as the content type
Response.ClearHeaders()
'Tell the browser and the "network" that the resulting data of this page should be
'cached since this could be a dynamic report that changes upon each request.
Response.Cache.SetCacheability(HttpCacheability.NoCache)
'Tell the browser this is an Html document so it will use an appropriate viewer.
Response.ContentType = "text/HTML"
//Clear any part of this page that might have already been buffered for output.
Response.ClearContent();
//Clear any headers that might have already been buffered (such as the content
//type for an HTML page)
Response.ClearHeaders();
//Tell the browser and the "network" that the resulting data of this page should
//be cached since this could be a dynamic report that changes upon each request.
Response.Cache.SetCacheability(HttpCacheability.NoCache);
//Tell the browser this is an Html document so it will use an appropriate viewer.
Response.ContentType = "text/html";
Script
This section contains the following walkthroughs that fall under the Script category.
ActiveReports allows you to embed script in reports so that code becomes portable when you save a report layout
Tip: For basic steps like adding a report to a Visual Studio project and viewing a report, please see the Basic
Data Bound Reports walkthrough.
Note: This walkthrough uses the the Northwind database. By default, in ActiveReports, the NWind.mdb file is
located in [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data folder.
When you have finished this walkthrough, you will have a report that looks similar to the following at design time
and at runtime.
Runtime Layout
Note: The following steps are just for convenience so that the fields list in the Report Explorer can be
populated at design time.
1. In the Report Data Source dialog, on the OLE DB tab, next to Connection String, click the Build button.
2. In the Data Link Properties window that appears, select Microsoft Jet 4.0 OLE DB Provider and click the
Next button to move to the Connection tab.
3. Click the ellipsis (...) button to browse to your database, for example the NWind.mdb sample database.
Click Open once you have selected the appropriate database path.
4. Click the Test Connection button to see if you have successfully connected to the database.
5. Click OK to close the Data Link Properties window and return to the Report Data Source dialog. Notice that
the Connection String field gets filled automatically.
6. In the Query field on the OLE DB tab, enter the following SQL query.
SQL Query
SELECT * FROM categories INNER JOIN products ON categories.categoryid =
products.categoryid ORDER BY products.categoryid, products.productid
7. Click OK to save the data source and return to the report design surface.
To create a layout for the report
1. Right-click the design surface of the report and select Insert then Group Header/Footer to add group
header and footer sections to your report.
2. Increase the group header section's height so that you have room to work.
3. With the GroupHeader section selected, go to the Properties Window to set the following properties.
4. From the toolbox, drag the following controls to the GroupHeader section and set the properties of each
control as indicated.
TextBox1
TextBox2
Label1
Label2
5. From the toolbox, drag the following controls onto the detail section and set the properties of each as
indicated.
TextBox1
TextBox2
6. Click just below the fields to select the Detail section, and in the Properties Window, set the CanShrink
property to True to eliminate white space in the rendered report.
7. In the Detail section, select both TextBox1 and TextBox2, right-click and select Format Border.
Select DarkCyan in the color combo box.
Select the solid line in the Line Styles pane.
Click the bottom edge in the Preview pane.
Click the OK button to add a solid cyan line to the bottom edge of the text boxes.
8. Increase the group footer section's height so that you have room to work.
9. With the GroupFooter section selected, go to the properties window and set the following properties.
10. From the toolbox, drag the following controls to the GroupFooter Section and set the properties of each
control as indicated.
TextBox1
TextBox2
Label1
Warning: Do not access the Fields collection outside the DataInitialize and FetchData events. Accessing
the Fields collection outside of these events is not supported, and has unpredictable results.
if(m_cnn.State == System.Data.ConnectionState.Closed)
{
m_cnn.Open();
}
m_reader = m_Cmd.ExecuteReader();
}
Tip: For basic steps like adding a report to a Visual Studio project and viewing a report, please see the Basic
Data Bound Reports walkthrough.
Note: This walkthrough uses the Northwind database. By default, in ActiveReports, the Northwind.mdb file is
located at [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data\NWIND.mdb.
When you have finished this walkthrough, you will have a report that looks similar to the following at design time
and at runtime.
Note: The following steps are just for convenience so that the fields list in the Report Explorer can be
1. In the Report Data Source dialog, on the OLE DB tab, next to Connection String, click the Build button.
2. In the Data Link Properties window that appears, select Microsoft Jet 4.0 OLE DB Provider and click the
Next button to move to the Connection tab.
3. Click the ellipsis (...) button to browse to your database, for example the NWind.mdb sample database.
Click Open once you have selected the appropriate database path.
4. Click the Test Connection button to see if you have successfully connected to the database.
5. Click OK to close the Data Link Properties window and return to the Report Data Source dialog. Notice that
the Connection String field gets filled automatically.
6. In the Query field on the OLE DB tab, enter the following SQL query.
SQL Query
SELECT * FROM Orders INNER JOIN Customers ON Orders.CustomerID =
Customers.CustomerID ORDER BY CompanyName, OrderDate
7. Click OK to save the data source and return to the report design surface.
To add a report for the subreport
1. From the Project menu, select Add New Item.
2. In the Add New Item dialog that appears, select ActiveReports 9 Section Report (xml-based) and in
the Name field, rename the file as rptSub.
3. Click the Add button to open a new section report in the designer.
4. Right-click the PageHeader or PageFooter section and select Delete. Subreports do not render these
sections, so deleting them saves processing time.
5. Click in the grey area below the report to select it, and in the Properties window, change the report's
ShowParameterUI property to False. This prevents the subreport from requesting a parameter from the
user.
See Adding an ActiveReport to a Project for information on adding different report layouts.
To connect the subreport to a data source
Note: The following steps are just for convenience so that the fields list in the Report Explorer can be
populated at design time.
1. In the Report Data Source dialog, on the OLE DB tab, next to Connection String, click the Build button.
2. In the Data Link Properties window that appears, select Microsoft Jet 4.0 OLE DB Provider and click the
Next button to move to the Connection tab.
3. Click the ellipsis (...) button to browse to your database, for example the NWind.mdb sample database.
Click Open once you have selected the appropriate database path.
4. Click the Test Connection button to see if you have successfully connected to the database.
5. Click OK to close the Data Link Properties window and return to the Report Data Source dialog. Notice that
the Connection String field gets filled automatically.
6. In the Query field on the OLE DB tab, enter the following SQL query.
SQL Query
SELECT * FROM [order details] inner join products on [order details].productid =
products.productid
7. Click OK to save the data source and return to the report design surface.
To create a layout for the main report
1. Right-click the design surface of rptMain and select Insert then Group Header/Footer to add group
header and footer sections to the report.
2. In the Properties Window, make the following changes to the group header.
3. In the Report Explorer, expand the Fields node, then the Bound node. Drag the CompanyName field
onto ghCompanies and in the Properties window, set the properties as follows.
4. Right-click the design surface of rptMain and select Insert then Group Header/Footer to add the second
group header and footer sections to the report.
5. In the Properties Window, make the following changes to the second group header.
6. From the toolbox, drag three TextBox controls onto ghOrders and set the properties for each control as
follows.
TextBox1
TextBox2
TextBox3
7. From the toolbox, drag three Label controls onto ghOrders and set the properties for each control as
follows.
Label1
Label2
Label3
8. Select the Detail section and in the Properties window, set the CanShrink property to True.
9. From the toolbox, drag the Subreport control onto the Detail section and in the Properties window, set the
properties as follows.
3. From the toolbox, drag four label controls to ghOrderDetails and set the properties for each label as
follows.
Label2
Label3
Label4
4. From the toolbox, drag four Line controls to ghOrderDetails and set the properties for each line as
follows.
Line1
Line2
Line3
Line4
5. Click the Detail section and in the Properties window, set the following properties.
6. From the toolbox, drag four TextBox controls onto onto the Detail section and set the properties as follows.
TextBox1
TextBox2
TextBox3
TextBox4
7. From the toolbox, drag four Line controls to the Detail section and set the properties as follows.
Line5
Line6
Line7
Line8
Sub Detail1_Format
Dim rptSubCtl As GrapeCity.ActiveReports.SubReport = me.SubReport1
Dim childDataSource As New GrapeCity.ActiveReports.Data.OleDBDataSource()
childDataSource.ConnectionString = CType(rpt.DataSource,
GrapeCity.ActiveReports.Data.OleDBDataSource).ConnectionString
'Set a parameter in the SQL query
childDataSource.SQL = "Select * from [order details] inner join products on [order
details].productid = products.productid where [order details].orderid = <%OrderID%>"
'Pass the data to the subreport
rptSub.DataSource = childDataSource
'Display rptSub in the subreport control
rptSubCtl.Report = rptSub
End Sub
Parameters
This section contains the following walkthroughs that fall under the Parameter category.
Using Parameters in SubReports
This walkthrough demonstrates how to link a report with a SubReport using parameters.
Parameters for Charts
This walkthrough demonstrates how to link a report with a chart using parameters.
Note: This walkthrough uses tables from the NorthWind database. By default, in ActiveReports, the
NWind.mdb file is located in the [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data folder.
When you complete this walkthrough you get a layout that looks similar to the following:
2. In the Report Data Source dialog that appears, from the OLE DB tab, create a data source connection. See
Bind Reports to a Data Source for further details.
3. Once the connection string field is populated, in the Query field, enter the following SQL query.
SQL Query
Select * from suppliers order by country
4. Click OK to save the data source and return to the report design surface.
To connect the child report (rptChild) to a data source using parameter
1. On the detail section band, click the Data Source Icon.
2. In the Report Data Source dialog that appears, from the OLE DB tab, create a data source connection. See
Bind Reports to a Data Source for further details.
3. Once the connection string field is populated, in the Query field, enter the following parameterized SQL
query.
SQL Query
SELECT * FROM products INNER JOIN categories ON products.categoryid =
categories.categoryid WHERE Products.SupplierID = <%SupplierID%>
4. From the toolbox, drag a TextBox control onto the groupHeader section and in the Properties window, set
the properties as follows:
5. Click the Detail section to select it and go to the Properties window to set the CanShrink property to True.
6. From the Visual Studio toolbox, drag and drop the following controls onto the detail section of the
report and in the Properties window, set their properties as given below:
TextBox1
TextBox2
TextBox3
SubReport
4. From the toolbox, drag and drop a TextBox control onto the groupHeader section and in the Properties
window, set the following properties.
5. Click the Detail section to select it and go to the Properties window to set the CanShrink property to True.
6. From the toolbox, drag and drop a TextBox control onto the detail section and in the Properties window, set
the following properties.
To connect the child report (rptChild) to the SubReport control in parent report (rptParent)
1. Double-click the gray area around the parent report (rptParent) to create an event-handling method for the
ReportStart event.
2. Add code like the following to the handler to create a new instance of the child report (rptChild).
To write the code in Visual Basic
3. Double-click the detail section of the parent report (rptParent) to create a detail_Format event.
4. Add code like the following to the handler to display a report in the SubReport control.
To write the code in Visual Basic
Visual Basic.NET code. Paste INSIDE the Format event.
Me.SubReport1.Report = rpt
Note: This topic uses table from the NorthWind database. By default, in ActiveReports, the NWind.mdb file is
located in the [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data folder.
2. In the Report Data Source dialog that appears, from the OLE DB tab, create a data source connection. See
Bind Reports to a Data Source for further details.
3. Once the connection string field is populated, in the Query field, enter the following SQL query.
SQL Query
SELECT * FROM Products ORDER BY CategoryID, ProductName
4. Click OK to save the data source and return to the report design surface.
To add controls to the report to display data
1. On the design surface, right click the PageHeader or PageFooter section and select Delete to remove the
PageHeader/Footer pair.
2. Right click on the design surface and insert GroupHeader/Footer section pair.
3. Click the GroupHeader section to select it and go to the Properties window to set the following properties:
4. Set Height property of Detail section to 0.23 inches and of GroupFooter section to 0 inch.
Label2
Label3
TextBox
Chart
6. From the Visual Studio toolbox, drag and drop the following controls onto the detail section and set their
properties as given below:
TextBox1
TextBox2
Tip: If the verb is not visible, right-click an empty space in the Properties Window and select
Commands to display verbs.
2. In the Chart DataSource dialog box that appears, click the Build button.
3. In the Data Link Properties window, select Microsoft Jet 4.0 OLE DB Provider and click the Next button.
4. Click the ellipsis button (...) to browse to the NorthWind database. Click Open once you have selected the
file.
5. Click the OK button to close the window and fill in the Connection String.
6. In the Query field, enter the following parameterized SQL query.
SQL Query
SELECT * FROM Products WHERE CategoryID = <%CategoryID||1%> ORDER BY
ProductName
Note: The chart data cannot be arranged if ORDER is not set in both the SQL statements (report and
chart statement).
b. Delete text from Title property to make sure that the ProductName label (lblProductName) does not
overlap.
c. Click AxisY under the members list and set its Title property to Unit Stock.
d. With AxisY selected under the members list, expand the GridLine section under MajorTick
property tree view and set its following sub-properties.
Property Property
Name Value
Style Dot
Color Silver
Weight 1
e. Click OK to return back to ChartArea collection editor and then click OK again to return back to
report design surface.
4. With the chart control selected, go to the Properties window, click the ChartSeries (Collection)
property and then click the ellipsis button that appears.
5. In the Series Collection Editor that appears, set the following properties:
Series
a. With Series1 selected under the members list, set its following properties:
Property Property
Name Value
ValueMembersY UnitsInStock
ValueMembersX ProductName
Web
This section contains the following walkthroughs that fall under the Web category.
Document Web Service
This walkthrough describes how to set up a simple web service that returns an ActiveReports document.
Document Windows Application
This walkthrough describes how to set up a Windows client application for the ActiveReports Document Web
Service
Important: In order to consume Web services in your Windows applications, you must set permissions to
allow the ASP.NET user to consume the services. Ask your server administrator for help with this.
Note: For the information on how to connect your report to data and how to create the report layout, please see Basic Data Bound Reports for a section report.
When you have completed this walkthrough, you will have a Web Service that returns the contents of an ActiveReports as a byte array.
To create an ASP.NET Web Service project
1. From the File menu, select New Project.
2. In the New Project dialog that appears, select ASP.NET Web Service Application.
3. Change the name of the project.
4. Click OK to open the new project in Visual Studio.
To write the code to create the Web Method
1. On the Service.vb or Service.cs tab is the code view of the Service.asmx file.
2. Replace the existing WebMethod and HelloWorld function with the following code.
The following code demonstrates how you create the Web Method for a section report.
Visual Basic.NET code. REPLACE the existing WebMethod and function with this code.
<WebMethod( _Description:="Returns a products report grouped by category")> _ Public Function GetProductsReport() As Byte() Dim rpt As New rptProducts() rpt.Run() Return rpt.Document.Content End Function
C# code. REPLACE the existing WebMethod and function with this code.
[WebMethod(_Description = "Returns a products report grouped by category")]
public byte[] GetProductsReport()
{
rptProducts rpt = new rptProducts();
rpt.Run();
return rpt.Document.Content;
}
3. Select the Mark an IIS application on destination option and click the OK button.
To check the configuration in IIS
1. Open Internet Information Services Manager.
2. In the Internet Information Services Manager window that appears, expand the tree view in the left pane until you see the Web Service you had added in the steps above.
3. Right-click the Web Service select Manage Application then Browse.
4. In the browser that appears, go to the Address bar and add \Service1 to the url.
For information on consuming the Document Web Service in a viewer, see Document Windows Application.
Note: Refer to Document Web Service to set up Web service that returns an ActiveReports document.
Note: You need to update the app.config file if you added the Service Reference to the Visual Studio 2010
project in the previous section.
Common Walkthroughs
Common walkthroughs comprise of scenarios to introduce the key features of page and section reports. Learn
about different page and section report walkthroughs categorized as follows.
Professional
This section contains the walkthroughs explaining features that are part of the ActiveReports Professional Edition.
Export
This section contains the walkthrough that explains how to create a simple custom spreadsheet and save it to
an Excel file.
Web
This section contains the walkthroughs that explain how to create a simple web service for each scenario and how
to create a Windows client application for each web service.
WPF
This section contains the walkthrough that explains how to use the ActiveReports WPF Viewer in a WPF application
project.
Professional
This section contains the following walkthroughs that fall under the Professional category.
Creating a Basic End User Designer
This walkthrough demonstrates how to set up a basic end-user report designer on a Windows Forms application.
Note: See Adding ActiveReports Controls, if you need help with adding the Designer control or any other
ActiveReports controls to your Visual Studio toolbox.
4. Select arDesigner and in the Properties window go to the PropertyGrid property and select
arPropertyGrid. This attaches the Property Grid to the Designer to display properties of the selected item.
5. Select tabControl and in the Properties window, click the ellipses button in the TabPages property.
6. In the TabPage Collection Editor dialog that appears, select tabPage1 and change the Text property to
Report Explorer.
7. Select tabPage2 and change its Text property to Layer List.
panel.Join(arDesigner.CreateToolStrips(DesignerToolStrips.Layout)(0), 2)
panel.Join(arDesigner.CreateToolStrips(DesignerToolStrips.Format)(0), 2)
panel.Join(arDesigner.CreateToolStrips(DesignerToolStrips.Layout)[0], 2);
panel.Join(arDesigner.CreateToolStrips(DesignerToolStrips.Format)[0], 2);
2. Add the following code to create OnLayoutChanged function. This code creates a method that you can call
in the formDesigner_Load event. The following example shows what the code for the method looks like:
3. Go to the OnLayoutChanged function and add the following code to remove the Layer List from Section
Report and add it to the Page Report or Rdl Report. The following example shows what the code for the
method looks like:
4. Add the following code in formDesigner Load event to call the OnLayoutChanged function.
...
4. Drag the Html Input (button) control from the Visual Studio toolbox onto the .aspx design view,
containing the WebViewer control.
5. Double-click the Button control and paste the following code:
Paste the code into .aspx source
<input id="button1" type="button" value="button" onclick="return
Button1_onclick()" />
Note: You can declare a variable and attach the FlashViewer in the event handler directly.
The properties below use a pair of the getter and setter functions, which names are formed as {get|set}
<PropertyName>().
HyperLinkBackColor String. Gets or sets the background color for all hyperlinks in a document. This
value is applied only after a new document is loaded. The format is "#FF0000"
(#RRGGBB).
HyperLinkForeColor String. Gets or sets the color for all hyperlinks in a document. This value is applied
only after a new document is loaded. The format is "#FF0000" (#RRGGBB).
HyperLinkUnderline Boolean. Gets or sets a value determining whether the text of all hyperlinks in a
document is underlined. This value is applied only after a new document is loaded.
SearchResultsBackColor String. Gets or sets the background color of the highlighted text when using the
Find dialog. The format is "#FF0000" (#RRGGBB).
SearchResultsForeColor String. Gets or sets the color of the highlighted text when using the Find dialog.
The format is "#FF0000" (#RRGGBB).
PaperColor String. Gets or sets the paper color of the report. The format is "#FF0000"
(#RRGGBB).
ShowSplitter Boolean. Gets or sets a value determining whether to display a splitter. If set to
True, the splitter is shown.
TargetView String. Gets or sets a value that specifies which view - Primary or Secondary, is
currently active. If the ShowSplitter property is set to False, then you cannot
switch to the Secondary view.
ThemeUrl String. Gets or sets a value specifying the relative URL of a skin to use on the
Flash Viewer.
Zoom Integer. Gets or sets a value that specifies the zoom level at which to display the
report.
TocPanel Object. Gets the Table of Contents Panel object. This property is read-only.
Alignment To align the TOC panel.
ShowThumbnails To specify whether to display a pane with thumbnail
views of pages.
ShowToc To specify whether to display the table of contents pane.
Visible To specify whether to display the Table of contents.
Width To specify the Table of contents width.
Note: Except for the below mentioned methods, {get|set}<Property Name>() method can be used for all
the properties. See Using the Flash Viewer topic for details.
Print(PrintOptions options) Causes the Viewer to wait until all required pages are loaded, displayed in
the Print dialog and starts printing. The PrintOptions are similar to the
WebViewer.PrintOptions, except that the PageRangesCollection methods
are merged into the PrintOptions class.
CreatePrintOptions() Creates options for the Print() method.
});
});
}
</script>
...
Note: <EVENTS> are described in detail in the Available events list below.
Available events
Event Description
OnLinkClick(LinkEventArgs) Specifies the URL value of a linked item or a string.
This event is raised when a report object with a
hyperlink is clicked; this event overrides the default
Hyperlinks behavior that simply opens another
browser window. Cancelable.
The event handler receives an argument of type
LinkEventArgs containing data related to this event.
The handler argument has the field "Link". The field
"Link" returns the hyperlink URL value.
Code example
OnLinkClick: function(e)
{
OnError: function(e)
{
alert(e.Message);
//error message, string
alert(e.ErrorType);
//possible types are "Error" and
"Warning", string
return false;
}
OnLoadProgress: function(e)
{
if(e.State == "InProgress") {
if(e.PageNumber == 10)
{
alert("10
if(e.State == "Cancelled"){
alert("Report
processing is cancelled");
}
if(e.State == "Completed")//
possible value are Completed,
InProgress and Cancelled
{
alert("Report loading
is completed, total page count is" +
e.PageCount);
}
OnTargetViewChanging: function(e)
{
alert("Currently
selected view is " + e.CurrentView);
//gets currently selected view, string
alert("Newly selected
view is " + e.NewView);
//gets newly selected view, string
return false;
//cancelable event
}
OnToolClick: function(e)
Note: Use the "return true;" value to show that the client side has handled the event. The "return false;"
value indicates that the event was not handled.
2. Add the following Javascript code for document's Onload event handler and WebViewer's Loaded event
handler that gets fired when the UI is rendered on the Html Page:
Paste the code into .aspx source
<script language="javascript" type="text/javascript">
function viewer_loaded()
{
};
function document_onload()
{
};
</script>
...
<body onload="return document_onload()">
3. Add the following Javascript code inside the viewer_loaded event handler to access WebViewer's view
model:
Paste the code into .aspx source
var viewModel = GetViewModel('WebViewer1');
4. Add the following Javascript code inside the document_load event handler to bind WebViewer's Loaded
event to client side viewer_loaded event:
Paste the code into .aspx source
$('#WebViewer1').bind('loaded', viewer_loaded);
if (viewModel.PageLoaded())
{
viewModel.Export(ExportType.Pdf, function (uri)
{
window.location = uri;
}, true);
}
}
2. In the Source view of the Default.aspx file, add the following Javascript code inside <form> tag to add a
button on a custom toolbar. This button is enabled once the report is loaded and calls the exportPDF()
function at runtime:
Paste the code into .aspx source
<div id="customToolbar" style = "display:inline">
<button data-bind='enable: PageLoaded, click: exportPDF' style="
width: 105px; font-size: medium; height: 22px;">Export</button>
</div>
3. In the Source view of the Default.aspx file, add the following Javascript code inside the viewer_loaded
event handler to attach the custom toolbar with the built-in toolbar:
Paste the code into .aspx source
$('#customToolbar').appendTo(toolbar);
To bind the custom UI to the WebViewer view model and run the application
1. Add the following Javascript code inside the viewer_loaded event handler to bind the custom UI to
WebViewer view model:
Paste the code into .aspx source
ko.applyBindings(viewModel, document.getElementById("customToolbar"));
Note: Replace 'WebViewer1' in the code snippets above, with the actual ID of the WebViewer control in your
Export
This section contains the following walkthroughs that fall under the Export category.
Basic Spreadsheet with SpreadBuilder
This walkthrough demonstrates how to create a simple custom spreadsheet and save it to an Excel file.
'Header row
.Cell(0, 0).SetValue("Company Name")
.Cell(0, 0).FontBold = True
.Cell(0, 1).SetValue("Contact Name")
.Cell(0, 1).FontBold = True
.Cell(0, 2).SetValue("Phone")
.Cell(0, 2).FontBold = True
//Set up properties and values for columns, rows and cells as desired
sb.Sheets[0].Name = "Customer Call List";
sb.Sheets[0].Columns(0).Width = 2 * 1440;
sb.Sheets[0].Columns(1).Width = 1440;
sb.Sheets[0].Columns(2).Width = 1440;
sb.Sheets[0].Rows(0).Height = 1440/4;
//Header row
sb.Sheets[0].Cell(0,0).SetValue("Company Name");
sb.Sheets[0].Cell(0,0).FontBold = true;
sb.Sheets[0].Cell(0,1).SetValue("Contact Name");
sb.Sheets[0].Cell(0,1).FontBold = true;
sb.Sheets[0].Cell(0,2).SetValue("Phone");
sb.Sheets[0].Cell(0,2).FontBold = true;
Web
This section contains the following walkthroughs that fall under the Web category.
DataSet Web Service
This walkthrough describes how to set up a simple web service that returns a dataset.
DataSet Windows Application
This walkthrough describes how to set up a Windows client application for the dataset Web Service.
Important: In order to consume Web services in your Windows applications, you must set permissions to
allow the ASP.NET user to consume the services. Ask your server administrator for help with this.
Note: For the information on how to connect your report to data and how to create the report layout, please
see Single Layout Reports (for a page report) or Basic Data Bound Reports (for a section report).
Note: Get the SiteName from the Internet Information Services Manager.
3. Select the Mark an IIS application on destination option and click the OK button.
To check the configuration in IIS
1. Open Internet Information Services Manager.
2. In the Internet Information Services Manager window that appears, expand the tree view in the left
pane until you see the Web Service you had added in the steps above.
3. Right-click the Web Service select Manage Application then Browse.
4. In the browser that appears, go to the Address bar and add \Service1 to the url.
For information on consuming the DataSet Web Service in an ActiveReport, see DataSet Windows Application.
Note: For the information on how to connect your report to data and how to create the report layout, please
see Single Layout Reports (for a page report) or Basic Data Bound Reports (for a section report).
Note: You need to update the app.config file if you added the Service Reference to the Visual Studio project
in the previous section.
WPF
This section contains the following walkthroughs that fall under the WPF category.
WPF Viewer
This walkthrough explains how to use the ActiveReports WPF Viewer in a WPF application project.
WPF Viewer
The ActiveReports WPF Viewer is a custom control that allows to easily view section, RDL and page report layouts.
This walkthrough is split up into the following activities.
Creating a WPF Application project in Visual Studio
Adding the ActiveReports WPF Viewer control to the xaml page
Loading a report to the ActiveReports WPF Viewer
Previewing a report
Customizing the ActiveReports WPF Viewer
When you have completed this walkthrough, you will have the ActiveReports WPF Viewer displaying a report that looks
similar to the following.
Note: For an example of other ways to bind a report to the WPF Viewer, see the LoadDocument ('LoadDocument
Method' in the on-line documentation) method in the Class Library documentation.
Note: To avoid evaluation banners appearing at runtime, license your ActiveReports WPF Application project. You can
find information on licensing in License Your ActiveReports.
8. Press F5 to see the new customized button About Us in the Viewer toolbar.
To remove the Refresh button from the WPF Viewer toolbar
1. In Solution Explorer, double-click DefaultWpfViewerTemplates.xaml.
2. In the file that opens, search for "<!--Refresh btn-->".
3. Replace the existing content in Visiblity="..." with the following.
XML code. Add to DefaultWpfViewerTemplates.xaml
<Button Command=... Visibility="Collapsed">
Troubleshooting
If you run into an issue while using ActiveReports, you will probably find the solution within this section. Click any
short description below to drop down the symptoms, cause, and solution. Or click a link to another section of the
General Troubleshooting
References missing from Visual Studio Add Reference dialog
Symptoms: When you try to add references to your project, only a few of the ActiveReports references are available.
Cause: The project's target framework is set to an old version of the .NET framework that does not support the new
assemblies.
Solution:
1. In the Solution Explorer, right click the project and choose Properties.
2. On the Application tab in C# projects (or the Compile tab, then the Advanced Compile Options button in Visual
Basic projects), drop down the Target framework box and select .NET Framework 4.0.
Errors after installing a new build
Symptoms: When you open a project created with a previous build of ActiveReports after installing a new build, there
are errors related to being unable to find the previous build.
Cause: Visual Studio has a property on references called Specific Version. If this property is set to True, the project
looks for the specific version that you had installed when you created the report, and throws errors when it cannot
find it.
Solution: For each of the ActiveReports references in the Solution Explorer, select the reference and change the
Specific Version property to False in the Properties Window.
The project does not work if Integrated Managed Pipeline Mode is enabled
Symptoms: The web project does not work in the application pool if Integrated Managed Pipeline Mode is enabled.
Cause: The application configuration is incorrect for being used in Integrated mode.
Solution: Migrate the application configuration. Here is a sample command.
Paste the following on the command line.
"%SystemRoot%\system32\inetsrv\appcmd migrate config YourWebSite/"
(ASP.NET Web Applications) XML code. Paste inside the Web.config file
<system.web>
<trust legacyCasModel="true"/>
</system.web>
C# code.
document.Print(false, false, false);
SQL Query
<%Name | PromptString | DefaultValue | DataType | PromptUser%>
Only the Name parameter is required. To use some, but not all, of the optional parameters, use all of the separator
characters but with no text between one and the next for unused parameters. For example:
SQL Query
<%Name | | DefaultValue | |%>
SQL Query
#<%InvoiceDate | Choose invoice date: | 11/2/04 | D | True%>#
or
SQL Query
"<%Country | Country: | Germany | S | True%>"
User is prompted for parameters for subreports even though they are supplied by the main report
Symptoms: The parameter user interface pops up at run time asking for a value even though the main report is
supplying the parameter values for the subreports.
Cause: The default value of the ShowParameterUI property of the report is True.
Solution: Set the ShowParameterUI property of the report to False. This can be done in the property grid or in code
in the ReportStart event.
The viewer shows the report on the wrong paper size
Symptoms: In the viewer, the report renders to a different paper size than the one specified.
Cause: ActiveReports polls the printer driver assigned to the report to check for clipping, margins, and paper sizes
supported by the printer. If the paper size specified for the report is not supported by the printer, ActiveReports uses
the printer's default paper size to render the report.
Solution: If the report is to be printed, the printer assigned to the report must support the paper size and margins.
Please note that any changes to the print settings in code must be made in or before the ReportStart event. To use
custom paper sizes not supported by the driver, set the PrinterName to an empty string to use the ActiveReports
virtual print driver. This does not allow printing, but is recommended for reports that are only exported or viewed.
This prevents ActiveReports from making a call to the default printer driver. Use the following code in the
ReportStart event, or just before .Run is called.
C# code. Paste INSIDE the ReportStart event.
this.Document.Printer.PrinterName = '';
The PaperHeight and PaperWidth properties, which take a float value defined in inches, have no effect unless you set
the PaperKind property to Custom. Here is some sample code which can be placed in the ReportStart event, or just
before .Run.
C# code. Paste INSIDE the ReportStart event.
this.PageSettings.PaperKind = Drawing.Printing.PaperKind.Custom;
this.PageSettings.PaperHeight = 2;
//sets the height to two inches
this.PageSettings.PaperWidth = 4;
//sets the width to four inches
Memory Troubleshooting
Note: According to Microsoft it is not necessary to call GC.Collect and it should be avoided. However, if calling
GC.Collect reduces the memory leak, then this indicates that it is not a leak after all. A leak in managed code is
Symptoms: ActiveReports is consuming too much memory; CPU usage always goes to 100% when using
ActiveReports.
Cause: There are several reasons why too much memory may be consumed:
The report is not being disposed of properly
Cause: The report is not being disposed of properly. The incorrect syntax is as follows.
C# code.
//Incorrect!
rpt.Dispose();
rpt=null;
If that reclaims the memory then the Operating System trimmed the working set down to the minimum amount
necessary and this indicates that the extra memory was not actually in use.
WebViewer Troubleshooting
The WebViewer will not print without displaying the report
Symptoms: The WebViewer will not automatically print a report without displaying it.
Cause: Only the new FlashViewer ViewerType of the WebViewer offers this functionality.
Solution:
1. Set the ViewerType property to FlashViewer.
2. Expand the FlashViewerOptions property, and expand the PrintOptions subproperty.
3. Under the PrintOptions subproperty, set the StartPrint property to True.
PDF opens in a new window when an application contains the WebViewer
Symptoms: When using Internet Explorer and Acrobat Reader to view a page containing a WebViewer in PDF mode,
the resulting PDF always opens in a new window.
Cause: Acrobat Reader is only available in a 32-bit version. When the 64-bit version of Internet Explorer is used, it
opens up an instance of the 32-bit version of Internet Explorer so that the plug-in and the PDF can load, rendering the
resulting PDF in a new window.
Solution:
Install a PDF reader plug-in that is 64-bit compatible.
OR
Use the 32-bit version of Internet Explorer.
The report in the HTML viewer type does not look exactly like the other viewer types
Symptoms: The report in the HTML viewer type does not look exactly like the other viewer types.
Cause: The HTML format is not WYSIWYG. It does not support the following items:
Line control
Control borders
Shapes (other than filled rects)
CrossSectionBox and CrossSectionLine controls
Overlapping controls
Solution: Try to avoid using the above items in reports which are shown in HTML format.
Blank reports with the AcrobatReader viewer type on the production web server
Symptoms: In the WebViewer, reports render correctly with the HTML ViewerType but they show up blank with the
AcrobatReader ViewerType on the production web server.
Cause: .ArCacheItem is not set up in your IIS extension mappings.
Solution:
1. From the Start menu, choose Control Panel, then Administrative Tools, then Internet Information
Services.
2. Right-click your Default Web Site and choose Properties.
3. On the Home Directory tab, click the Configuration button.
1 Index
.NET Framework Client and Full Profile Versions, 32-33
2D Area Charts, 292-293
2D Bar Charts, 294-297
2D Financial Charts, 312-317
2D Line Charts, 303-305
2D Pie/Doughnut Charts, 306-308
2D Point/Bubble Charts, 319-322
3D Area Charts, 293-294
3D Bar Charts, 297-303
3D Effects, 325-326
3D Financial Charts, 317-319
3D Line Charts, 305-306
3D Pie Chart, 851-853
3D Pie/Doughnut Charts, 308-312
Active Reports Web Pro, 613-618
ActiveReports 9, 15
ActiveReports and the Web , 60-61
ActiveReports Designer, 87-89
ActiveReports Editions, 20-26
ActiveReports User Guide, 15
ActiveReports with MVC, 618-620
ActiveReports with MVC5 and HTML5Viewer, 632-634
Add a Cascading Parameter, 497-499
Add a Custom Tile Provider, 483-485
Add a Dataset, 445-446
Add and Save Annotations, 552-554
Add Bookmarks, 554-555 , 503-505
Add Code to Layouts Using Script, 563-567
Add Field Expressions, 533-535
Add Grouping in Section Reports, 530-531
Add Hyperlinks, 556-558 , 503
Add Items to the Document Map, 513-516
Add Page Breaks in RDL (RDL Report), 517-518
Add Page Numbering, 235-236