Professional Edition Features9
Data Dynamics Copyright Notice9
ActiveReports for .NET License Agreement and Limited Warranty10
Frequently Asked Questions11
Installation and Setup12
Changes Between ActiveReports 2.0 and ActiveReports for .NET14
Converting Microsoft Access Reports15
Migrating from ActiveReports 2.015
Architecture and Concepts15
Events16
Hyperlinks16
Layout Files17
Localization17
OutputFormat Strings17
Parameters18
Report and Page Settings19
Report Execution22
Report Structure23
Scripting23
Getting Started24
ActiveReports Designer25
Using the ActiveReports WinForm Viewer25
ActiveReports for .NET User Guide | 3
Adding a Report to Your Project26
Design Surface27
Loading an Existing Report Layout28
Report Menu28
Toolbars29
Toolbox29
Adding ActiveReports Controls to the Visual Studio Toolbox30
Adding an ActiveReport to a Visual Studio .NET Project31
Adding Field Expressions33
Binding Reports to a Data Source33
Using a Data Set33
Using a Data View34
Using the DataSource Icon34
Grouping Data35
Licensing Applications36
Localizing the Viewer Control36
Using Metric Units38
Saving and Loading RDF Files38
Saving and Loading RPX Files39
ActiveReports and the Web40
ActiveX Viewer Control40
Manually Configuring Web Samples43
Using Export Filters46
Getting Assistance47
Readme File47
Product Support48
Product Registration48
Technical Support48
Samples and Walkthroughs49
Samples49
Standard Edition Samples49
Annual Report Sample50
ActiveReports for .NET User Guide | 4
ASP.NET Standard Edition Web Sample50
Category Selection Sample51
Cross-Tab Sample51
Custom Preview Sample51
Data Reader Binding Sample51
Data View Binding Sample51
DataGrid Printing Sample52
E-mail Sample52
Hyperlinks and Drill-Down Sample52
RDF File Viewer Sample52
Report Assemblies Sample52
Unbound From Array Sample53
Unbound From Text File Sample53
XML Data Sample53
Professional Edition Samples53
ASP.NET Web Sample53
End-User Report Designer Sample53
Walkthroughs54
Standard Edition Walkthroughs54
Walkthrough: Data Bound Reports55
Walkthrough: Unbound Reports57
Grouping Data Walkthroughs61
Walkthrough: Conditional Show-Hide Detail61
Walkthrough: Group on Simple Fields64
Group on Unbound Fields66
Walkthrough: KeepTogether Options71
Page Numbering Walkthroughs73
Walkthrough: Page Numbering in the Group Header73
Walkthrough: Page Numbering in the Page Footer76
Walkthrough: Summary Fields79
Walkthrough: Calculated Fields81
Bookmarks Walkthroughs83
Walkthrough: Bookmarks with Grouping84
ActiveReports for .NET User Guide | 5
Walkthrough: Bookmarks with Simple Reports87
Walkthrough: Bookmarks with Subreports89
Walkthrough: Rich Text and Field Merging94
Master Detail Reports Walkthroughs99
Walkthrough: Master Detail Reports with Grouping100
Walkthrough: Master Detail Reports with Subreports102
Walkthrough: Master Detail Reports with XML Data105
Subreports Walkthroughs107
Walkthrough: Parameters with Subreports119
Hyperlinks Walkthroughs122
Walkthrough: Hyperlinks123
Walkthrough: Hyperlinks and Bookmarks125
Walkthrough: Hyperlinks and Simulated Drill-Down Reporting130
Walkthrough: Conditional Formatting136
Walkthrough: Using Data Sets Containing Relationships with Subreports139
Run-Time Reporting Walkthroughs144
Walkthrough: Creating and Modifying Report Layouts at Run Time144
Walkthrough: Modifying the Report Data Source at Run Time153
Walkthrough: Creating Advanced Report Layouts155
Modifying Report Documents Walkthroughs157
Walkthrough: Scaling Pages181
Walkthrough: Customizing the Viewer Control183
Walkthrough: Using ActiveX Viewer Control on the Web185
Walkthrough: Exporting Output188
Walkthrough: Saving and Loading to a Memory Stream190
Web Custom Exporting Walkthroughs193
Walkthrough: Custom Exporting with HTML193
Walkthrough: Custom Exporting with PDF199
Walkthrough: Custom Exporting with Excel202
Walkthrough: Custom Exporting with TIFF205
Walkthrough: Custom Exporting with RTF208
Custom Exporting with Plain Text210
Walkthrough: Deploying Compiled Reports213
Custom Controls and ChartFX214
Web Services Walkthroughs216
Data Set Web Service216
Data Set Windows Application217
ActiveReports Document Web Service219
ActiveReports Document Windows Application221
Localization Walkthroughs223
Localizing the Active Reports Viewer control223
Localizing the ActiveReports Designer227
Localizing the ActiveReports Engine231
Professional Edition Walkthroughs234
Creating an End-User Report Designer Walkthroughs234
Walkthrough: Creating the Basic Layout for an End-User Report Designer235
Walkthrough: Adding Code for the End-User Report Designer237
Walkthrough: Adding Code for the Main Menu239
Walkthrough: Adding Code for the Property Grid241
ActiveReports for .NET User Guide | 7
Walkthrough: Configuring the ActiveReports Toolbox242
Walkthrough: Adding Code for the ActiveReports Toolbox244
Walkthrough: Configuring the Layout Toolbar245
Walkthrough: Adding Code for the Layout Toolbar248
Walkthrough: Configuring the Report Toolbar255
Walkthrough: Adding Code for the Combo Boxes258
Walkthrough: Adding Code for the Report Toolbar263
Walkthrough: Adding a Viewer Control for the End-User Report Designer271
Walkthrough: Deploying ActiveReports Web Applications273
Configuring the HTTP Handlers274
Walkthrough: HTTP Handlers277
Walkthrough: Web Viewer Control279
ActiveReports leverages the latest technologies including XML, scripting and CSS along with open architecture
includes the same power and flexibility of ActiveReports 2.0 and provides complete integration with the Visual
ActiveReports for .NET User Guide | 8
ActiveReports for .NET User Guide
ActiveReports for .NET is a fully-integrated product which combines the features of the Visual Studio
programming languages with user-friendly controls to provide a powerful report designer.
In the ActiveReports for .NET Documentation
Introducing ActiveReports for .NET
Find out more about ActiveReports for .NET, installation and setup information and the features of the
standard and professional editions.
Getting Assistance
Find out the location of the Readme file and how to obtain product support.
Samples and Walkthroughs
Find out how to use different features of ActiveReports in the available samples and walkthroughs.
Introducing ActiveReports for .NET
to provide you with a fully-integrated and user-friendly report designer.
This topic contains information about:
ActiveReports Editions
Find out about the different features of the Standard and Professional editions.
Data Dynamics Copyright Notice
Find out about Data Dynamics copyright information.
ActiveReports License Agreement
Find out about the terms of the ActiveReports License Agreement and Limited Warranty.
Frequently Asked Questions
Find out about Frequently Asked Questions.
Installation and Setup
Learn the details of ActiveReports installation and setup.
Upgrading Reports
Find out about upgrading reports in previous versions of ActiveReports and other report programs.
Architecture and Concepts
Find out about the structure and concepts of report design.
Getting Started
Learn the basics of using ActiveReports for .NET.
ActiveReports Editions
Standard Edition Features
Find out about the features of ActiveReports for .NET Standard Edition.
Professional Edition Features
Find out about the features of ActiveReports for .NET Professional Edition.
Standard Edition Features
ActiveReports for .NET is a complete rewrite of the popular ActiveReports engine and report viewer. It
Studio .NET Environment. ActiveReports for .NET Standard Edition supports the following features:
Designer
Full integration with the .NET environment
l
includes the same power and flexibility of ActiveReports 2.0 and provides complete integration with the Visual
HTTP Handler extensions allow report files (RPX) or compiled assemblies containing reports to be dropped
ActiveReports for .NET User Guide | 9
Familiar user interface
l
Use with C# and VB.NET
l
Compilation of reports included as part of the application for speed and security or included separately
l
Designer hosting of .NET and user controls
l
Reporting Engine
Managed code
l
Binding to ADO.NET, XML and custom data sources
l
l Easy deployment with the report processing engine as a single assembly dll
All of ActiveReports 2.0 features
l
Report Viewer
Managed C# code
l
Very small deployment assembly, suitable for use on the Internet
l
Table of Contents/Bookmarks
l
Hyperlinking
l
Export Filters
ActiveReports includes export filters to generate output into Rich Text Format (RTF) for word-processing,
Portable Document Format (PDF), Microsoft Excel worksheets, HTML and DHTML for publishing your reports
to the internet, TIFF for optical archiving and faxing and delimited text for spreadsheets and databases.
Professional Edition Features
ActiveReports for .NET is a complete rewrite of the popular ActiveReports engine and report viewer. It
Studio .NET Environment. ActiveReports for .NET Professional Edition includes all of the features of the
Standard Edition and supports the following additional features:
End-User Report Designer
The control is a run-time designer that may be distributed royalty free. It allows the ActiveReports designer
to be hosted in an application and provides end-user report editing capabilities. The control's methods and
properties provide easy access to save and load report layouts, monitor and control the design environment,
and customize the look and feel to the needs of end users.
ASP.NET Integration
Web server control provides convenience for running and exporting reports in ASP.NET.
l
l
on the server and hyperlinked.
Web Viewer Control
The Web Viewer control allows quick viewing of ActiveReports on the web as well as printing capability
l
with the ActiveXViewer and AcrobatReader ViewerType properties.
HTTP Handlers
The RPX HTTP Handler allows hyperlinking of an ActiveReport on a web page to return a HTML format or
l
PDF format of the report for viewing and/or printing.
Compiled Report HTTPHandler allows hyperlinking of an ActiveReport compiled in an assembly on a web
l
page to a HTML format or PDF format of the report for viewing and/or printing.
Data Dynamics Copyright Notice
Information in this document, including URL and other Internet Web site references, is subject to change
without notice. Unless otherwise noted, the example companies, organizations, products, domain names, e-
this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form
or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without
the case of an authorized transfer, the transferee must agree to be bound by the terms and conditions of this
The product that you produce and/or distribute is NOT a software development product, a product that is sold
ActiveReports for .NET User Guide | 10
mail addresses, logos, people, places and events depicted herein are fictitious, and no association with any
real company, organization, product, domain name, e-mail address, logo, person, place or event is intended
or should be inferred. Complying with all applicable copyright laws is the responsibility of the user. No part of
the express written permission of Data Dynamics, Ltd.
ActiveReports and the ActiveReports logo are registered trademarks of Data Dynamics, Ltd.
All other trademarks are property of their respective owners.
ActiveReports for .NET License Agreement and Limited Warranty
The product in this package (libraries and object code) is proprietary to Data Dynamics, Ltd. and is protected
by Federal Copyright Law. Data Dynamics retains the title to and ownership of the Product. You are licensed
to use this Product on the following terms and conditions:
LICENSE:
The licensee is defined as the individual software developer utilizing the Product. This license is not for an
entire company but for a single developer. Data Dynamics hereby grants the licensee a nonexclusive license
authorizing the licensee to use the enclosed Product on one computer at a time for development purposes.
Distribution of the application(s) using ActiveReports is royalty-free, requiring no additional license fees. You
may incorporate the sample code into your applications. Use of this product by more than one individual or
by anyone other than the licensee terminates, without notification, this license and the right to use this
product.
YOU MAY NOT:
Distribute, rent, sub-license or otherwise make available to others the software or documentation or copies
thereof, except as expressly permitted in this License without prior written consent from Data Dynamics. In
License Agreement.
RESTRICTIONS:
You may use this Product in your business application for sale or distribution as long as:
primarily to software developers or system integrators or a development environment of any kind. Please
contact Data Dynamics, Ltd. for special commercial licensing provisions in these circumstances.
The software serial number and user must be registered with Data Dynamics in order to receive support or
distribution rights.
You may not remove any proprietary notices, labels, and trademarks on the software or documentation.
You may not modify, de-compile, disassemble, reverse engineer or translate the software.
FILES THAT MAY BE DISTRIBUTED WITH YOUR APPLICATION:
ACTIVEREPORTS.DESIGN.DLL and ACTIVEREPORTS.WEB.DLL in addition to the Standard Edition files.
US GOVERNMENT RESTRICTED RIGHTS:
Use, duplication or disclosure by the United States Government is subject to restrictions as set forth under
DFARS 252.227-7013 or in FARS 52.227-19 Commercial Computer Software - Restricted Rights.
TERM:
consequential damages, such as, but not limited to, loss of anticipated profits, benefits, use, or data resulting
only works on Web Forms, and the other is DataDynamics.ActiveReports.Viewer, which is a viewer control
ActiveReports for .NET User Guide | 11
You may terminate your License and this Agreement at anytime by destroying all copies of the Product and
Product Documentation. They will also terminate automatically if you fail to comply with any term or
condition in this Agreement.
LIMITED WARRANTY:
This software and documentation are sold "as is" without any warranty as to their performance,
merchantability or fitness for any particular purpose. The licensee assumes the entire risk as to the quality
and performance of the software. Data Dynamics warrants that the media on which the Program is furnished
will be free from any defects in materials. Exclusive remedy in the event of a defect is expressly limited to
the replacement of media. In no event shall Data Dynamics or anyone else who has been involved in the
creation, development, production, or delivery of this software be liable for any direct, incidental or
from the use of this software, or arising out of any breach of warranty.
Frequently Asked Questions
Is ActiveReports 100% managed?
ActiveReports includes the following distributable DLLs:
Managed DLLs:
ActiveReports.DLL - This is the reporting engine. Managed and written in C#.
l
ActiveReports.Design.DLL - This is the run-time end user report designer. Managed and written in C#.
l
ActiveReports.Viewer.DLL - This is the Windows Forms viewer. Managed and written in C#.
l
ActiveReports.Web.DLL - This is the Web Forms viewer and RPX handler. Managed and written in C#.
l
ActiveReports.PdfExport.DLL - This is the PDF export filter. Managed and written in C#.
l
ActiveReports.HtmlExport.DLL - This is the HTML export filter. Managed and written in C#.
l
Unmanaged DLLs:
ActiveReports.Interop.DLL - This is the auxiliary COM interop DLL. Unsafe C# code for OLE object hosting
l
and other COM functions.
ARExport*.DLL - These are the export filters. Managed wrappers around unmanaged VC++ code.
l
Note The export DLLs will be converted to managed C# after the first release. The above are the
only distributable DLLs. The core components are all managed and use all of what .NET has to
offer.
ActiveReports also includes the following non-distributable DLLs:
ARDBWizard.DLL - This is the design-time Report Wizard. Managed C#.
l
ARTaskPane.DLL - This is the design-time wizards container. Managed C#.
l
ARVSPackage.DLL - This is the VS Integration package. Unmanaged VC++ (Since integration with VS
l
requires COM, this cannot be done any other way).
Why is the viewer icon grayed out?
The icon may be grayed out for 2 reasons:
1. The control selected in the components list was for the wrong viewer control. ActiveReports has two
separate viewer controls. One is DataDynamics.ActiveReports.WebViewer, which is a viewer control that
that works only on Windows Forms.
2. The correct form is not selected. If a Windows Form or Web Form is not selected in the project, the
viewer icon may be grayed out. Verify the correct viewer component is selected for the project:
For the Windows Form Viewer - DataDynamics.ActiveReports.Viewer - ActiveReports.Viewer(x.x.x.xxxx)
For the WebForm Viewer - DataDynamics.ActiveReports.Web - ActiveReports.WebViewer(x.x.x.xxx)
The controls overlap: If the controls are overlapping each other this will prevent the controls from moving
ActiveReports for .NET User Guide | 12
Why am I getting an ambiguous reference error?
This error will occur if the report's class file has "Imports System.Windows.Form" or "using
System.Windows.Form;." The reason for the error is the Windows.Forms namespace and the ActiveReports
namespace have definitions for Textbox, Label etc. In order to prevent the error, the code will need to use
the full System.Windows.Form namespace when referencing Windows.Form objects.
Why are my empty controls not moving up?
Stacked controls will not move up under the following conditions:
1.
up when the empty controls shrink.
2. The controls are being intersected by another control: if the stacked controls have another control to the
left or right that does not line up, it will stop the controls from moving up.
The best solution is to use the Remove Vertical Spacing icon on the .NET layout toolbar. After you place the
controls on the report, leaving a little space between each control, select all of the controls in the stack and
click the icon to remove the white space between them.
How do I distribute the assemblies for ActiveReports for .NET?
There are 2 ways the ActiveReports assemblies can be deployed. Each way depends on your installation
method.
1. If you are copying your project from the development machine to your server, you should set the
ActiveReports references in your project references to CopyLocal = True. This way the ActiveReports
DLLs are in the bin folder of the compiled project.
2. If you are making an installer for your software, you will need to include the ActiveReportsDistrib.MSM
file included with the installation of ActiveReports for .NET. For example, it may be installed in the
C:\Program Files\Data Dynamics\ActiveReports for .NET\Deployment folder.
There is a third way to accomplish this which is not recommended because it is not very easy. There is a
command line utility that you can use to install each DLL in the GAC. The format is 'C:\Program
Files\Microsoft Visual Studio .NET\FrameworkSDK\Bin>gacutil -i assembly'.
Installation and Setup
This topic will help you find out what is necessary to install ActiveReports and direct you to appropriate help
for the installation process.
Requirements
Find out the hardware and software requirements to install ActiveReports for .NET.
Installed Files
Find out what files are installed with ActiveReports for .NET.
Troubleshooting Installation
Find out how to troubleshoot installation issues.
Verifying Package Installation
Find out how to verify successful installation.
Tip Close Visual Studio .NET before running the installation program to allow the help files to
be integrated into Visual Studio s common help collection.
•
Hardware and Software Requirements
This topic includes hardware and software requirements for installing and using ActiveReports for .NET.
Hardware requirements (minimum)
Processor: PC with a Pentium II-class processor 450 MHz
l
Deployment\ActiveReportsDistrib.msm
ActiveReports for .NET User Guide | 13
Operating System: Windows® 2000, Windows XP or Windows NT 4.0
l
Software requirements
Microsoft .NET framework
l
Microsoft Visual Studio .NET
l
Installed Files
Folder/FilesDescription
<Common Files>\Data Dynamics\ActiveReports for .NET
ActiveReports.DLL Run-time engine assembly file
ActiveReports.Design.DLL Designer assembly file
ActiveReports.Interop.DLL Native functions assembly file
ActiveReports.Viewer.DLL Viewer assembly file
ActiveReports.Web.DLL Web assembly file
ActiveReports.Web.Design.DLL Web designer assembly file
ARVSPackage.DLL Visual Studio .NET Integration Package
ActiveReports.HtmlExport.DLL HTML Export DLL
ActiveReports.PdfExport.DLL PDF Export DLL
ARExportTIFF.DLL TIFF Export DLL
ARExportExcel.DLL Excel Export DLL
ARExportRTF.DLL RTF Export DLL
ARExportText.DLL Text Export DLL
ARCol.Hx* ActiveReports Help Integration Collection
ddARRef.HxS ActiveReports Help File--Class Library
ddARUG.HxS ActiveReports Help File--User Guide
License.rtf
<Common Files>\Data Dynamics\ActiveReports for .NET\1033
ARVSPackageUI.DLL Visual Studio .NET integration DLL localized UI
<Common Files>\Data Dynamics\ActiveReports for .NET\Wizards
Why can't other users access or use ActiveReports on my machine?
current user. If it is installed only for the current user, other users on the same machine will not be able to
access it or use it.
I just installed ActiveReports for .NET. Why can't I see the help files?
If the installation was run while Visual Studio was open, the help files will not be integrated until the user
exits Visual Studio and reopens it.
Why do I get, "The installer was interrupted before Data Dynamics ActiveReports for .NET... could
be installed. You need to restart the installer to try again" when I run the ActiveReports Setup?
The most likely cause for this error is a permissions issue. Either the folder the setup is pointing to or the
folder containing the setup files does not have the correct permissions. The user needs to verify the system
account for the local machine has permissions to the folder containing the setup and verify the user installing
the program has the appropriate permissions.
Verifying Package Installation
To verify package installation
1. Open Visual Studio .NET.
2. You should see the ActiveReports logo on the splash screen.
3. Open Help > About Dialog
list.
Upgrading Reports
ActiveReports allows you to upgrade your reports from other versions of ActiveReports and other report
programs.
Changes Between ActiveReports 2.0 and ActiveReports for .NET
Find out about changes between ActiveReports 2.0 and ActiveReports for .NET.
Converting Microsoft Access Reports
Find out about converting Microsoft Access reports to ActiveReports.
Migrating From ActiveReports 2.0
Find out how to migrate reports from ActiveReports 2.0.
Changes Between ActiveReports 2.0 and ActiveReports for .NET
Report Classes
Data Dynamics attempted to keep to a minimum the number of changes to the report object model from
closely match the .NET Framework naming conventions. Listed below are the significant changes in the
object model.
1. ActiveReport.Show removed: ActiveReports class is no longer a Window class. This requires using the
viewer control to preview the output of a report.
and a Document class. The new Document class has all the members to save/load RDF files and streams.
ActiveReport to achieve the results you desire. To launch the upsizer, open a project in Visual Studio, click on
ActiveReports for .NET User Guide | 15
2. Strong-typed Section classes: ActiveReports for .NET includes classes for each of the section types with
their own unique properties. The old Section object is still available and the SectionCollection class holds
items of the Section type. The new section classes are Detail, GroupHeader, GroupFooter, PageHeader,
PageFooter, ReportHeader and ReportFooter.
3. New Stylesheet class: Provides access to the styles defined in the report and allows you to change the
individual style item properties.
4. Image control renamed to Picture.
5. Field control renamed to Textbox.
6. Supported justified text alignment option for textboxes and labels.
7. Indirect support of ActiveX controls through .NET wrappers and the new CustomControl class.
8. Three added data source classes which replace the data controls: OleDbDataSource, XmlDataSource and
SqlClientDataSource.
9. Split Pages collection: the Pages class from ActiveReports 2.0 is refactored into a PagesCollection class
10. Changed measurements from twips to inches.
11. Frame control has been removed.
Printing
1. Added PrintController and PrintControllerWithStatus classes to make the printing model similar to
the .NET Framework.
2. Use of the .NET Framework Printer and PrinterSettings classes by the viewer control. An optional
unsafe printer class is also included for advanced printing and print job control similar to the
ActiveReports 2.0 class.
Viewer
1. A rewritten report viewer control to take full advantage of the .NET framework classes.
2. Complete revision of the Toolbar and Tools classes.
3. Separation of the Table of Contents tree control from the TOC collection (renamed to
BookmarksCollection).
4. No binding of the viewer control to an ActiveReport object. Instead, it binds to a Document object.
Converting Microsoft Access Reports
Access reports can be easily converted to ActiveReports format by running the Access upsizer wizard. Due to
differences between products, the extent to which your reports will be converted will depend on your specific
report layout. However, since Data Dynamics provides source code, you can modify the resulting
Tools > ActiveReports Wizard, then click on Access Import. This launches the Access to ActiveReports
Wizard.
Migrating from ActiveReports 2.0
ActiveReports for .NET can use existing ActiveReports 2.0 report layout files (RPX) after some modifications
to the scripting code. ActiveReports 2.0 designer files (DSR/DSX) must be saved as RPX files in the
ActiveReports 2.0 Designer before they can be imported into ActiveReports. Since ActiveReports does not
import any Visual Basic or scripting code into .NET, the code will need to be rewritten using the appropriate
language in the new .NET environment.
Architecture and Concepts
This topic will introduce you to the basic structure and concepts of ActiveReports for .NET to enable efficient
report creation.
Events
Out of the three events, the Format event generally is used the most often, followed by the BeforePrint event
Since all controls and section growth have already taken place by the time this event fires, this event may be
Learn how events work in ActiveReports.
Hyperlinks
Learn how hyperlinks can be used in ActiveReports.
Layout Files
Learn about layout files.
OutputFormat Strings
Learn about OutputFormat strings.
Parameters
Learn how parameters function for simple reports and subreports.
Report and Page Settings
Learn how to access report and page settings in ActiveReports.
Report Execution
Learn about report execution in ActiveReports.
Report Structure
Learn about the structure of ActiveReports.
Scripting
Learn how to use scripting with ActiveReports.
Events
ActiveReports for .NET User Guide | 16
In a report, regardless of the type or content of the various sections, there are three events for each section:
Format, BeforePrint and AfterPrint.
Because there are many possible report designs, the event-firing sequence must be dynamic in order to
accommodate individual report demands.
and, in rare circumstances, the AfterPrint event.
Format event
This event fires 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 where the section's height may be changed. This section may be used to
set or change the properties of any controls or load subreport controls with subreports.
If the CanGrow or CanShrink property of any control contained with a section, or the section itself, is set to
true, all of the growing and shrinking of controls contained in this section, and the section itself, takes place
in the Format event. Because of this, information about a control or a section's height cannot be obtained in
this event.
BeforePrint event
This event fires before the section is rendered to the page.
The growing and shrinking of the section and all controls contained in a section have already taken place by
the time this event fires. Use this section to resize any controls if needed.
used to get an accurate height of the section, or, if needed, any controls contained in it. Any controls in the
BeforePrint event may be resized but not the height of the section itself.
AfterPrint event
This event fires 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. When you place code in the section events, you likely will place
your code in either the Format event or the BeforePrint event. This event is still useful for drawing on the
page after text has already been rendered to the page.
Hyperlinks
ActiveReports for .NET User Guide | 17
ActiveReports for .NET allows you to add hyperlinks to reports to perform a variety of functions. The
hyperlink property can be set to any HTML-style link, items in the Bookmarks collection (TOC) or used to
simulate drill-down reporting. By using the Hyperlink property, reports can have "clickable" controls which
can be used for many purposes, including the ability to run and display other reports.
Layout Files
Report layouts in ActiveReports are automatically saved as RPX files. This is an XML-formatted file which
contains the layout information and can contain the scripts of the report. RPX files using scripting allow
distributed reports to be changed and modified without having to recompile the project. They also make it
possible to use a database of report file names to set up a collection of reports to run. An RPX file using
scripting also can be used as a stand-alone file in a web project or a stand -alone file for the HTTP handler.
Localization
The .NET Framework has made it easy for developers to localize their applications and controls. The
ActiveReports for .NET Viewer Control uses the Hub and Spoke model for localizing resources. The hub is the
main executing assembly. In our case it's the application that hosts the Viewer Control. The spokes are
satellite dlls that contain localized resources for the application.
The satellite dlls are place in subdirectories under the main executing assembly. When the main executing
assembly needs a resource, a ResourceManager object is used to load the required resource. The
ResourceManager uses the thread's CurrentUICulture Property. This property is set by the common language
runtime or it can be set in your code to force a certain UI Culture.
Forcing a certain locale is helpful when you want to test if your satellite dll is loading properly. The
ResourceManager class uses the CurrentUICulture Property to locate subdirectories that should contain a
satellite dll for the current culture. If no subdirectory exists the ResourceManager will use the resource that
was embedded in the assembly.
The Viewer Control is built using the default culture of US English. This is the fallback culture for the Viewer
Control. For more detailed information about how the framework locates satellite dlls, please reference the
help system in Visual Studio .NET or the book Developing International Software, 2nd edition by MS Press
that contains information on localizing applications using the .NET Framework.
OutputFormat Strings
ActiveReports allows you to set formatting strings for date, time, currency, and other numeric values using
the OutputFormat property on the textbox control. The OutputFormat dialog also allows you to
select international currency values and select from various built-in string expressions.
Times:
l hh:mm tt = 09:00 AM
HH:mm = 21:00 (twenty-four hour clock)
l
HH = hours in 24 hour clock
l
hh = hours in 12 hour clock
l
mm = minutes
l
ss = seconds
l
tt = AM or PM
l
Dates:
dddd, MMMM d, yyyy = Saturday, December 25, 1999
l
dd/MM/yyyy = 25/12/1999
l
d or dd = day in number format
l
l ddd = day in short string format (Ex. Sat for Saturday)
dddd = day in string format (Ex. Saturday)
l
ActiveReports for .NET User Guide | 18
MM = month in number format
l
MMM = month in short string format (Ex. Dec for December)
l
MMMM = month in string format (Ex. December)
l
y or yy = year in two digit format (Ex. 99 for 1999)
l
yyy or yyy = year in four digit format (Ex. 1999)
l
Currency and numbers:
$00.00 = $25.50
l
$#,##0.00 = $06.25
l
0 = digit or zero
l
# = digit or nothing
l
% = percent-multiplies the string expression by 100
l
Parameters
Parameters and Simple Reports
The Parameters dialog can be used to prompt the user for input when reports are generated. If you add <%
FieldName | PromptString | DefaultValue | Type%> to the report s SQL string, it will cause the Parameters
dialog to be displayed.
The Field name is the name of the field you wish to request (e.g. CustomerID or LastName). The Prompt
string is a string value indicating text that will appear in the dialog next to the control (e.g. Enter
Customer ID: ). Setting the default value will automatically set a default value. For example, if you have a
report that generates based on a date, you can have the default for the field set to the current date so users
can just hit "Enter", unless they want to generate a report based on a new date. Type indicates what type of
data will be requested.
The values can be: nothing(string), S for string, D for date, B for Boolean. A string type will give a textbox
for input, a D type will give a calendar drop-down control for input and a B type will give a checkbox for
input.
Note For Strings: If you specify a default value that is enclosed in single or double quotes, it will
be recognized and will output the same quotes to SQL when replacing. For Booleans : if you
specify true/false for DefaultValue it will generate true/false for SQL output. If you specify 0,1, it
will output 0 or 1.
Example: "SELECT * FROM products INNER JOIN categories ON products.categoryid = categories.categoryid
WHERE products.supplierID =<%SupplierID|Enter supplierID|1000%> and OrderDate=#<%Date|Order
date:|1/1/2001|D%># and Discount='<%bool| Is this checked ?|true|B%>'"
•
Note The FieldName is the only required parameter; the rest are optional.
Stored procedures can be used the same way as parameters in ActiveReports. The Sql statement would need
to have the stored procedure call and placeholders for the parameters: "CustOrderHist '<%ID|Enter
Customer ID:|AFLKI%>'". ActiveReports will then replace the parameter text "<%...%>" with whatever the
user types into the dialog to create a call like this: CustOrderHist 'AFLKI'.
ActiveReports for .NET User Guide | 19
Parameters and Subreports
Parameters can be used with subreports to connect the subreport to the parent report. By setting a
parameter for the field that links the parent report to the child subreport, the parent report can pass the
information to the child through the parameters. The main differences when working with subreports and
parameters are:
The subreport s ShowParametersUI should be set to False.
l
The subreport s SQL query should be set to use the parameter syntax = <%fieldname%>.
l
Note Both report queries must contain the same field (so the main report must have a
categoryID field and the subreport also must have a categoryID field.
•
•
Report and Page Settings
The Page (Report) Setup Dialog
With ActiveReports, page setup in your report can be modified at design time, as well as at run time. The
Page Setup dialog can be accessed by selecting Report > Settings... from the toolbar menu.
From the Page Setup dialog, changes can be made to the report margins (left, right, top and bottom), a
ActiveReports for .NET User Guide | 20
gutter can be specified and the Mirror margins option can be selected.
By setting a gutter and selecting Mirror margins, reports can be set up easily for publishing purposes. When
Mirror margins is selected, the inner margins in the report are set for opposite pages to be the same width
and the outside margins for opposite pages to be the same width. Specifying a gutter gives extra space
between the edge of the page and the margins. This allows reports to be bound together.
The Printer Settings Dialog
With ActiveReports, printer settings can be modified at design time, as well as run time. The Print Settings
dialog (shown below) can be accessed by selecting Report > Settings... from the toolbar menu and then
selecting the Printer Settings option button from the Report Settings dialog box.
From the Printer Settings dialog, changes can be made to the printer paper size and orientation. A custom
paper size can be set by selecting Custom paper size from the Paper size drop down box. Once this
option has been selected, the width and height options will allow a specific height and width to be set.
The Printer Settings dialog also lets the user choose the type of collation to use, whether or not the report
should be duplexed and the location of the paper source.
The Styles Dialog
With ActiveReports, style sheet settings can be created and/or applied. The Styles dialog (shown below) can
be accessed by selecting Report > Settings... from the toolbar menu and then selecting the Styles option
button from the Report Settings dialog box.
ActiveReports for .NET User Guide | 21
From the Styles dialog, changes can be made to the appearance of text associated with controls, either by
applying an existing style sheet, creating and applying a new style sheet or by modifying and applying an
existing style.
The Global Settings Dialog
With ActiveReports, global report settings can be modified at design time. The Global Settings dialog (shown
below) can be accessed by selecting Report > Settings... from the toolbar menu and then selecting the
Global Settings option button from the Report Settings dialog box.
properties might cause DataInitialize to fire. The report validates any changes made to the report structure in
threaded,
The KeepTogether property determines whether a section should print in its entirety on the same page. When
ActiveReports for .NET User Guide | 22
From the Global Settings dialog, changes can be made to the design surface, including showing or hiding the
grid, setting the controls to align to the grid, setting the number of column or rows on the grid and changing
the ruler units to inches or centimeters.
Report Execution
ActiveReports report execution begins by raising the ReportStart event. At this point, accessing data source
ReportStart.
Printer settings are applied next.
If DataInitialize is not fired during the ReportStart event, it will be fired. The data source will be opened. If
there are any parameters in the data source with unset values and "ShowParameterUI" is set to True,
ActiveReports displays a parameters dialog and fires "ParameterUIClosed" when the dialog is closed. If the
report is a subreport and requires parameters, ActiveReports binds the subreport parameters to any fields in
the parent report.
Next, the FetchData event fires. If there is no data, the NoData event is raised.
Group sections are bound and sections begin rendering on pages.
Events are then fired for processing the report header, followed by page header, groups, detail and page
footer for each page in the report. The cancel flag is checked after each event.
The speed in processing and output generation of ActiveReports is attributed to its intelligent, multi-
single-pass processing. ActiveReports will process and render each page as soon as the page is ready. If
ActiveReports is not able to fully render a page because of unknown data elements or because the layout is
not final, it places the page in cache until the data is available.
Summary fields and KeepTogether constraints are two reasons that a page might not be rendered
completely. 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 will be delayed until all of the data is read.
this property is set to True, the section will print on the same page without any page breaks. A False setting
block on the same page. The property defaults to None which allows the group block to be split across pages.
at run time.
ActiveReports for .NET User Guide | 23
allows the section to be split across two or more pages. If the KeepTogether property is set to True, but the
section is too large for the current page, or to fit fully on the next page, the KeepTogether property will be
ignored.
The GroupKeepTogether property determines whether group header and footer sections will print as a single
When you set this property to All, ActiveReports attempts to print the complete block on the same page
without any page breaks. When a complete block does not fit on a single page, it will be split across two or
more pages. The third option, FirstDetail, prevents any widowed group header sections. The group header
will always print with at least one Detail section.
Report Structure
A report section contains a group of controls that are processed and printed at the same time as a single
unit. ActiveReports defines the following section types:
Report Header
A report can have one report header section that prints at the beginning of the report. This section generally
is used to print a report title, a summary table, a chart or any information that needs only to appear once at
the report's start.
Report Footer
A report can have one report footer section that prints at the end of the report. This section is used to print a
summary of the report, grand totals or any information that needs to print once at the report's end.
Page Header
A report can have one page header section that prints at the top of each page. It is the first section that
prints on the page except when the page contains a report header section. The page header section is used
to print column headers, page numbers, a page title or any information that needs to appear at the top of
each page in the report.
Note It is not recommended to bind controls to a page header as results may be unpredictable.
Page Footer
A report can have one page footer section that prints at the bottom of each page. It is used to print page
totals, page numbers or any other information that needs to appear at the bottom of each page.
Group Header/Footer
A report can consist of single or multiple nested groups, with each group having its own header and footer
sections. The header section is inserted and printed immediately before the Detail section. The footer section
is inserted and printed immediately after the Detail section.
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.
Scripting
ActiveReports allows you to use scripting to provide ease in reporting functionality. Scripting permits reports
saved to an RPX file to contain code. This characteristic allows the options of stand-alone reporting and web
reporting without requiring .vb or .cs files. By including scripting when the report is saved as an RPX file, it
can later by loaded, run and displayed directly to the viewer control without using the designer. Scripting can
also be used in conjunction with RPX files to allow distributed reports to be updated without recompiling.
Scripting can be used by adding C# code to the script editor at design time or by using rpt.Script
The script is then saved to the RPX file.
ActiveReports for .NET User Guide | 24
The AddNamedItem and AddCode methods are used to add items to the report s script. By using
AddNamedItem or AddCode , code elements from inside the .NET project can be used inside the scripts. By
using AddNamedItem, scripts can become aware of functions in a class contained in the .NET project. By
using AddCode, actual code segments can be added to the script at run time. Since the RPX file can be read
with any text editor, AddCode or AddNamedItem can be used to add secure information to a project, such as
a connection string.
AddScriptReference can be used to add an assembly reference to the script. This will allow users to add a
reference in the script to access assemblies in their projects. AddScriptReference is only needed if the script
accesses assemblies that are not already initialized in the project. For example, to access
"System.Data.DataSet" inside the script, you would need to add a reference by calling
"rpt.AddScriptReference("System.Data.Dll")".
Scripting Concepts to Remember:
Controls referenced inside the script must be public
l
If the RPX file does not have an associated codebehind file, you will need to refer to the controls and
l
sections by calling "rpt.Sections[<sectionname>]" or "rpt.Sections[<sectionname>].Controls
[<controlname>]"
The report instance is referred to in the report as "rpt." This is similar to "me" and "this" in the
l
codebehind files. You must use "rpt" to gain access to the report and its controls
The report class has to be public for scripting to access public methods and/or functions (this is done by
l
default)
•
Getting Started
This topic will show you how to begin using ActiveReports by explaining different aspects of ActiveReports
and showing you how to include it in your Visual Studio .NET IDE (Integrated Development Environment).
ActiveReports Designer
Learn how to use the ActiveReports designer.
Adding ActiveReports Controls to the Visual Studio Toolbox
Learn how to add ActiveReports controls to the toolbox in Visual Studio.
Adding an ActiveReport to a Visual Studio .NET Project
Learn how to add an ActiveReport to a Visual Studio project.
Adding Field Expressions
Learn how to add field expressions to a text box data field.
Binding Reports to a Data Source
Learn how to bind reports to various data sources.
Grouping Data
Learn how to use the GroupHeader to group data in a report.
Licensing Applications
Learn how to license your ActiveReports Applications.
Localizing the Viewer Control
Learn how to localize settings for the ActiveReports Viewer control.
Metric Units
ActiveReports for .NET User Guide | 25
Learn how to use metric units with ActiveReports for .NET.
Saving and Loading RDF Files
Learn how to save and load reports as RDF files at run time.
Saving and Loading RPX Files
Learn how to save and load reports as RPX files at run time.
ActiveReports and the Web
Learn about using ActiveReports with the Web.
Using Export Filters
Learn about using the ActiveReports export filters.
Related Sections
Samples
ActiveReports includes many samples which demonstrate applications the developers created for
ActiveReports. These samples show the use of a combination of controls and code to produce various
reports.
Walkthroughs
Learn how to create various types of applications in C# and Visual Basic .NET--one step at a time.
Technical Support
Technical support is available for ActiveReports for .NET in a variety of media.
ActiveReports Designer
With its various tools and qualities, ActiveReports for .NET offers great flexibility in constructing report
projects. In this section, you will learn how to use the different features of the ActiveReports Designer.
ActiveReports WinForm Viewer
Learn how to use the WinForm Viewer to preview a report.
Adding a Report to your Project
Learn how to add a report to a new or existing .NET project.
Design Surface
Learn more about the features of the design surface.
Loading an Existing Report Layout
Learn how to load an existing report layout at design time in ActiveReports.
Report Menu
Learn about the different aspects of the report menu.
Toolbars
Learn how to use the ActiveReports toolbars.
Toolbox
Learn about the functions of the controls on the ActiveReports toolbox.
Using the ActiveReports WinForm Viewer
To use the ActiveReports WinForm Viewer to preview report output
1. Add an ActiveReport to your Visual Studio project and rename it rptMain.
2. Add a new "Windows Form" to your project.
3. Click on the ActiveReports viewer control in the appropriate toolbox and drag it onto Form1.
4. Set the viewer control's Dock property to Fill.
To write the code for the viewer in Visual Basic
Right-click on Form1, and click on View Code to display the code view for the form. At the top left of the
l
code view for Form1, click the drop-down arrow and select (Base Class Events). At the top right of the
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
ActiveReports for .NET User Guide | 26
code window, click the drop-down arrow and select Load. This creates an event-handling method for the
Form1_Load event. Add code to the handler to:
Format the viewer to show the report when it is run
l
To write the code for the viewer in C#
Click on the blue section at the top of Form1 to select the form. Click on the events icon in the
l
Properties window to display available events for Form1. Double-click Load . This creates an event-
handling method for the Form1_Load event. Add code to the handler to:
Format the viewer to show the report when it is run
l
The following example shows what the code for the method looks like:
[Visual Basic]
Dim rpt As New rptMain()
Viewer1.Document = rpt.Document
rpt.Run()
End Sub
The ActiveReports design surface leverages your current knowledge of Visual Studio .NET's designer interface
ActiveReports for .NET User Guide | 27
4. Click Open to add the report to your project.
Design Surface
and provides full integration within the Visual Studio environment.
To access the ActiveReports design surface
This section can be used to print column headers, page numbers, page titles, or any
This control can be used to connect the report's data source settings to an existing data
This section can be used to print page totals, page numbers or any other information
ActiveReports for .NET User Guide | 28
1. Open a Visual Studio project.
2. Add an ActiveReport to your project.
3. Once the report is added, you will see the report design surface.
The default ActiveReports design surface is made up of the following base components:
PageHeader section--
l
information that needs to be printed once at the top of each page.
Detail section--This section is the body of the report that prints once for each record in the data source.
l
DataSource icon--
l
source
PageFooter section--
l
that needs to be printed once at the bottom of each page.
Loading an Existing Report Layout
To load an existing Report Layout
1. Open a Visual Studio project.
2. Click on File > Open > File...
3. Select the RPX report layout from from the appropriate location.
4. Click Open to load the report layout.
-or-
5. While in an ActiveReport, click Report > Load Layout.
6. Select the RPX file from the appropriate location.
7. Click Open to load the selected report layout.
Report Menu
The report menu allows access to load report layouts, modify the report data source or modify report
settings.
To access the report menu
1. Open a new or existing ActiveReport.
2. Click on any section in the report to select it.
3. Click on Report from the main toolbar.
The Report Menu allows the following options:
Load Layout
l
The Load Layout option allows access to load an existing report layout into the open ActiveReport.
Data Source
l
The Data Source option allows access to add Data Source parameters or modify existing Data Source
settings.
The toolbars in ActiveReports can be easily customized. ActiveReports' toolbars allow developers to rearrange
ActiveReports for .NET User Guide | 29
Settings
l
The Settings option allows access to change printer or page settings, stylesheets or global settings.
Toolbars
buttons and menu options, as well as hide, display, dock or float toolbars.
To access a toolbar's context menu
Right-click anywhere in the toolbar area
l
The context menu allows you to show or hide toolbars by selecting the toolbar name from the menu. In
addition, you can customize the toolbars or create a new toolbar from the customize option on the menu.
The ActiveReports toolbar is made up of the following components:
Report Explorer--Shows or hides the report explorer tree and the fields list
l
Style Sheets--Sets the style sheet for a control
l
Font--Sets the typeface of the selected label, checkbox or textbox control
l
Size--Sets the font size of the selected label, checkbox or textbox control
l
View Grid--Turns the grid display on or off
l
Reorder Groups--Displays the groups order dialog
l
Edit Script--Starts ActiveReports Script Editor
l
Bold--Sets the bold typeface on or off
l
Italic--Sets the italic typeface on or off
l
Underline--Sets the underline typeface on or off
l
Align Left--Aligns the text left in the control area
l
Align Center--Aligns the text centered in the control area
l
Align Right--Aligns the text right in the control area
l
Justify--Justifies the text in the control area
l
Bullets--Adds bullets to the text in the RichText control area
l
Decrease Indent--Decreases the indent of the text in the RichText control area
l
Increase Indent--Increases the indent of the text in the RichText control area
l
Toolbox
The ActiveReports toolbox displays a variety of controls available for use in ActiveReports. The items
available from the toolbox change depending on the designer currently in use.
ActiveReports for .NET User Guide | 30
To access the ActiveReports toolbox
1. Open a Visual Studio project.
2. Add an ActiveReport to the project.
3. Click on View > Toolbox.
4. Click on the ActiveReports tab.
The ActiveReports toolbox is made up of the following components:
Pointer--Allows you to select controls or sections of the report
l
Label--Allows you to insert a new static label control
l
Textbox--Allows you to insert a textbox, bound to a database field or unbound
l
Checkbox--Allows you to insert a checkbox, bound to a database field or unbound
l
Picture--Allows you to insert an image, loaded from a file
l
Line--Allows you to insert a line control
l
Shape--Allows you to insert a rectangle, circle or square shape
l
RichText--Allows you to insert an ActiveReports RichText control
l
Subreport--Allows you to insert a Subreport control to link to another report
l
l PageBreak--Allows you to insert a page break within a selection
Barcode--Allows you to insert an ActiveReports Barcode control
l
Ole object--Allows you to insert an OLE object, bound to a database field, or unbound
l
WebViewer--Allows you to insert a control to view an ActiveReport on the web
l
Viewer--Allows you to insert an ActiveReports Viewer control
l
Designer--Allows you to insert an ActiveReports Designer control
l
ReportExplorer--Allows you to insert an ActiveReports ReportExplorer control
l
Adding ActiveReports Controls to the Visual Studio Toolbox
Loading...
+ 251 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.