Welcome to ComponentOne Reports for .NET

Untitled Document ComponentOne Reports for .NET Untitled Document E-mail sent to documentation@componentone.com is for documentation feedback only. We welcome any suggestions to help improve our documentation.

Welcome to ComponentOne Reports for .NET

Reports for .NET enables you to visualize the data in your applications in the form of rich, presentation-quality reports that can be previewed on your computer or published on the Web. Reports for .NET includes two main elements: the C1Report component and the C1Report Designer application.

The C1Report component generates Access-style, data-based banded reports that can be rendered directly to a printer, exported to various portable formats (including HTML, PDF, and text), or rendered into preview controls such as the Microsoft PrintPreview control or the ComponentOne C1PrintPreview control.

The C1Report Designer allows you to create and edit reports, or to import existing Microsoft Access reports. The Designer has a user interface that is similar to the one in Microsoft Access, so if you currently use VSView or Access, you will feel right at home with Reports for .NET.

ComponentOne has a user-friendly distribution policy. We want every programmer to obtain a copy of Reports for .NET to try for as long as they wish. Those who like the product and find it useful may buy a license for a reasonable price. The only restriction is that unlicensed copies of Reports for .NET will display a ComponentOne banner every time they are loaded to remind developers to license the product.

We are confident that you'll like ComponentOne Reports for .NET. If you have any suggestions or ideas for new features that you'd like to see included in a future version, or ideas about new components, please call us or write:

Corporate Headquarters

ComponentOne LLC
201 South Highland Avenue
3rd Floor
Pittsburgh, PA 15206 • USA
412.681.4343
412.681.4384 (Fax)

http://www.componentone.com

What's New in ComponentOne Reports for .NET

Installing Reports for .NET

END-USER LICENSE AGREEMENT FOR COMPONENTONE SOFTWARE

Licensing FAQs

Technical Support

Redistributable Files

Upgrading from VSReport 8.0

Namespaces

Creating a .NET Project

Adding the C1Report Component to the Toolbox

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


What's New in ComponentOne Reports for .NET

What's New in ComponentOne Reports for .NET

This documentation was last revised on July 19, 2005.

Overview of What's New in ComponentOne Reports for .NET

New properties and features have been added to Reports for .NET that allows the user more flexibility, such as improved support for images in RTF export and improved thead safety.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Feature Overview

Feature Overview

Reports for .NET now has improved support for images in RTF export, which no longer relies on Clipboard and runs under ASP.NET (updated July 14, 2005). Reports for .NET also has improved thead safety and honors the TextDirection property in Barcode fields (updated June 5, 2005). Additionally, ICustomTypeDescriptor support was added to custom field editors (updated April 12, 2005).

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Class Members

Class Members

Below are the most recent properties and settings added to the C1Report component (the additions were updated on February 18, 2005):

Member | Description
GrowShrinkMode Property (C1Report class) | Returns or sets the logic for handling CanGrow/CanShrink fields.
PictureScale Property (Field class) | Returns or sets the picture scaling (see also the Picture and PictureAlign properties).
PictureScale Property (Layout class) | Returns or sets how the background picture is scaled.
MultiFile Property (HtmlFilter class) | Gets or sets whether the built-in HTML filter should break paged reports into multiple HTML files (one per page).
Ean8 Enumeration Setting (BarCodeEnum Enumeration) | EAN-8 barcode. EAN-8 encodes 7-digit article codes (plus one check digit created by the control).
Ean13 Enumeration Setting (BarCodeEnum Enumeration) | EAN-13 barcode. EAN-13 encodes 12-digit article codes (plus one check digit created by the control).
RtfLabels Enumeration Setting (FileFormatEnum Enumeration) | Creates RTF reports with absolutely-positioned fields. This format renders reports more accurately than the plain RTF format, and is recommended for creating label-style reports. However, note that the RtfLabels format is harder to edit than the plan RTF format and can only be previewed/printed by MS Word (it doesn't work with WordPad).

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Installing Reports for .NET

Installing Reports for .NET

This section describes the setup files and system requirements for Reports for .NET. It also explains how to install demonstration versions of ComponentOne products and uninstall Reports for .NET.

Reports for .NET Setup Files

System Requirements

Installing Demonstration Versions

Uninstalling Reports for .NET

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Reports for .NET Setup Files

Reports for .NET Setup Files

The installation program will create the directory C:\Program Files\ComponentOne Studio.NET, which contains the following subdirectories:

bin | Contains copies of all binaries (DLLs, EXEs) in the ComponentOne Visual Studio.NET package.
Common | Contains support and data files that are used by many of the demo programs.
Help | Contains online documentation for all Studio components.
C1Report | Contains samples and tutorials for the C1Report component.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


System Requirements

System Requirements

· Operating Systems:

Windows 2000

Windows 2003 Server

Windows NT 4

Windows XP, SP1, SP2

· Environments:

.NET Framework 1.0

.NET Framework1.1

C# .NET

Delphi

Visual Basic .NET

· Hard Disk Space: 31 MB

· Disc Drive: CD or DVD-ROM drive if installing from CD

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Installing Demonstration Versions

Installing Demonstration Versions

If you wish to try Reports for .NET or any of our other products and do not have a registration key, follow the steps through the installation wizard, and use the default serial number.

The only difference between unregistered (demonstration) and registered (purchased) versions of our products is that registered versions will stamp every application you compile so a ComponentOne banner will not appear when your users run the applications.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Uninstalling Reports for .NET

Uninstalling Reports for .NET

To uninstall Reports for .NET, open the Control Panel and select the Add or Remove Programs. Select Reports for .NET and click the Remove button.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


END-USER LICENSE AGREEMENT FOR COMPONENTONE SOFTWARE

END-USER LICENSE AGREEMENT FOR COMPONENTONE SOFTWARE

IMPORTANT-READ CAREFULLY: This End User License Agreement (this "EULA") contains the terms and conditions regarding your use of the SOFTWARE (as defined below). This EULA contains material limitations to your rights in that regard. You should read this EULA carefully and treat it as valuable property.

I. THIS EULA.

1. Software Covered by this EULA. This EULA governs your use of the ComponentOne, LLC ("C1") software product(s) enclosed or otherwise accompanied herewith (individually and collectively, the "SOFTWARE"). The term "SOFTWARE" includes, to the extent provided by C1: 1) any revisions, updates and/or upgrades thereto; 2) any data, image or executable files, databases, data engines, computer software, or similar items customarily used or distributed with computer software products; 3) anything in any form whatsoever intended to be used with or in conjunction with the SOFTWARE; and 4) any associated media, documentation (including physical, electronic and on-line) and printed materials (the "Documentation").

2. This EULA is a Legally Binding Agreement Between You and C1. If you are acting as an agent of a company or another legal person, such as an officer or other employee acting for your employer, then "you" and "your" mean your principal, the entity or other legal person for whom you are acting. However, importantly, even if you are acting as an agent for another, you may still be personally liable for violation of federal and State laws, such as copyright infringement.

This EULA is a legally binding agreement between you and C1. You intend to be legally bound to this EULA to the same extent as if C1 and you physically signed this EULA. By installing, copying, or otherwise using the SOFTWARE, you agree to be bound by the terms and conditions contained in this EULA. If you do not agree to all of the terms and conditions contained in this EULA, you may not install or use the SOFTWARE. If, for whatever reason, installation has begun or has been completed, you should cancel installation or un-install the SOFTWARE, as the case may be. (You may click on the "exit" button or its equivalent to immediately abort installation.) If you do not agree to all of these terms and conditions, then you must promptly return the SOFTWARE to the place of business from which you obtained it in accordance with any return policies of such place of business. Return policies may vary between or among resellers, and you must comply with your particular reseller's return policies as agreed at the point of purchase. If the place of business from which you purchased the SOFTWARE does not honor a complete refund for a period of thirty (30) days from the date of proof of purchase, then you may return the SOFTWARE directly to C1 for a period of thirty (30) days from the date of your purchase. To return the product directly to C1, you must obtain a C1 Return Authorization Number by contacting C1, and you must forward all items purchased, including the proof of purchase, directly to C1. The return must be postage-prepaid, and post-marked within thirty (30) days from the proof of purchase, time being of the essence. The return option to C1 is only available to the original purchaser of an unopened factory packaged item.

II. YOUR LICENSE TO DEVELOP AND TO DISTRIBUTE.

As provided in more detail below, this EULA grants you two licenses: 1) a license to use the SOFTWARE to develop other software products (the "Development License"); and 2) a license to use and/or distribute the Developed Software (the "Distribution License"). Both of these licenses (individually and collectively, the "Licenses") are explained and defined in more detail below.

1. Definitions. The following terms have the respective meanings as used in this EULA:

"Network Server" means a computer with one or more computer central processing units (CPU's) that operates for the purpose of serving other computers logically or physically connected to it, including, but not limited to, other computers connected to it on an internal network, intranet or the Internet. "Web Server" means a type of Network Server that serves other computers more particularly connected to it over an intranet or the Internet.

"Developed Software" means those computer software products that are developed by or through the use of the SOFTWARE. "Developed Web Server Software" means those Developed Software products that reside logically or physically on at least one Web Server and are operated (meaning the computer software instruction set is carried out) by the Web Server's central processing unit(s) (CPU). "Developed Legacy Software" means those Developed Software products that are not Developed Web Server Software, including, for example, stand-alone applications and applications accessed by a file server only. "Redistributable Files" means the SOFTWARE files or other portions of the SOFTWARE that are provided by C1 and are identified as such in the Documentation for distribution by you with the Developed Software. "Developer" means a human being or any other automated device using the SOFTWARE in accordance with the terms and conditions of this EULA.

"Developer Seat License" means that each Developer using or otherwise accessing the programmatic interface or the SOFTWARE must obtain the right to do so by purchasing a separate End User License.

“Source Code” shall mean computer software code or programs in human readable format, such as a printed listing of such a program written in a high-level computer language. The term "Source Code" includes, but is not limited to, documents and materials in support of the development effort of the SOFTWARE, such as flow charts, pseudo code and program notes.

2. Your Development License. You are hereby granted a limited, royalty-free, non-exclusive right to use the SOFTWARE to design, develop, and test Developed Software, on the express condition that, and only for so long as, you fully comply with all terms and conditions of this EULA.

The SOFTWARE is licensed to you on a Developer Seat License basis.

The Developer Seat License means that you may perform an installation of the SOFTWARE for use in designing, testing and creating Developed Software by a single Developer on one or more computers, each with a single set of input devices, so long as such computer/computers is/are used only by one single Developer at any given time and not concurrently. Conversely, you may not install or use the SOFTWARE on a computer that is a network server or a computer at which the SOFTWARE is used by more than one Developer. You may not network the SOFTWARE or any component part of it, where it is or may be used by more than one Developer unless you purchase an additional Development License for each Developer. You must purchase another separate license to the SOFTWARE in order to add additional developer seats, whether the additional developers are accessing the SOFTWARE in a stand-alone environment or on a computer network.

In all cases, you may not use C1's name, logo, or trademarks to market your Developed Software without the express written consent of C1; (b) you must include the following C1 copyright notice in your Developed Software documentation and/or in the "About Box" of your Developed Software, and wherever the copyright/rights notice is located in the Developed Software (“Portions Copyright © ComponentOne, LLC 1991-2002. All Rights Reserved.”); (c) agree to indemnify, hold harmless, and defend C1, its suppliers and resellers, from and against any claims or lawsuits, including attorney's fees that may arise from the use or distribution of your Developed Software; (d) you may use the SOFTWARE only to create Developed Software that is significantly different than the SOFTWARE.

3. Your Distribution License.

License to Distribute Developed Software. Subject to the terms and conditions in this EULA, you are granted the license to use and to distribute Developed Software on a royalty-free basis, provided that the Developed Software incorporates the SOFTWARE as an integral part of the Developed Software in machine-language compiled format (customarily an ".exe", or ".dll", etc.). You may not distribute, bundle, wrap or subclass the SOFTWARE as Developed Software which, when used in a "designtime" development environment, exposes the programmatic interface of the SOFTWARE. You may distribute, on a royalty-free basis, Redistributable Files with Developed Software only.

4. Specific Product Limitations. Notwithstanding anything in this EULA to the contrary, if the license you have purchased is for any of the following products, then the following additional limitations will apply:

a. ComponentOne Reports for .NET Designer Edition. ComponentOne Reports for .NET Designer Edition includes at least: 1) one dynamic link library (c1.win.c1reportdesigner.dll) file known as C1ReportDesigner Component, 2) one executable (ReportDesigner.exe) file known as C1ReportDesigner Application and, 3) the Source Code of the C1ReportDesigner Application. The C1ReportDesigner Component is subject to the general terms and restrictions set forth in this EULA. The C1ReportDesigner Application is an executable file used to design and prepare reports; the C1ReportDesigner Application may be distributed, free of royalties, only in conjunction with the Developed Software.

Subject to the terms and conditions in this EULA, C1 hereby grants you the right to use the C1ReportDesigner Application Source Code. You are hereby also granted the right to modify such Source Code and to create derivative works that are based on the licensed Source Code. You may distribute the derivative works that you develop, solely in object code format and exclusively in conjunction with and/or as a part of the Developed Software. You are expressly not granted the right to distribute, disclose or otherwise make available to any third party the licensed Source Code, any modified version, derivative work, or any portion thereof, in source code format.

C1 shall retain all right, title and interest in and to the licensed Source Code, and all C1 updates, modifications or enhancements thereof. Nothing herein shall be deemed to transfer any ownership or title rights in and to the licensed Source Code from C1 to you.

SOURCE CODE IS LICENSED TO YOU AS IS. C1 DOES NOT AND SHALL NOT PROVIDE YOU WITH ANY TECHNICAL SUPPORT FOR YOUR SOURCE CODE LICENSE.

b. VSView Reporting Edition. VSView Reporting Edition includes at least one executable file listed as “VSRptX.exe” (where X indicates the version number i.e.7,8, etc.), known as “Designer.” The file "VSRptX.exe”, or any upgrade or future versions of the Designer, are subject to the restrictions set forth in this EULA and may not be distributed with your Developed Software or in any other way.

c. Doc-to-Help and ComponentOne Natural Search. You may use Doc-To-Help to create online help, manuals or other documentation in electronic or printed format (the "Output Documents"). You may distribute and incorporate in such Output Documents those files identified in the documentation as Redistributable Files. Except for those specific Redistributable Files, you MAY NOT distribute the SOFTWARE, in any format, to others.

d. Studio Products. You may not share the component parts of the Studio Products licensed to you with other Developers, nor may you allow the use and/or installation of such components by other Developers.

e. ComponentOne Response and SOAP Channel. ComponentOne Response is intended to be installed on a Network Server. C1 grants to you the following rights to the SOFTWARE: a) Installation: You may install one copy of the SOFTWARE on a single Network Server; b) Use: When installed and initialized, the SOFTWARE creates a database file which contains the embodiment of a solution knowledge base (the database hereinafter referred to as the "Knowledge Base").

You may use the SOFTWARE to create Knowledge Bases on one Network Server only. To create or to operate Knowledge Bases in more than one Network Server, you must purchase one additional SOFTWARE license for each additional Network Server.

5. Updates/Upgrades; Studio Subscription. Subject to the terms and conditions of this EULA, the Licenses are perpetual. Updates and upgrades to the SOFTWARE may be provided by C1 from time-to-time, and, if so provided by C1, are provided upon the terms and conditions offered at that time by C1 in its sole discretion. C1 may provide updates and upgrades to the SOFTWARE for free or for any charge, at any time or never, and through its chosen manner of access and distribution, all in C1's sole and complete discretion.

C1 licenses certain of its separately-licensed products bundled together in a product suite, called the C1 "Studio" product line (the "Studio Products"). The exact separately-licensed products that are bundled into the Studio Products may change from time-to-time in C1's sole discretion. If the SOFTWARE is identified as a C1 "Studio" product, then the SOFTWARE is one of the Studio Products. The SOFTWARE and the Studio Products are revised from time-to-time (meaning, for example, revised with updates, upgrades and, in the case of Studio products, possibly changes to which specific products are included in the bundle). For you to be entitled to receive any such revisions to the SOFTWARE or the Studio Products, as the case may be, you must have a valid SOFTWARE license or a valid Studio subscription. The original purchaser of the SOFTWARE or of a Studio product receives a one-year subscription from the date of purchase of the SOFTWARE. After one year, the Studio subscription and/or the SOFTWARE license must be renewed to continue to be entitled to receive the SOFTWARE and/or the Studio Products revisions as the case may be.

6. Serial Number. Within the packaging of the SOFTWARE, a unique serial number (the "Serial Number") is included, which allows for the registration of the SOFTWARE. The Serial Number is subject to the restrictions set forth in this EULA and may not be disclosed or distributed either with your Developed Software or in any other way. The disclosure or distribution of the Serial Number shall constitute a breach of this EULA, the effect of which shall be the automatic termination and revocation of all the rights granted herein.

7. Evaluation Copy. If you are using an "evaluation copy" or similar version, specifically designated as such by C1 on its website or otherwise, then the Licenses are limited as follows: a) you are granted a license to use the SOFTWARE for a period of thirty (30) days counted from the day of installation (the "Evaluation Period"); b) upon completion of the Evaluation Period, you shall either i) delete the SOFTWARE from the computer containing the installation, or you may ii) contact C1 or one of its authorized dealers to purchase a license of the SOFTWARE, which is subject to the terms and limitations contained herein; and c) any Developed Software may not be distributed or used for any commercial purpose.

III. INTELLECTUAL PROPERTY.

1. Copyright. You agree that all right, title, and interest in and to the SOFTWARE (including, but not limited to, any images, photographs, animations, video, audio, music, text, and “applets” incorporated into the SOFTWARE), and any copies of the SOFTWARE, and any copyrights and other intellectual properties therein or related thereto are owned exclusively by C1, except to the limited extent that C1 may be the rightful license holder of certain third-party technologies incorporated into the SOFTWARE. The SOFTWARE is protected by copyright laws and international treaty provisions. The SOFTWARE is licensed to you, not sold to you. C1 reserves all rights not otherwise expressly and specifically granted to you in this EULA.

2. Backups. You may either: (a) copy the SOFTWARE solely for backup or archival purposes; or (b) install the SOFTWARE on a single computer, provided you keep the original solely for backup or archival purposes. Notwithstanding the foregoing, you may not copy the Documentation.

3. General Limitations. You may not reverse engineer, decompile, or disassemble the SOFTWARE, except and only to the extent that applicable law expressly permits such activity notwithstanding this limitation.

4. Software Transfers. You may not rent or lease the SOFTWARE. You may transfer the SOFTWARE to another computer, provided that it is completely removed from the computer from which it was transferred. You may permanently transfer all of your rights under the EULA, provided that you retain no copies, that you transfer all the SOFTWARE (including all component parts, the media and printed materials, any dates, upgrades, this EULA and, if applicable, the Certificate of Authenticity), and that the recipient agrees to the terms and conditions of this EULA as provided herein. If the SOFTWARE is an update or upgrade, any transfer must include all prior versions of the SOFTWARE.

5. Termination. Without prejudice to any other rights it may have, C1 may terminate this EULA and the Licenses if you fail to comply with the terms and conditions contained herein. In such an event, you must destroy all copies of the SOFTWARE and all of its component parts.

6. Export Restrictions. You acknowledge that the SOFTWARE is of U.S. origin. You acknowledge that the license and distribution of the SOFTWARE is subject to the export control laws and regulations of the United States of America, and any amendments thereof, which restrict exports and re-exports of software, technical data, and direct products of technical data, including services and Developed Software. You agree that you will not export or re-export the SOFTWARE or any Developed Software, or any information, documentation and/or printed materials related thereto, directly or indirectly, without first obtaining permission to do so as required from the United States of America Department of Commerce's Bureau of Export Administration ("BXA"), or other appropriate governmental agencies, to any countries, end-users, or for any end-uses that are restricted by U.S. export laws and regulations, and any amendments thereof, which include, but are not limited to, the following:

Restricted Countries: Restricted Countries currently include, but are not necessarily limited to Cuba, Iran, Iraq, Libya, Montenegro, North Korea, Serbia, Sudan, and Syria.

Restricted End-Users: Any End-User whom you know or have reason to know will use SOFTWARE or Developed Software in the design, development, or production of missiles and missile technology, nuclear weapons and weapons technology, or chemical and biological weapons. Any national of any of the Restricted Countries, wherever located, who intends to transmit or transport the SOFTWARE or Developed Software to one of the Restricted Countries.

Restricted End-Uses: Any use of SOFTWARE and Developed Software related to the design, development, or production of missiles and missile technology, nuclear weapons and weapons technology, or chemical and biological weapons.

These restrictions change from time to time. You represent and warrant that neither the BXA nor any other United States federal agency has suspended, revoked or denied your export privileges. C1 acknowledges that it shall use reasonable efforts to supply you with all reasonably necessary information regarding the SOFTWARE and its business to enable you to fully comply with the provisions of this Section. If you have any questions regarding your obligations under United States of America export regulations, you should contact the Bureau of Export Administration, United States Department of Commerce, Exporter Counseling Division, Washington DC. U.S.A. (202) 482-4811, http://www.bxa.doc.gov.

7. U.S. Government Restricted Rights. The SOFTWARE and documentation are provided with RESTRICTED RIGHTS. For solicitations issued before December 1, 1995, by the United States of America, its agencies and/or instrumentalities (the "Government"), other than the Department of Defense, the use, duplication or disclosure of the software and documentation provided to the Government under this EULA shall be subject to the RESTRICTED RIGHTS as set forth in subparagraphs (c)(1) and (2) of the Commercial Computer Software - Restricted Rights clause at 48 CFR ch.1 52.227-19. For solicitations issued before September 29, 1995, by the Department of Defense, the use, duplication or disclosure of the software and documentation provided under this EULA shall be subject to the RESTRICTED RIGHTS as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at 48 CFR ch.2 252.227-7013. You will comply with any requirements of the Government to obtain such RESTRICTED RIGHTS protection, including without limitation, the placement of any restrictive legends on the SOFTWARE, and any license agreement used in connection with the distribution of the SOFTWARE. Manufacturer is ComponentOne, LLC, 201 South Highland Avenue, 3rd Floor, Pittsburgh, Pennsylvania 15206 USA. For solicitations issued by the Government on or after December 1, 1995 and the Department of Defense on or after September 29, 1995, the only rights provided in the software and documentation provided herein shall be those contained in this EULA. Under no circumstances shall C1 be obligated to comply with any Governmental requirements regarding the submission of or the request for exemption from submission of cost or pricing data or cost accounting requirements. For any distribution of the SOFTWARE that would require compliance by C1 with the Government's requirements relating to cost or pricing data or cost accounting requirements, you must obtain an appropriate waiver or exemption from such requirements for the benefit of C1 from the appropriate Government authority before the distribution and/or license of the SOFTWARE to the Government.

IV. WARRANTIES AND REMEDIES.

1. Limited Warranty. C1 warrants that the original media, if any, are free from defects for ninety (90) days from the date of delivery of the SOFTWARE. EXCEPT AS OTHERWISE PROVIDED IN THE PRECEDING SENTENCE, AND TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, C1 EXPRESSLY DISCLAIMS ANY WARRANTY FOR THE SOFTWARE, DOCUMENTATION AND ANYTHING ELSE PROVIDED BY C1 HEREBY AND C1 PROVIDES THE SAME IN “AS IS” CONDITION WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE AND DOCUMENTATION REMAINS WITH YOU. THIS LIMITED WARRANTY GIVES YOU SPECIFIC LEGAL RIGHTS. YOU MAY HAVE OTHERS WHICH VARY FROM STATE TO STATE.

2. Limited Remedy. C1's entire liability and your exclusive remedy under this EULA shall be, at C1's sole option, either (a) return of the price paid for the SOFTWARE; (b) repair the SOFTWARE through updates distributed online or otherwise in C1's discretion; or (c) replace the SOFTWARE with SOFTWARE that substantially performs as described in the SOFTWARE documentation, provided that you return the SOFTWARE in the same manner as provided in Section I.2 for return of the SOFTWARE for non-acceptance of this EULA. Any media for any repaired or replacement SOFTWARE will be warranted for the remainder of the original warranty period or thirty (30) days, whichever is longer. THESE REMEDIES ARE NOT AVAILABLE OUTSIDE OF THE UNITED STATES OF AMERICA. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL C1 BE LIABLE FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFIT, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE, EVEN IF C1 HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. BECAUSE SOME STATES/JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES IN CERTAIN CASES, THE ABOVE LIMITATION MAY NOT APPLY TO YOU.

V. MISCELLANEOUS.

1. This is the Entire Agreement. This EULA (including any addendum or amendment to this EULA included with the SOFTWARE) is the final, complete and exclusive statement of the entire agreement between you and C1 relating to the SOFTWARE. This EULA supersedes any prior and contemporaneous proposals, purchase orders, advertisements, and all other communications in relation to the subject matter of this EULA, whether oral or written. No terms or conditions, other than those contained in this EULA, and no other understanding or agreement which in any way modifies these terms and conditions, shall be binding upon the parties unless entered into in writing executed between the parties, or by other non-oral manner of agreement whereby the parties objectively and definitively act in a manner to be bound (such as by continuing with an installation of the SOFTWARE, "clicking-through" a questionnaire, etc.) Employees, agents and other representatives of C1 are not permitted to orally modify this EULA.

2. You Indemnify C1. You agree to indemnify, hold harmless, and defend C1 and its suppliers and resellers from and against any and all claims or lawsuits, including attorney's fees, which arise out of or result from your breach of any of the terms and conditions of this EULA.

3. Interpretation of this EULA. If for any reason a court of competent jurisdiction finds any provision of this EULA, or any portion thereof, to be unenforceable, that provision of this EULA will be enforced to the maximum extent permissible so as to effect the intent of the parties, and the remainder of this EULA will continue in full force and effect. Formatives of defined terms shall have the same meaning of the defined term. Failure by either party to enforce any provision of this EULA will not be deemed a waiver of future enforcement of that or any other provision. Except as otherwise required or superseded by law, this EULA is governed by the laws of the Commonwealth of Pennsylvania, without regard to its conflict of laws principles. The parties consent to the personal jurisdiction and venue of the Commonwealth of Pennsylvania, in the County of Allegheny, and agree that any legal proceedings arising out of this EULA shall be conducted solely in such Commonwealth. If the SOFTWARE was acquired outside the United States, then local law may apply.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Licensing FAQs

Licensing FAQs

This section describes the main technical aspects of licensing. It may help the user to understand and resolve licensing problems he may experience when using ComponentOne .NET and ASP.NET products.

What is Licensing?

How does Licensing Work?

Common Scenarios

Troubleshooting

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


What is Licensing?

What is Licensing?

Licensing is a mechanism used to protect intellectual property by ensuring that users are authorized to use software products.

Licensing is not only used to prevent illegal distribution of software products. Many software vendors, including ComponentOne, use licensing to allow potential users to test products before they decide to purchase them.

Without licensing, this type of distribution would not be practical for the vendor or convenient for the user. Vendors would either have to distribute evaluation software with limited functionality, or shift the burden of managing software licenses to customers, who could easily forget that the software being used is an evaluation version and has not been purchased.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


How does Licensing Work?

How does Licensing Work?

ComponentOne uses a licensing model based on the standard set by Microsoft, which works with all types of components.

NOTE: The Compact Framework components use a slightly different mechanism for licensing than the other ComponentOne components due to platform differences.

When a user decides to purchase a product, he receives an installation program and a Serial Number. During the installation process, the user is prompted for the serial number that is saved on the system. (Users can also enter the serial number by clicking the "License" button on the About Box of any ComponentOne product.)

When a licensed component is added to a form or web page, Visual Studio asks the newly created component for licensing information. The component looks for licensing information stored in the system and generates a key, which Visual Studio saves in two files:

1. a "<projectName>.licenses" resource file which contains the actual key and

2. a "licenses.licx" file that contains references to those resources.

These files are automatically added to the project.

Note that the licenses.licx file is usually not shown in the Solution Explorer; it appears if you press the "Show All Files" button in the Solution Explorer's toolbox, or select "Project | Show All Files" from Visual Studio's main menu.

Later, when the component is created at run time, it gets passed the key that was created at design time and can decide whether to simply accept the key, to throw an exception and fail altogether, or to display some information reminding the user that the software has not been licensed.

All ComponentOne products are designed to display licensing information if the product is not licensed. None will throw licensing exceptions and prevent applications from running.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Common Scenarios

Common Scenarios

Creating components at design time

Creating components at run time

Inheriting from licensed components

Using licensed components in console applications

Using licensed components in Visual C++ applications

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Creating components at design time

Creating components at design time

This is the most common scenario and also the simplest: the user adds one or more controls to the form, the licensing information is stored in the licenses.licx file, and the component works.

Note that the mechanism is exactly the same for Windows Forms and Web Forms (ASP.NET) projects.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Creating components at run time

Creating components at run time

This is also a fairly common scenario. You do not need an instance of the component on the form, but would like to create one or more instances at run time.

In this case, the project will not contain a licenses.licx file (or the file will not contain an appropriate key for the component) and therefore licensing will fail.

To fix this problem, add an instance of the component to a form in the project. This will create the licenses.licx file and things will then work as expected. (The component can be removed from the form after the licenses.licx file has been created).

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Inheriting from licensed components

Inheriting from licensed components

If a component that inherits from a licensed component is created, the licensing information to be stored in the form is still needed. This can be done in two ways:

1. Add a LicenseProvider attribute to the component.

This will mark the component as licensed. When a component is added to a form, Visual Studio will create and manage the licenses.licx file, and the base class will handle the licensing process as usual. No additional work is needed. For example:

[LicenseProvider(typeof(LicenseProvider))]

class MyGrid: C1.Win.C1FlexGrid.C1FlexGrid

{

// ...

}

2. Add an instance of the base component to the form.

This will embed the licensing information into the licenses.licx file as in the previous scenario, and the base component will find it and use it. As before, the extra instance can be deleted after the licenses.licx file has been created.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Using licensed components in console applications

Using licensed components in console applications

When building console applications, there are no forms to add components to, and therefore Visual Studio won't create a licenses.licx file.

In these cases, create a temporary Windows Forms application and add all the desired licensed components to a form. Then close the Windows Forms application and copy the licenses.licx file into the console application project.

Make sure the licensex.licx file is configured as an embedded resource. To do this, right-click the licenses.licx file in the Solution Explorer window and select Properties. In the property window, set the "Build Action" property to "Embedded Resource".

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Using licensed components in Visual C++ applications

Using licensed components in Visual C++ applications

It seems there is a bug in VC++ 2003. The licenses.licx is ignored during the build process, therefore the licensing information is not included in VC++ applications.

To fix this problem, extra steps must be taken to compile the licensing resources and link them to the project. Note the following:

1. Build the C++ project as usual. This should create an exe file and also a licenses.licx file with licensing information in it.

2. Copy the licenses.licx file from the app directory to the target folder (Debug or Release).

3. Copy the C1Lc.exe utility and the licensed dlls to the target folder. (Don't use the standard lc.exe, it has bugs.)

4. Use C1Lc.exe to compile the licenses.licx file. The command line should look like this:

c1lc /target:MyApp.exe /complist:licenses.licx /i:C1.Win.C1FlexGrid.dll

5. Link the licenses into the project. To do this, go back to Visual Studio, right-click the project, select properties, and go to the Linker/Command Line option. Enter the following:

/ASSEMBLYRESOURCE:Debug\MyApp.exe.licenses

6. Rebuild the executable to include the licensing information in the application.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Troubleshooting

Troubleshooting

We try very hard to make the licensing mechanism as unobtrusive as possible, but problems may occur for a number of reasons.

Below is a description of the most common problems and their solutions.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


I have a licensed version of a ComponentOne product but I still get the splash screen when I run my project.

I have a licensed version of a ComponentOne product but I still get the splash screen when I run my project.

If this happens, there must be a problem with the licenses.licx file in the project. It either doesn't exist, contains wrong information, or is not configured correctly.

First, try a full rebuild ("Rebuild All" from the Visual Studio Build menu). This will usually rebuild the correct licensing resources.

If that fails, follow these steps:

1. Open the project and go to the Solution Explorer window.

2. Click the "Show All Files" button on the top of the window.

3. Find the licenses.licx file and delete it.

4. Close the project and reopen it.

5. Open the main form and add an instance of each licensed control.

6. Check the Solution Explorer window, there should be a licenses.licx file there.

7. Rebuild the project using the "Rebuild All" option (not just "Rebuild").

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


I have a licensed version of a ComponentOne product on my web server but the components still behave as unlicensed.

I have a licensed version of a ComponentOne product on my web server but the components still behave as unlicensed.

There is no need to install any licenses on machines used as servers and not used for development.

The components must be licensed on the development machine, therefore the licensing information will be saved into the executable (.exe or .dll) when the project is built. After that, the application can be deployed on any machine, including web servers.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


I downloaded a new build of a component that I have purchased, and now I'm getting the splash screen when I build my projects.

I downloaded a new build of a component that I have purchased, and now I'm getting the splash screen when I build my projects.

Make sure that the license key is still valid. If you licensed the component over a year ago, your subscription may have expired. In this case, you have two options:

Option 1 - Renew your subscription to get a new license key.

If you choose this option, you will receive a new key that you can use to license the new components (from the installation utility or directly from the About Box).

The new subscription will entitle you to a full year of upgrades and to download the latest maintenance builds directly from http://prerelease.componentone.com/.

Option 2 – Continue to use the components you have.

Subscriptions expire, products do not. You can continue to use the components you received or downloaded while your subscription was valid.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Technical Support

Technical Support

ComponentOne Reports for .NET Designer Edition is developed and supported by ComponentOne LLC, a company formed by the merger of APEX Software Corporation and VideoSoft. You can obtain technical support using any of the following methods:

ComponentOne Web site

ComponentOne HelpCentral

Internet e-mail

Peer-to-Peer newsgroup

Documentation

On-line samples

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ComponentOne Web site

ComponentOne Web site

The ComponentOne Web site at www.componentone.com provides a wealth of information and software downloads for Reports for .NET users, including:

· Descriptions of the various support options available through the ComponentOne Service Team.

· Answers to frequently asked questions (FAQ's) about our products, organized by functionality. Please consult the FAQ's before contacting us directly, as this can save you time and also introduce you to other useful information pertaining to our products.

· Free product updates, which provide you with bug fixes and new features.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ComponentOne HelpCentral

ComponentOne HelpCentral

ComponentOne HelpCentral is the new online resource for Visual Studio developers and Help authors. Visit HelpCentral to get information on ComponentOne products, view online demos, get Tech Tips and answers to frequently asked questions (FAQ's), search the ComponentOne knowledgebase and more!

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Internet e-mail

Internet e-mail

For technical support through the Internet, e-mail us at:

Support.Reports.NET@componentone.com

To help us provide you with the best support, please include the following information when contacting ComponentOne:

· Your ComponentOne product serial number.

· The version and name of your operating system.

· Your development environment and its version.

For more information on technical support, go to:

www.componentone.com/support

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Peer-to-Peer newsgroup

Peer-to-Peer newsgroup

ComponentOne also sponsors peer-to-peer newsgroups for C1Report users. ComponentOne does not offer formal technical support in this newsgroup, but instead sponsors it as a forum for users to post and answer each other's questions regarding C1Report. However, ComponentOne may monitor the newsgroups to ensure accuracy of information and provide comments when necessary. You can access the newsgroup from the ComponentOne Web site at http://helpcentral.componentone.com/Newsgroups.aspx.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Documentation

Documentation

ComponentOne documentation is available with each of our products in HTML Help, Microsoft Help 2.0 (.NET, ASP.NET and Mobile Device products only), and PDF format. All of the PDFs are also available on ComponentOne HelpCentral, as well as online help that is directly viewable in your web browser. If you have suggestions on how we can improve our documentation, please email the Documentation team. Please note that e-mail sent to the Documentation team is for documentation feedback only. Technical Support and Sales issues should be sent directly to their respective departments.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


On-line samples

On-line samples

The setup utility installs several samples that show how to accomplish common tasks using the ComponentOne controls. The samples are also available on-line from our samples page, which is updated frequently: http://helpcentral.componentone.com/ProductResources.aspx?View=Samples

If you have samples that you would like to share with others, please post a message in the appropriate newsgroup and we will contact you.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Redistributable Files

Redistributable Files

ComponentOne Reports for .NET is developed and published by ComponentOne LLC. 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:

· C1.Win.C1Report.dll

Site licenses are available for groups of multiple developers. Please contact Sales@ComponentOne.com for details.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Upgrading from VSReport 8.0

Upgrading from VSReport 8.0

VSReport 8.0 users will have no trouble using C1Report. Although C1Report was completely rewritten in C# to take advantage of the latest .NET technologies, the object model is virtually identical to the one in VSReport 8.0. C1Report uses the same report definition files, and implements all the features you are used to, including subreports, export options including HTML/DHTML/PDF export, and much more.

C1Report also includes the same powerful Report Designer that ships with VSView Reporting Edition, so creating and customizing your reports is as easy as ever.

The main difference between VSReport and C1Report is how reports are rendered into preview controls: VSReport uses the VSPrinter control to provide report previewing. For example, the following line of code would render the report in vsreport1 into the vsprinter1 control:

· Visual Basic

· C#

· Delphi

C1Report exposes a PrintDocument object instead. This object can be used to print the report, or it can be attached to a preview control such as the ComponentOne C1PrintPreview or the Microsoft PrintPreview control. For example, the following line of code would render the report in c1report1 into the c1printPreview1 control:

· Visual Basic

· C#

· Delphi

C1Report event names are also different from VSReport. The events were renamed because VSReport has script-handler properties with the same name as the events. In .NET, events and properties must have different names.

Aside from these differences, the controls have virtually identical object models. Both implement the RenderToFile method, which renders reports to HTML, PDF and other types of file, and both expose collections of Groups, Sections, and Fields.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Namespaces

Namespaces

Namespaces organize the objects defined in an assembly. Assemblies can contain multiple namespaces, which can in turn contain other namespaces. Namespaces prevent ambiguity and simplify references when using large groups of objects such as class libraries.

The general namespace for ComponentOne Windows products is C1.Win. The namespace for the C1Report component is C1.Win.C1Report. The following code fragment shows how to declare a C1Report component using the fully qualified name for this class:

· Visual Basic

· C#

· Delphi

Namespaces address a problem sometimes known as namespace pollution, in which the developer of a class library is hampered by the use of similar names in another library. These conflicts with existing components are sometimes called name collisions.

For example, if you create a new class named Field, you can use it inside your project without qualification. However, the C1Report assembly also implements a class called Field. So, if you want to use the C1Report class in the same project, you must use a fully qualified reference to make the reference unique. If the reference is not unique, Visual Studio .NET produces an error stating that the name is ambiguous. The following code snippet demonstrates how to declare these objects:

· Visual Basic

· C#

· Delphi

Fully qualified names are object references that are prefixed with the name of the namespace where the object is defined. You can use objects defined in other projects if you create a reference to the class (by choosing Add Reference from the Project menu) and then use the fully qualified name for the object in your code.

Fully qualified names prevent naming conflicts because the compiler can always determine which object is being used. However, the names themselves can get long and cumbersome. To get around this, you can use the Imports statement (using in C#) to define an alias — an abbreviated name you can use in place of a fully qualified name. For example, the following code snippet creates aliases for two fully qualified names, and uses these aliases to define two objects:

· Visual Basic

· C#

· Delphi

If you use the Imports statement without an alias, you can use all the names in that namespace without qualification provided they are unique to the project.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Creating a .NET Project

Creating a .NET Project

This topic demonstrates how to create a new .NET project.

1. From the File menu in Microsoft Visual Studio .NET, select New and click Project. The New Project dialog box opens.

2. Under Project Types, choose either Visual Basic Projects or Visual C# Projects, and select Windows Application from the list of Templates in the right pane.

3. Enter or browse for a location for your application in the Location field and click OK.

A new Microsoft Visual Studio .NET project is created in the specified location. In addition, a new Form1 is displayed in the Designer view.

4. Double-click the desired C1Report components from the Toolbox to add them to Form1. For information on adding a component to the toolbox, see Adding the C1Report Component to the Toolbox.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Adding the C1Report Component to the Toolbox

Adding the C1Report Component to the Toolbox

After installing Reports for .NET on your computer, you need to add the C1Report component to the Visual Studio Toolbox:

Open the Visual Studio IDE (Microsoft Development Environment). Make sure the Toolbox is visible (select Toolbox in the View menu if necessary).

1. Right-click the Toolbox to open the toolbox context menu.

If you want Reports for .NET components to appear on their own tab in the Toolbox, select Add Tab from the context menu and type in the tab name, for example, “C1Report”. Select the tab where you want the components to appear. Right-click and select Customize Toolbox from the context menu. The Customize Toolbox dialog box will open.

2. In the Customize Toolbox dialog box, go to the .NET Framework Components tab. Sort the list by Namespace (click the Namespace column header) and check the check boxes for all components belonging to namespace C1.Win.C1Report. Note that there may be more than one component for each namespace.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Introduction

Introduction

Reports for .NET includes two main elements: the C1Report component and the C1Report Designer application.

The C1Report component generates Access-style, data-based banded reports that can be rendered directly to a printer, exported to various portable formats (including HTML, PDF, and text), or rendered into preview controls such as the Microsoft PrintPreview control or the ComponentOne C1PrintPreview control.

The C1Report Designer allows you to create and edit reports, or to import existing Microsoft Access reports. The Designer has a user interface that is similar to the one in Microsoft Access.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


The C1Report Component

The C1Report Component

The C1Report component reads report definitions stored in XML files, combines them with data from a data source, and generates reports that can be previewed, printed, or saved to files. C1Report can export reports to HTML, DHTML, PDF, and Text file formats, or render them directly into a C1PrintPreview control. You can distribute C1Report royalty-free with your applications.

C1Report uses an object model largely based on Microsoft Access reports, and it supports most features found in Access reports, including:

1. A Microsoft Access-style banded-report model based on Groups, Sections, and Fields. (These objects are fully exposed by the object model, so you can write your own report designers.)

2. Fields may be bound to simple and binary (object) database fields.

3. Fields may contain VBScript expressions, including extensions for aggregate expressions (Sum, Max, Average, etc.), and have access to the control's object model.

4. Reports may contain event handlers, making them independent of the host application.

5. Reports may contain Subreports.

6. Reports may contain parameterized queries, allowing the user to constrain the data that should be included in the report.

7. Report definitions may be saved within the control at design time or loaded at run time from XML report definition files.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


The C1Report Designer

The C1Report Designer

The C1Report Designer is an application that can create, edit, load, and save report definition files. Report definition files are XML files that may contain multiple reports and can be read directly by the C1Report component.

The report definition files are identical to the ones used by VSReport, the ActiveX version of C1Report. The Designer can import report definitions from Microsoft Access MDB files and from CrystalReports RPT files. Note that importing from MDB files requires Microsoft Access to be present on the computer at the time the files are imported.

The Designer has a user interface similar to the Microsoft Access report designer, including a Wizard used to create new reports.

The primary user of the Designer will be the developer. If you would like to distribute the designer to your end-users, you should get the C1Report Designer Edition package. This package includes the C1Report control, with unlimited distribution rights to the control itself and the report designer. The package also includes the source code to the report designer, so you can customize the application or integrate it with your own product.

To find out how to use the Designer, see Using the C1Report Designer.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


The overall picture

The overall picture

To create reports, you start using the C1Report Designer to create report definitions. Report definitions are saved in XML files, and can be designed from scratch or imported from existing Microsoft Access reports.

Next, use the C1Report component to read the report definitions and render the reports using data from any standard .NET data source. The report definitions can be loaded at design time, and embedded in your application, or they can be read and modified at run time. (You can even create report definitions from scratch, using the C1Report object model).

Reports can be rendered directly to a printer, into a C1PrintPreview control, or into HTML and PDF files that can be published on the Web.

The diagram below shows the relationship between the components in the Reports for .NET package. Boxes with a bold border represent code components (controls and applications). Boxes with a thin border represent files containing information (report definitions, data, and finished reports). Numbered arrows indicate relationships between components, described below:

1. Use the C1Report Designer to create, edit, and save XML report definition files.

2. The C1Report component loads report definitions from the XML files created with the Designer. This can be done at design time (in this case the XML file is persisted with the control and not needed at run time), or at run time using the Load method.

3. The C1Report component loads data from the data source specified in the report definition file. Alternatively, you can provide your own custom data source.

4. The C1Report component formats the data according to the report definition and renders reports to a printer (a), to one of several file formats (b), or to a print preview control (c).

5. Custom applications can communicate with the C1Report component using a rich object model, so you can easily customize your reports or generate entirely new ones. The C1Report Designer is a good example of such an application.

The object model for the C1Report component is summarized below. It is largely based on the Microsoft Access model, except that Access has different types of controls (label control, textbox control, line control, etc.), while C1Report has a single Field object with properties that can make it look like a label, textbox, line, picture, subreport, etc.

The table below lists all objects, along with their main properties and methods.

Note: C1Report uses twips for all measurements. One twip is 1/20 point, so 72 points = 1440 twips = 1 inch).

C1Report Object: the main component.

ReportName, GetReportInfo, Load, Save, Clear, Render, RenderToFile, RenderToStream, PageImages, Document, DoEvents, IsBusy, Cancel, Page, MaxPages, Font, OnOpen, OnClose, OnNoData, OnPage, OnError, Evaluate, Execute

Layout Object: determines how the report will be rendered on the page.

Width, MarginLeft, MarginTop, MarginRight, MarginBottom, PaperSize, Orientation, Columns, ColumnLayout, PageHeader, PageFooter, Picture, PictureAlign, PictureShow

DataSource Object: manages the data source

ConnectionString, RecordSource, Filter, MaxRecords, Recordset

Groups Collection: a report may have many groups.

Group Object: controls data sorting and grouping

Name, GroupBy, Sort, KeepTogether, SectionHeader, SectionFooter, Move

Sections Collection: all reports have at least 5 sections.

Section Object: contains Field objects (also known as "report band")

Name, Type, Visible, BackColor, OnFormat, OnPrint, Height, CanGrow, CanShrink, Repeat, KeepTogether, ForcePageBreak

Fields Collection: a report usually has many Fields.

Field Object: a rectangular area within a section where information is displayed.

Name, Section, Text, TextDirection, Calculated, Value, Format, Align, WordWrap, Visible, Left, Top, Width, Height, CanGrow, CanShrink, Font, BackColor, ForeColor, BorderColor, BorderStyle, LineSlant, LineWidth, MarginLeft, MarginRight, MarginTop, MarginBottom, LineSpacing, ForcePageBreak, HideDuplicates, RunningSum, Picture, PictureAlign, Subreport, CheckBox, RTF

Every report has at least five sections, indexed as follows:

Section | Description
0 - vsrDetail | This section contains fields that are rendered once for each record in the source recordset.
1 - vsrHeader | The report header section is rendered at the beginning of the report.
2 - vsrFooter | The report footer section is rendered at the end of the report.
3 - vsrPageHeader | The page header section is rendered at the top of every page (except optionally for pages that contain the report header).
4 - vsrPageFooter | The page footer section is rendered at the bottom of every page (except optionally for pages that contain the report footer).

In addition to these five sections, there are two additional sections for each group: a group header and a group footer section. For example, a report with 3 grouping levels will have 11 sections.

Note that sections can be made invisible, but they cannot be added or removed, except by adding or removing groups.

The diagram below shows how each section is rendered on a typical report:

The first section rendered is the report header. This section usually contains information that identifies the report.

After the report header comes the page header. If the report has no groups, this section usually contains labels that describe the fields in the detail section.

The next sections are the group headers, detail, and group footers. These are the sections that contain the actual report data. Group headers and footers often contain aggregate functions such as group totals, percentages, maximum and minimum values, and so on. Group headers and footers are inserted whenever the value of the expression specified by the GroupBy property changes from one record to the next.

The detail section contains data for each record. It is possible to hide this section by setting its Visible property to false, and display only group headers and footers. This is a good way to create summary reports.

At the bottom of each page is the page footer section. This section usually contains information such as the page number, total number of pages in the report, and/or the date the report was printed.

Finally, the report footer section is printed before the last page footer. This section is often used to display summary information about the entire report.

You can determine whether or not a section is visible by setting its Visible property to true or false. Group headers can be repeated at the top of every page (whether or not it is the beginning of a group) by setting their Repeat property to true. Page headers and footers can be removed from pages that contain the report header and footer sections by setting the PageHeader and PageFooter properties on the Layout object.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report Samples

C1Report Samples

Please be advised that this ComponentOne software title is accompanied by various sample projects and/or demos, which may or not make use of other ComponentOne development tools. While the sample projects and/or demos included with the software are used to demonstrate and highlight the product’s features, and how the control may be integrated with the rest of the ComponentOne product line, some of the controls used in the demo/sample project may not be included with the purchase of certain individual products.

The ComponentOne Samples are also available at http://helpcentral.componentone.com/ProductResources.aspx?View=Samples

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Visual Basic Samples

Visual Basic Samples

CreateReport | Create reports dynamically using code. This sample uses the C1Report control.
CustomData | Create custom data source objects for use with C1Report. This sample uses the C1Report and C1PrintPreview controls.
Embedded | Load report definitions into the C1Report component at design time. This sample uses the C1Report and C1PrintPreview controls.
Newsletter | Create reports without data sources (unbound reports). This sample uses the C1Report and C1PrintPreview controls.
NorthWind | View reports imported from the NorthWind data base. This sample uses the C1Report control.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C# Samples

C# Samples

Chart | Add charts to reports using C1Report and C1Chart. This sample uses the C1Report and C1Chart controls.
ChartAX | Add charts to reports using C1Report and the MS ActiveX Chart control. This sample uses the C1Report control.
CreateReport | Create reports dynamically using code. This sample uses the C1Report control.
CustomPaperSize | Create reports that use custom paper sizes. This sample uses the C1Report and C1PrintPreview controls.
DebitCredit | N/A, there are no project files.
DynamicFormat | Use script properties to format the report based on its contents. This sample uses the C1Report control.
HierReport | Create reports based on hierarchical data. This sample uses the C1Report control.
ParseParameters | Parse a PARAMETERS statement in a RecordSource string. This sample uses the C1Report control.
ReportBrowser | Open report definition files and list their contents. This sample uses the C1Report control.
RTFReport | Shows how to render RTF fieds in a report. This sample uses the C1Report control.
SubReportDataSource | Use custom data sources with subreports. This sample uses the C1Report control.
XMLData | Use any XML document as a report data source. This sample uses the C1Report control.
ZipReport | Compress and encrypt report definition files. This sample uses the C1Report and C1Zip controls.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Using Reports for .NET

Using Reports for .NET

Although you can use Reports for .NET in many different scenarios, on the desktop and on the Web, the main sequence of steps is always the same:

1: Create a report definition

This can be done directly with the C1Report Designer or using the report designer in Microsoft Access and then importing it into the C1Report Designer. You can also do it using code, either using the object model to add groups and fields or by writing a custom XML file.

2: Load the report into the C1Report component

This can be done at design time, using the "Load Report" context menu, or at run time using the Load method. If you load the report at design time, it will be persisted (saved) with the control and you won't need to distribute the report definition file.

3: Render the report (desktop applications)

If you are writing a desktop application, you can render the report into a C1PrintPreview control (or a Microsoft PrintPreview control) using the Document property. The preview control will display the report on the screen, and users will be able to preview it with full zooming, panning, etc. For example:

· Visual Basic

· C#

· Delphi

4: Render the report (Web applications)

If you are writing a Web application, you can render reports into HTML or PDF files using the RenderToFile method, and your users will be able to view them using any browser.

Creating a Report Definition Using Code

Add Grouping and Sorting Using Code

Adding Charts to C1Reports

Typical Usage Scenarios

VBScript Expressions

Advanced Topics

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Creating a Report Definition Using Code

Creating a Report Definition Using Code

The easiest way to create new report definitions is to use the C1Report Designer, but you can also create reports from scratch, using code. This approach requires some extra work, but it gives you complete flexibility. You can even write your own report designer or ad-hoc report generator.

Note that creating a report definition is not the same as rendering a report. To render a report, you can simply load an existing definition and call the Render method.

The example that follows uses Visual Basic to create a simple tabular report definition based on the NorthWind database. The code is commented and illustrates most important elements of the C1Report object model.

1. First, we initialize the control, named c1r, using the Clear method to clear its contents and set the control font (this is the font that will be assigned to new fields):

· Visual Basic

· C#

· Delphi

2. Next, we set up the DataSource object to retrieve the data we want from the NorthWind database. This is done using the ConnectionString and RecordSource properties (similar to the Microsoft ADO DataControl):

· Visual Basic

· C#

· Delphi

3. Next, we initialize the Layout object that defines how the report will be laid out on the page. In this case, we'll render the report in Portrait mode and set its Width to 6.5 inches (8.5 page width minus one inch for margins on either side):

· Visual Basic

· C#

· Delphi

4. Now comes the interesting part. Every report has five basic sections: detail, report header, report footer, page header, and page footer. We'll set up the report header by setting a couple of properties and adding a title field to it.

· Visual Basic

· C#

· Delphi

The section object has a Fields collection. The collection's Add method creates a new field and assigns it to the section. The parameters specify the new field's Name, Text, Left, Top, Width, and Height properties. By default, the field has the same font as the control. Since this is a title, it makes sense to change the font and make it larger. Note that the field should be tall enough to accommodate the font size, or nothing will appear in it.

5. Next, we'll set up the page footer section. This section is more interesting because it contains calculated fields. Calculated fields contain VBScript expressions in their Text property, which are evaluated when the report is rendered. To make a field calculated, set its Calculated property to true.

· Visual Basic

· C#

· Delphi

The page footer section uses expressions with variables that are not intrinsic to VBScript, but are defined by C1Report. Page and Pages are variables that contain the current page number and the total page count. The section also uses a field configured to look like a line. This is done using the BorderStyle and LineSlant properties.

6. Next, we'll set up the page header section. This section gets rendered at the top of every page and will display the field labels. Using a page header section to display field labels is a common technique in tabular reports. The code is simple, but looks a bit messy because of all the field measurements. In a real application, these values would not be hard-wired into the program.

· Visual Basic

· C#

· Delphi

The code above illustrates a powerful technique for handling fonts. Since every field inherits the control font when it is created, we set the control's Font.Bold property to true before creating the fields, and set it back to False afterwards. As a result, all controls in the page header section have a bold font.

7. To finalize the report, we will add the detail section. This is the section that shows the actual data. It has one calculated field below each label in the page header section.

· Visual Basic

· C#

· Delphi

Note that all fields are calculated, and their Text property corresponds to the names of fields in the source recordsetsource. Setting the Calculated property to true ensures that the Text property is interpreted as a database field name, as opposed to being rendered literally. It is important to adopt a naming convention for report fields that makes them unique, different from recordset field names. If you had two fields named "LastName", an expression such as "Left(LastName,1)" would be ambiguous. In this example we have adopted the convention of beginning all report field names with "Fld".

Note also that the "FldNotes" field has its CanGrow property set to true, and a smaller font than the others. This was done because the "Notes" field in the database contains a lot of text, and we want it all to appear in the report. Rather than make the field very tall and waste space, setting the CanGrow property to true tells the control to expand the field as needed to fit its contents; it also sets the containing section's CanGrow property to true, so the field doesn't spill off the section.

8. The report definition is done. To render it, all it takes is one line of code:

· Visual Basic

· C#

· Delphi

This renders the report into a C1PrintPreview control named ppv that displays the report on the screen. Here's what the report looks like:

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Add Grouping and Sorting Using Code

Add Grouping and Sorting Using Code

Useful reports don't simply show data, they show it in an organized manner. C1Report uses groups to group and sort data. To demonstrate how this works, let's go back to our example and show the employees grouped by country.

The following code creates a group object that sorts and groups records by country. (It should be added to the previous code after the block that creates the detail section.)

· Visual Basic

· C#

· Delphi

Every group has a header and a footer sections. These are invisible by default, but the code above makes the header section visible to show which country defines the group. Then it adds a field with the country. The new field has a solid blue background.

Finally, the code adds a second group to sort the employees within each country by their first name. This group is only used for sorting, so the header and footer sections remain invisible.

We're done with our changes. To render the new report, we need to finish the routine with a call to the Render method, as before:

· Visual Basic

· C#

· Delphi

Here's what the new report looks like:

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Adding Charts to C1Reports

Adding Charts to C1Reports

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Using Chart Fields

Using Chart Fields

Chart fields are implemented using the C1Chart control. Note: you must deploy the C1Chart assembly with your application if you use charts.

To add a Chart field to your report, open the report in the Report Designer, click the Chart field in the toolbar, and mark the area in the report where the Chart should be displayed. Then set the field properties as usual.

The only unusual aspect of Chart fields is that unlike most bound fields, they display multiple values. To select the data you want to display, you should set the Chart field's DataX and DataY properties. You can also customize the chart appearance by setting other properties such as ChartType, Palette, etc.

The following tutorial walks through the creation of a report with an embedded chart:

1. Use the Report Wizard to create a new report

Use the Wizard to select a data source for the report. For this tutorial, we will use the NorthWind database and the Sales by Category view. The following image shows this step:

2. Select the fields you want to display.

In this tutorial, we will group the data by Category and show ProductName and ProductSales in the detail section of the report: To add groups and detail fields, drag them from the Available list on the left to the Groups or Detail lists on the right:

Click Next until the wizard is done to finish creating the initial version of the report.

3. Add the Chart to the Group Header section of the report.

Charts usually make sense in the group header sections of a report, to summarize the information for the group. To add the chart, start by making some room for it in the group header section, then click the Chart button in the field toolbar and place the field in the report. This is what the report should look like at this point (note that the Chart button is pressed in the image):

The chart is not visible yet because there's no data attached to it. Select the chart field and scroll the property window to see the properties in the Chart category (switch the property grid to category view and turn off the property filter if necessary).

Set the DataY property to the name of the field that contains the values to be charted, in this case, ProductSales. Also set the DataX property to the name of the field that contains the labels for each data point, in this case, ProductName.

Note that the DataY property may specify more than one chart series. Just add as many fields or calculated expressions as you want, separating them with semicolons.

The Chart control will now display some sample data so you can see the effect of the properties that are currently set (the actual data is not available at design time). You may want to experiment changing the values of some properties such as ChartType, ForeColor, DataColor, and GridLines. You can also use the regular field properties such as Font and ForeColor.

Click the Preview button to see the report. The sample report should look like the following image:

Note that the Report field is sensitive to its position in the report. Because it is in a group header section, it only includes the data within that group. If you place the Chart field in a detail section, it will include all the data for the entire report. This is not useful because there will be one chart in each detail section and they will all look the same. If you need more control over what data should be displayed in the chart, you can use the DataSource property in the chart field itself. That is discussed later, in the Chart reference.

You can now save the report and use it in your WinForms and ASP.NET applications.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Using Gadient Fields

Using Gadient Fields

Gradient fields are much simpler than charts. They are mainly useful as a background feature to make other fields stand out.

For example, add a gradient field over the labels in the group header section. You may have to right-click the field and select Send To Back to ensure it is behind the labels. Then set the ColorFrom and ColorTo properties to Red and White, and set the Angle property to -90.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Typical Usage Scenarios

Typical Usage Scenarios

This section describes how you can use Reports for .NET in typical desktop and web scenarios.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Desktop Scenarios

Desktop Scenarios

In typical desktop scenarios, C1Report runs on the same computer where the reports will be generated and viewed (the report data itself may still come from a remote server).

These scenarios assume that C1Report will be hosted in a Visual Basic.NET, C#.NET or C++.NET application.

Scenario 1: Embedded Reports (Loaded at Design-Time)

Scenario 2: Embedded Reports (Created at Design-Time)

Scenario 3: Reports Loaded at Run-Time

Scenario 4: Customizable Reports

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Scenario 1: Embedded Reports (Loaded at Design-Time)

Scenario 1: Embedded Reports (Loaded at Design-Time)

Under this scenario, an application generates reports using a fixed set of report definitions that are built into the application. This type of application does not rely on any external report definition files, and end-users have no way to modify the reports.

The main advantage of this type of application is that you don't need to distribute the report definition file, and you can be sure that no one will modify the report format. The disadvantage is that to make any modifications to the report, you must recompile the application.

If you want to use a report definition that you already have, without any modifications, follow these steps (we will later describe how you can edit an embedded report or create one from scratch):

1. Use the C1Report component to create all the reports you will need. (See Using the C1Report Designer for details on how to do this.)

2. Add one C1Report component for each report definition you want to distribute. You may want to name each control after the report it will render (this will make your code easier to maintain).

3. Right-click each C1Report component and select the Load Report menu option to load report definitions into each control. You can also click the Load Report link at the bottom of the property window:

This will bring up the Load Report dialog box, which allows you to select a report definition file and then a report within that file.

To load a report, click theellipse button to select the report definition file you created in step 1, then select the report from the drop-down list and click the Load button. The property page will show the name of the report you selected and a count of groups, sections, and fields. This is what the dialog box looks like:

Add a single C1PrintPreview control to the form (or a Microsoft PrintPreview control) and also add a control that will allow the user to pick a report (this could be a menu, a list box, or a group of buttons.)

4. Add code to render the report selected by the user. For example, if you added a group of buttons in step 3, the code would look like this:

· Visual Basic

· C#

· Delphi

Where rptProducts is the name of the C1Report component that contains the report selected by the user and ppv is the name of the C1PrintPreview control.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Scenario 2: Embedded Reports (Created at Design-Time)

Scenario 2: Embedded Reports (Created at Design-Time)

The Load Report command described in Scenario 1 makes it easy to embed reports you already have into your application. In some cases, however, you may want to customize the report, or use data source objects that are defined in your Visual Studio application rather than use connection strings and record sources. In these situations, use the Edit Report command instead.

To create or edit reports at design time, right-click the C1Report component and select the Edit Report menu option to invoke the C1ReportDesigner application (you can also click the Edit Report link at the bottom of the Properties window):

Note: If the Edit Report command doesn't appear on the context menu and Properties window, it is probably because the control could not find the report designer application. To fix this, simply run the C1ReportDesigner application once in stand-alone mode. The designer will save its location to the registry, and the C1Report component should be able to find it afterwards.

The C1ReportDesigner will show the report currently loaded in the C1Report component. If the C1Report component is empty, the designer will show the report wizard so you can create a new report.

This is the same C1ReportDesigner application used in stand-alone mode. The only differences you will notice when you start it in this mode are:

· You can use the data source objects defined in your application as data sources for your new reports.

· When you close the designer, any changes you made will be saved back into the C1Report component on the form (unless you choose to discard the changes by selecting in the designer, in the File menu, Cancel Changes and Exit).

To use data source objects defined in your application, click the Data Source button in the designer ( [image]), then select the Data Objects page in the Data Source dialog.

The Data Objects page will show a list of data objects currently defined on the form (the page will not be visible if there aren't any valid data sources on the form). Alternatively, you can use the Connections to build and select a connection string and recordsource as usual.

For example, if the main form contains a DataSet object with several DataTables attached to it, the data source picker dialog might look like this:

Once you are done creating or editing the report, you can close the designer by selecting in theFile menu, Save Changes and Exit. This will save the report definition directly into the component (as if you had loaded it from a file using the Load Report command).

If you change your mind and decide to cancel the changes, quit the designer using Cancel Changes and Exit in the File menu.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Scenario 3: Reports Loaded at Run-Time

Scenario 3: Reports Loaded at Run-Time

Under this scenario, an application loads reports definitions from a file at run time. This type of application requires a report definition file and works like a viewer.

The main advantage of this type of application is that if you modify the report format, there's no need to update the application. Simply send the new report definition file to the users and you are done.

To create an application with reports loaded at run-time, follow these steps:

1. Use the C1Report Designer to create all the reports you will need. (See Using the C1Report Designer for details on how to do this.)

2. Add the following controls to the application:

· a C1Report named c1r

· a C1PrintPreview named ppv

· a ComboList named cmbReport

· a StatusBar control named status

3. Add the following Import statements to the top of the file:

· Visual Basic

· C#

· Delphi

This allows you to reference the C1Report and System.IO classes and objects without having to specify the full namespaces.

4. Add code to read the report definition file and build a list of all reports in it. This can be done as follows:

· Visual Basic

· C#

· Delphi

The code starts by getting the location of the file that contains the report definitions. This is done using static methods in the system-defined Path and Application classes. You may have to adjust the code to reflect the location and name of your report definition file.

Then it uses the GetReportInfo method to retrieve an array containing the names of all reports in the report definition file (created in step 1), and populates the combo box that will allow users to select the report.

5. Add code to render the report selected by the user. For example:

· Visual Basic

· C#

· Delphi

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Scenario 4: Customizable Reports

Scenario 4: Customizable Reports

This scenario is a variation on the above. It consists of loading the basic report definitions from a file, then writing code to customize the reports according to user selections.

For example, the code below changes the font used in the detail section:

· Visual Basic

· C#

· Delphi

The code below toggles the display of a group by turning its Sort property on or off and setting the Visible property of the group's header and footer sections:

· Visual Basic

· C#

· Delphi

These samples illustrate some of the things you can do to customize reports. There are infinite possibilities, because the object model offers access to every aspect of the report. (In fact, you can create whole reports entirely with code).

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Web Scenarios

Web Scenarios

If you are developing reports for the Web (ASP.NET), you can use the C1WebReport control included with the ComponentOne ASP.NET Studio package. This control encapsulates the C1Report component and provides methods and properties that make it very easy to add reports to your web pages. The C1WebReport control is 100% compatible with C1Report, and provides advanced caching and rendering options designed specifically for Web scenarios, as well as the usual design-time editing options provided by ASP.NET server controls.

If you don't want to purchase ComponentOne ASP.NET Studio, you can still use the C1Report control in your web applications, except you will have to write some code to create HTML or PDF versions of the reports. The following sections describe how to do this.

In typical web scenarios, C1Report runs on the server machine and creates reports either in batch mode or on demand. The user can select the reports and preview or print them on the client machine, using a web browser.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Scenario 1: Static Web Reports

Scenario 1: Static Web Reports

This scenario is based on a server application that runs periodically and creates a predefined set of reports, saving them to HTML or PDF files. These files are referenced by web pages on your site, and they are downloaded to the client machine like any other web page.

To implement this type of application, follow these steps:

1. Use the C1Report Designer to create all the reports you will need. (See Using the C1Report Designer for details on how to do this.)

2. Create an application on the server that contains a C1Report component. If you don't want to use forms and windows, create the control using the CreateObject function in Visual Basic or CoCreateInstance in C++.NET.

3. Add a routine that runs periodically and updates all the reports you want to make available to your users. The loop would look like this:

· Visual Basic

· C#

· Delphi

The code uses the GetReportInfo method to retrieve a list of all reports contained in the MyReports.xml report definition file (created in step 1), then renders each report into a paged HTML file. (Paged HTML files contain one HTML page for each page in the original report, with a navigation bar that allows browsing.)

4. Edit the "home" HTML page by adding links to the reports that were saved.

You are not restricted to HTML. C1Report can also export to PDF files, which can be viewed on any browser with freely available plug-ins. The PDF format is actually superior to HTML in many ways, especially when it comes to producing hard copies of your web reports.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Scenario 2: Dynamic Web Reports

Scenario 2: Dynamic Web Reports

In this scenario, reports are created on-demand, possibly based on data supplied by the user. This type of solution typically involves using an ASP.NET page that presents a form to the user and collects the information needed to create the report, then creates a C1Report component to render the report into a temporary file, and returns a reference to that file.

The example that follows is a simple ASP.NET page that allows users to enter some information and to select the type of report they want. Based on this, the ASP code creates a custom version of the NorthWind Employee Sales by Country report and presents it to the user in the selected format.

The sample uses a temporary file on the server to store the report. In a real application, you would have to generate unique file names and delete them after a certain time, to avoid overwriting reports before the users get a chance to see them. Despite this, the sample illustrates the main techniques involved in delivering reports over the web with C1Report.

1. Start by creating a new C# Web Application with a web page that looks like this:

The page has five server controls:

· _lstYear: Contains a list of valid years for which we have data (1994, 1995, and 1996).

· _txtGoal: Contains the yearly sales goal for each employee.

· _btnHTML, _btnRTF: Buttons used to render the report into HTML or PDF, and show the result.

· _lblStatus: Displays error information if something goes wrong.

Note: If you run this application with a demo or beta version of the C1Report component, there will be errors when the control tries to display its About dialog box on the server. If that happens, simply reload the page and the problem should go away.

After the page has been set up, you need to add a reference to the C1Report component to the project. Just right-click the References entry in the Solution Explorer window, select Add Reference and pick the C1Report component.

2. If you have used traditional ASP, this is where things start to become interesting. Double-clicking the controls will take you to a code window where you can write full-fledged C# code to handle the events, using the same editor and environment you use to write Windows Forms C# projects.

Double-click both buttons to create handlers for their Click event, and then add the following code:

· Visual Basic

· C#

· Delphi

3. This is the code that gets executed on the server, when the user clicks either button. The code delegates the work to the main routine, RenderReport:

· Visual Basic

· C#

· Delphi

The RenderReport routine is long but pretty simple. It starts out working out the names of the input and output files. All file names are built relative to the current application directory.

4. Next, the routine creates a C1Report component and loads the "Employee Sales by Country" report. This is the raw report, which we will customize below.

The parameters entered by the user are available in the _lstYear and _txtGoal server-side controls. The code reads these values and uses them to customize the report's RecordSource property and to build a VBScript handler for the OnPrint event. These techniques were discussed in previous sections.

Once the report definition is ready, the code calls the RenderToFile method, which causes the C1Report component to write HTML or PDF files to the output directory. When the method returns, the report is ready to be displayed to the user.

5. The last step is the call to Response.Redirect, which displays the report we just created on the user's browser.

Note that the whole code is enclosed in a try/catch block. If anything goes wrong while the report is being generated, the user gets to see a message explaining the problem.

6. Finally, there's a couple of simple helper routines that need to be added:

· Visual Basic

· C#

· Delphi

7. After you enter this code, the application is ready. You can press F5 and trace its execution within Visual Studio.

The picture below shows what the result looks like in the browser:

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


VBScript Expressions

VBScript Expressions

C1Report relies on VBScript to evaluate expressions in calculated fields and to handle report events (the difference between report events and control events is discussed below).

VBScript is a full-featured language, and you have access to all its methods and functions when writing C1Report expressions. This document does not cover the intrinsic features of the VBScript language, which is documented in many books and web sites, as well as on the Microsoft Developer's Network (MSDN).

C1Report extends VBScript by exposing additional objects, variables, and functions. These extensions are described below:

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Objects and Variables

Objects and Variables

1) Database Field Names

Names of fields in the report's source datasetsource are evaluated and return the current field value. If a field name contains spaces or periods, it must be enclosed in square brackets. For example:

OrderID

[Customer.FirstName]

[Name With Spaces]

2) Report Field Names

Names of Field objects are evaluated and return a reference to the object, so you can access the field's properties). The default property for the Field object is Value, so by itself the field name returns the field's current value. For example:

· Visual Basic

· C#

· Delphi

Note: If you give a report field the same name as a data field, you won't be able to access the report field.

3) Report Section Names

Names of Section objects are evaluated and return a reference to the object, so you can access the section's properties. The default property for the Section object is Name. For example:

· Visual Basic

· C#

· Delphi

4) Report Object

Returns a reference to the control object, so you can access the full C1Report object model from your scripts and expressions. For example:

· Visual Basic

· C#

· Delphi

5) Page Variable

Returns or sets the value of the Page property. This property is initialized by the control when it starts rendering a report, and is incremented at each page break. You may reset it using code. For example:

· Visual Basic

· C#

· Delphi

6) Pages Variable

Returns a token that gets replaced with the total page count when the report finishes rendering. This is a read-only property that is typically used in page header or footer fields. For example:

· Visual Basic

· C#

· Delphi

7) Cancel

Set to true to cancel the report rendering process. For example:

· Visual Basic

· C#

· Delphi

8) Compatibility Functions

To increase compatibility with code written in Visual Basic and Microsoft Access (VBA), C1Report exposes two functions that are not available in VBScript: IIf and Format.

IIf evaluates a Boolean expression and returns one of two values depending on the result. For example:

· Visual Basic

· C#

· Delphi

Format converts a value into a string formatted according to instructions contained in a format expression. The value may be a number, date, time, Boolean or string. The format is a string built using syntax similar to the format string used in Visual Basic or VBA.

The table below describes the syntax used for the format string:

Value Type | Format String | Description
Number | Percent, % | Formats a number as a percentage, with zero or two decimal places. For example: Format(0.33, "Percent") = "33%" Format(0.3333333, "Percent") = "33.33%"
 | #,###.##0 | Formats a number using a mask. The following symbols are recognized: # digit placeholder 0 digit placeholder, force display , use thousand separators ( enclose negative values in parenthesis % format as percentage For example: Format(1234.1234, "#,###.##") = "1,234.12" Format(-1234, "#.00") = "(1234.12)" Format(.1234, "#.##") = ".12" Format(.1234, "0.##") = "0.12" Format(.3, "#.##%") = "30.00%"
Currency | Currency, $ | Formats a number as a currency value. For example: Format(1234, "$") = "$1,234.00"
Boolean | Yes/No | Returns "Yes" or "No".
Date | Long Date | Format(#12/5/1#, "long date") = "December 5, 2001"
 | Short Date | Format(#12/5/1#, "short date") = "12/5/2001"
 | Medium Date | Format(#12/5/1#, "medium date") = "05-Dec-01"
 | q,m,d,w,yyyy | Returns a date part (quarter, month, day of the month, week of the year, year. For example: Format(#12/5/1#, "q") = "4"
String | @@-@@/@@ | Formats a string using a mask. The "@" character is a placeholder for a single character (or for the whole value string if there is a single "@"). Other characters are interpreted as literals. For example: Format("AC55512", "@@-@@/@@") = "AC-555/12" Format("AC55512", "@") = "AC55512"
 | @;Missing | Uses the format string on the left of the semi-colon if the value is not null or an empty string, otherwise returns the part on the right of the semi-colon. For example: Format("@;Missing", "UK") = "UK" Format("@;Missing", "") = "Missing"

Note: VBScript has its own built-in formatting functions (FormatNumber, FormatCurrency, FormatPercent, FormatDateTime, etc). You may use them instead of the VBA-style Format function described here.

9) Aggregate Functions

Aggregate functions are used to summarize data over the group being rendered. When used in a report header field, these expressions return aggregates over the entire dataset. When used in group headers or footers, they return the aggregate for the group.

All C1Report aggregate functions take two arguments:

1. A string containing a VBScript expression to be aggregated over the group.

2. An optional string containing a VBScript expression used as a filter (domain aggregate). The filter expression is evaluated before each value is aggregated. If the filter returns false, the value is skipped and is not included in the aggregate result.

C1Report defines the following aggregate functions:

Function | Description
Avg | Average value of the expression within the current group. For example, the expressions below calculate the average sales for the whole group and the average sales for a certain type of product: Avg(SalesAmount) Avg(SalesAmount, ProductType = 3)
Sum | Sum of all values in the group.
Count | Count of records in the group with non-null values. Use an asterisk for the expression to include all records. For example, the expressions below count the number of employees with valid (non-null) addresses and the total number of employees: Count(Employees.Address) Count(*)
Min, Max | Minimum and maximum values for the expression. For example: "Min Sale = " & Max(SaleAmount)
Range | Range between minimum and maximum values for the expression.
StDev, Var | Standard deviation and variance of the expression in the current group. The values are calculated using the sample (n-1) formulas, as in SQL and Microsoft Excel.
StDevP, VarP | Standard deviation and variance of the expression in the current group. These values are calculated using the population (n) formulas, as in SQL and Microsoft Excel.

The next section explains how to use aggregate functions in detail, including how they work in the context of a report and how to use them efficiently.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Using Aggregate Functions

Using Aggregate Functions

To use the aggregate functions, add a calculated field to a section header or footer section, and assign the expression to the field's Text property.

For example, the "Employee Sales by Country" report in the sample NWind.xml file contains several aggregate fields. The report groups records by Country and by Employee.
The SalespersonTotal field in the footer section of the Employee group contains the following expression:

Sum([SaleAmount])

Because the field is in the Employee group footer, the expression returns the total sales for the current employee.

The CountryTotal and GrandTotal fields contain exactly the same expression. However, because these fields are in the Country group footer and report footer, the expression returns the total sales for the current country and for the entire recordset.

You may need to refer to a higher-level aggregate from within a group. For example, in the "Employee Sales by Country" report, there is a field that shows sales in the current country as a percentage of the grand total. Since all aggregates calculated within a country group refer to the current country, the report cannot calculate this directly. Instead, the PercentOfGrandTotal field uses the following expression:

[CountryTotal]/[GrandTotal]

CountryTotal and GrandTotal are fields located in the Country and report footer sections. Therefore, CountryTotal holds the total for the current country and GrandTotal holds the total for the whole recordset.

It is important to realize that evaluating aggregate functions is time-consuming, since it requires the control to traverse the recordset. Because of this, you should try to use aggregate functions in a few calculated fields only. Other fields can then read the aggregate value directly from these fields, rather than evaluating the aggregate expression again.

For example, the "Employee Sales by Country" report in the NorthWind database has a detail field that shows each sale as a percentage of the country's total sales. This field contains the following expression:

[SaleAmount]/[CountryTotal]

SaleAmount is a reference to a recordset field, which varies for each detail record. CountryTotal is a reference to a report field that contains an aggregate function. When the control evaluates this expression, it gets the aggregate value directly from the report field, and does not recalculate the aggregate.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Using VBScript to Format Reports

Using VBScript to Format Reports

You are not restricted to using VBScript to evaluate expressions in calculated fields. You can also specify scripts that are triggered when the report is rendered, and you can use those to change the formatting of the report.

These scripts are contained in event properties. An event property is similar to a Visual Basic event handler, except that the scripts are executed in the scope of the report rather than in the scope of the application that is displaying the report. For example, you could use an event property to set a field's Font and ForeColor properties depending on its value. This behavior would then be a part of the report itself, and would be preserved regardless of the application used to render it.

Of course, traditional events are also available, and you should use them to implement behavior that affects the application rather than the report. For example, you could write a handler for the StartPage event to update a page count in your application, regardless of which particular report is being rendered.

The table below lists the event properties that are available and typical uses for them:

Object | Property | Description
Report | OnOpen | Fired when the report starts rendering. Can be used to modify the ConnectionString or RecordSource properties, or to initialize VBScript variables.
 | OnClose | Fired when the report finishes rendering. Can be used to perform clean-up tasks.
 | OnNoData | Fired when a report starts rendering but the source recordset is empty. You can set the Cancel property to true to prevent the report from being generated. You could also show a dialog box to alert the user as to the reason why no report is being displayed.
 | OnPage | Fired when a new page starts. Can be used to set the Visible property of sections of fields depending on a set of conditions. The control maintains a Page variable that is incremented automatically when a new page starts.
 | OnError | Fired when an error occurs.
Section | OnFormat | Fired before the fields in a section are evaluated. At this point, the fields in the source recordset reflect the values that will be rendered, but the report fields do not.
 | OnPrint | Fired before the fields in a section are printed. At this point, the fields have already been evaluated and you can do conditional formatting.

The following examples illustrate typical uses for these properties.

Format a field according to its value

Show or hide a field depending on a value

Prompt users for parameters

Reset the Page Counter

Change a Field's dimensions to create a Bar Chart

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Format a field according to its value

Format a field according to its value

This is probably the most common use for the OnPrint property. Take for example the "Orders by Value" report in the Nwind.XML sample file. The report lists order values grouped by product. Instead of using an extra field to display the quantity in stock, the report highlights products that are below the reorder level by displaying their name in bold red characters. This is done using an event script that looks like this:

· Visual Basic

· C#

· Delphi

The code builds a string containing the VBScript event handler, and then assigns it to the section's OnPrint property. (When using the C1Report Designer, you can type the script code directly into the Event Editor window instead of writing the code above.)

The control executes the VBScript code whenever the section is about to be printed. The script gets the value of the "ReorderLevel" database field and sets the "ProductName" report field's Font.Bold and ForeColor properties according to the value. If the product is below reorder level, its name becomes bold and red.

Here's what the report looks like:

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Show or hide a field depending on a value

Show or hide a field depending on a value

Instead of changing the field format to highlight its contents, you could set another field's Visible property to true or false to create special effects. For example, if we created a new field called "BoxCtl" and formatted it to look like a bold rectangle around the product name, then we could change the script as follows:

· Visual Basic

· C#

· Delphi

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Prompt users for parameters

Prompt users for parameters

Instead of highlighting products which are below the reorder level stored in the database, you could have the report prompt the user for the reorder level to use.

To get the value from the user, you would change the report's RecordSource property to use a parameter query. (For details on how to build parameter queries, see the next topic.)

· Visual Basic

· C#

· Delphi

This setting causes the control to prompt the user for a "Critical Stock Level" value, which gets stored in a global VBScript variable where your events can use it. The default value for the variable is specified as 10.

To use the value specified by the user, the script should be changed as follows:

· Visual Basic

· C#

· Delphi

The change is in the first two lines of the script. Instead of comparing the current value of the "UnitsInStock" filed to the reorder level stored in the database, the script compares it to the value entered by the user and stored in the "[Critical Stock Level]" VBScript variable.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Reset the Page Counter

Reset the Page Counter

The Page variable is created and automatically updated by the control. It is useful for adding page numbers to page headers or footers.

In some cases, you may want to reset the page counter when a group starts. For example, in a report that groups records by country and has a calculated page footer field with the expression:

· Visual Basic

· C#

· Delphi

It would be good to reset the Page variable for each new country. To do this, assign the following script to the country group header section:

· Visual Basic

· C#

· Delphi

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Change a Field's dimensions to create a Bar Chart

Change a Field's dimensions to create a Bar Chart

We saved the most sophisticated example for last. Instead of showing a field's value as text, you can change its dimensions to create a chart. (The example described below is included in the NWind.xml sample file that ships with C1Report; it is called "Sales Chart".)

To create a chart, the first thing you need to do is find out the scale, that is, the measurements that will be used to the maximum and minimum values. The "Sales Chart" report has a field designed to do this. It is a report footer field called SaleAmountMaxFld that has the size of the longest bar we want to appear on the chart, and holds the following expression:

· Visual Basic

· C#

· Delphi

To draw the actual bars, the report has a detail field called BarFld that is formatted to look like a solid box. The detail section has the following script assigned to its OnPrint event:

· Visual Basic

· C#

· Delphi

This expression calculates the width of the bar based on the width and value of the reference field and on the value of the SaleAmountFld for the current record.

The result is a report that looks like this:

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Advanced Topics

Advanced Topics

Parameter Queries

Unbound Reports

Custom Data Sources

Data Security

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Parameter Queries

Parameter Queries

A parameter query is a query that displays its own dialog box prompting the user for information, such as criteria for retrieving records or a value for a report field. You can design the query to prompt the user for more than one piece of information; for example, you can design it to retrieve two dates. C1Report will then retrieve all records that fall between those two dates.

You can also create a monthly earnings report based on a parameter query. When you render the report, C1Report displays a dialog box asking for the month that you want the report to cover. You enter a month and C1Report prints the appropriate report.

To create a parameter query, you need to edit the SQL statement in the RecordSource property and add a PARAMETERS clause to it. The syntax used to create parameter queries is the same as that used by Microsoft Access.

1. The easiest way to create a parameter query is to start with a plain SQL statement with one or more items in the WHERE clause, then manually replace the fixed values in the clause with parameters. For example, starting with the plain SQL statement:

strSQL = "SELECT DISTINCTROW * FROM Employees " & _

"INNER JOIN (Orders INNER JOIN [Order Subtotals] " & _

"ON Orders.OrderID = [Order Subtotals].OrderID) " & _

"ON Employees.EmployeeID = Orders.EmployeeID " & _

"WHERE (((Orders.ShippedDate) " & _

"Between #1/1/1994# And #1/1/2001#));"

2. The next step is to identify the parts of the SQL statement that will be turned into parameters. In this example, the parameters are the dates in the WHERE clause, shown above in boldface. Let's call these parameters Beginning Date and Ending Date. Since these names contain spaces, they need to be enclosed in square brackets:

strSQL = "SELECT DISTINCTROW * FROM Employees " & _

"INNER JOIN (Orders INNER JOIN [Order Subtotals] " & _

"ON Orders.OrderID = [Order Subtotals].OrderID) " & _

"ON Employees.EmployeeID = Orders.EmployeeID " & _

"WHERE (((Orders.ShippedDate) " & _

"Between [Beginning Date] And [Ending Date]));"

3. Finally, the parameters must be identified in the beginning of the SQL statement with a PARAMETERS clause, that includes the parameter name, type, and default value:

strSQL = "PARAMETERS [Beginning Date] DateTime 1/1/1994, " & _

"[Ending Date] DateTime 1/1/2001;" & _

"SELECT DISTINCTROW * FROM Employees " & _

"INNER JOIN (Orders INNER JOIN [Order Subtotals] " & _

"ON Orders.OrderID = [Order Subtotals].OrderID) " & _

"ON Employees.EmployeeID = Orders.EmployeeID " & _

"WHERE (((Orders.ShippedDate) " & _

"Between [Beginning Date] And [Ending Date]));"

When this statement is executed, the control shows a dialog box prompting the user for Beginning Date and Ending Date values. The values supplied by the user are plugged into the SQL statement and the report is generated only for the period selected by the user.

The dialog box is created on-the-fly by C1Report. It includes all parameters in the query, and uses controls appropriate to the parameter type. For example, check boxes are used for Boolean parameters, and date-time picker controls are used for Date parameters. Here is what the dialog box looks like for the SQL statement listed above:

The syntax for the PARAMETERS clause consists of a comma-separated list of items, ending with a semi-colon. Each item describes one parameter and includes the following information:

· Parameter name. If the name contains spaces, it must be enclosed in square brackets (e.g., [Beginning Date]). The parameter name appears in the dialog box used to collect the information from the user, and it also appears in the WHERE clause for the SQL statement, where it is replaced with the value entered by the user.

· Parameter type. The following types are recognized by the control:

Type Name | ADO Type
Date | adDate
DateTime | adDate
Bit, Byte, Short, Long | adInteger
Currency | adCurrency
Single | adSingle
Double | adDouble
Text, String | adBSTR
Boolean, Bool, YesNo | adBoolean

· Default value. This is the value initially displayed in the dialog box.

The easiest way to build a parameterized query is incrementally. Start with a simple query that works, then add the PARAMETERS clause (don't forget to end the PARAMETERS clause with a semi-colon). Finally, edit the WHERE clause and add the parameter names at the proper place.

You can use the GetRecordSource method to retrieve a proper SQL statement (without the PARAMETERS clause) from a parameter query. This is useful if you want to create your own recordset using data contained in the report.

Note: Instead of using a parameter query, you could write code in Visual Basic or in C++.NET to create a dialog box, get the information from the user, and fix the SQL statement or set the DataSource Object's Filter property as needed. The advantage of using parameter queries is that it places the parameter logic in the report itself, and it is independent of the viewer application. (It also saves you from writing some code.)

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Unbound Reports

Unbound Reports

Unbound reports are reports without an underlying source recordset. This type of report can be useful in two situations:

· You create documents that have a fixed format, and only the content of a few fields that change every time you need to render the document. Business forms are a typical example: the forms have a fixed format, and the field values change.

· You want to consolidate several summary reports into a single one. In this case, you would create an unbound main report, and you would add bound subreports to it.

As an example of a simple unbound report, let's create a simple newsletter without a source recordset. This is done with the C1Report Designer, except that you leave the ConnectionString and RecordSource properties blank and add placeholder fields to the report. The placeholder fields are simple labels whose contents will be set by an application.

Assuming you created a report with six placeholder fields named "FldHeadLineXXX" and "FldBodyXXX" (where XXX ranges from 1 to 3), you could use the following Visual Basic code to render the report:

· Visual Basic

· C#

· Delphi

Here's what this issue of our newsletter looks like. Notice that our simple program does not deal with any formatting at all; it simply supplies the report contents. The report definition created with the C1Report Designer takes care of all the formatting, including a headline with a logo, page footers, fonts and text positioning.

Separating format from content is one of the main advantages of unbound reports.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Custom Data Sources

Custom Data Sources

By default, C1Report uses the ConnectionString and RecordSource properties to create an internal DataTable object that is used as a data source for the report. However, you can also create your own recordsets and assign them directly to the Recordset property. In this case, C1Report will use the recordset provided instead of opening its own.

You can assign three types of objects to the Recordset property: DataTable, DataView or any object that implements the IC1ReportRecordset interface.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Using your own DataTable objects

Using your own DataTable objects

The main reason to use your own DataTable objects is in situations where you already have the object available, and want to save some time by not creating a new one. You may also want to implement security schemes or customize the object in some other way.

To use your own DataTable object, simply assign it to the RecordSet property before you render the report. For example:

· Visual Basic

· C#

· Delphi

The code above creates a DataTable object using standard ADO.NET calls, and then assigns the table to the Recordset property. Note that you could also create and populate the DataTable object on the fly, without relying on and actual database.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Writing your own custom Recordset object

Writing your own custom Recordset object

For the ultimate in data source customization, you can implement your own data source object. This option is indicated in situations where:

1. Your data is already loaded in memory.

2. Some or all of the data is calculated on demand, and does not even exist until you request it.

3. The data comes from disparate data sources and you don't have an easy way to create a standard DataTable object from it.

To implement your own data source object, you need to create an object that implements the IC1ReportRecordset interface. This interface contains a few simple methods described in the reference section of this document.

After you have created the custom data source object, all you need to do is create an instance of it and assign that to the Recordset property. For a complete example, refer to the CustomData sample.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Data Security

Data Security

Data security is an important issue for most corporations. If you plan to create and distribute a phone-directory report for your company, you want to show employee names and phone extensions. You probably don't want people to change the report definition and create a report that includes people's salaries. Another concern is that someone could look at the report definition file, copy a connection string and start browsing (or hacking) your database.

These are legitimate concerns that affect all types of data-based applications, including C1Report. This section discusses some measures you can take to protect your data.

Use Windows NT Integrated security

Build a ConnectionString with a user-supplied password

Application-defined aliases

Custom datasets

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Use Windows NT Integrated security

Use Windows NT Integrated security

One of the strengths of Windows NT is the way it handles security. When a user logs on, the system automatically gives him a set of permissions granted by the system administrator. After this, each application or service can query Windows NT to see what resources he can access. Most popular database providers offer this type of security as an option.

Under this type of scenario, all you need to do is make sure that the people with whom you want to share your data have the appropriate permissions to read it. In this case, the ConnectionString in the report definition file doesn't need to contain any passwords. Authorized users will get to see the data and others will not.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Build a ConnectionString with a user-supplied password

Build a ConnectionString with a user-supplied password

This is a very simple alternative. Before rendering a report (or when the control reports a "failed to connect" error), you can prompt the user for a password and plug that into the connection string. For example:

· Visual Basic

· C#

· Delphi

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Application-defined aliases

Application-defined aliases

Another possible scenario is one where you want to allow certain users to see the reports, but you don't want to give them any special authorizations or information about where the data is stored.

There are two simple ways to achieve this with C1Report. One is by using embedded reports. Load the report definition into your application at design time, using the Load Report dialog box, and the report will be embedded in the application. This way, you don't have to distribute a report definition file and no one will have access to the data source information.

The second way would be for your application to define a set of connection string aliases. The report definition file would contain the alias, and your application would replace it with the actual connection string before rendering the reports. The alias would be useless in any other applications (such as the C1Report Designer). Depending on how concerned you are with security, you could also perform checks on the RecordSource property to make sure no one is trying to get unauthorized access to certain tables or fields in the database.

The code below shows how you might implement a simple alias scheme:

· Visual Basic

· C#

· Delphi

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Custom datasets

Custom datasets

You can also assign an arbitrary dataset created by your application to the Recordset object. This way, you can adopt whatever security measures you see fit, and you don't need to bother with the ConnectionString and RecordSource properties at all.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Using the C1Report Designer

Using the C1Report Designer

The C1Report Designer is a tool used for creating and editing C1Report report definition files. The Designer allows you to create, edit, load, and save files (xml) that can be read by the C1Report component. It also allows you to import report definitions from Microsoft Access files (MDB) and VSReport 1.0 (vsr).

To run the Designer, double-click the C1ReportDesigner.exe file. Here's what the designer looks like:

The main Designer window has the following components:

· Menu bar: Provides access to the main Designer functions. Use the File menu to load and save report definition files, to import report definitions, and to print reports.

· Main toolbar: Provides shortcuts to the most common menu functions: new file, open, import, save, print, undo/redo, cut/copy/paste, create/delete report, and help.

· View toolbar: Switches between preview and design modes, activates the design grid, and displays the property and grouping windows.

· Toolbox: Provides tools for creating report fields. This toolbar is enabled only in design mode.

· Format toolbar: Provides tools for aligning, sizing, and spacing report fields. This toolbar is enabled only in design mode.

· Report list: Lists all reports contained in the current report definition file. You can double-click a report name to preview or edit the report. You can also use the list to rename, copy and delete reports.

· Property Window: Allows you to edit properties for the objects that are selected in the designer.

· Preview/Design pane: This is the main working area of the Designer. In preview mode, it displays the current report. In design mode, it shows the report's sections and fields and allows you to change the report definition.

· Status bar: The status bar displays information about what the Designer is working on (e.g. loading, saving, printing, rendering, importing, etc).

The following sections explain how you can use the C1Report Designer to create, edit, use, and save report definition files.

Creating a basic report definition

Modifying the report layout

Selecting, Moving, and Copying Fields

Changing Field, Section, and Report properties

Changing the data source

Adding fields to the report

Linking subreports to the main report

Grouping and sorting data

Previewing and printing your report

Exporting and publishing your report

Saving your report definition

Managing your report definition files

Importing Microsoft Access reports

Importing Crystal reports

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Creating a basic report definition

Creating a basic report definition

You can design your report to display your data in a variety of ways on the printed page. Using the C1Report Designer, you can design comprehensive lists, summaries, or special subsets of data, like an invoice.

The easiest way to start a new report is to use the Report Wizard. Click the New Report button on the main toolbar, or on the File menu, select New Report. The Report Wizard will appear, and will guide you through five easy steps.

1. Select the data source for the new report.

Use this page to select the ConnectionString and RecordSource that will be used to retrieve the data for the report.

You can specify the ConnectionString in three ways:

· Type the string directly into the editor.

· Use the drop down list to select a recently used connection string (the Designer keeps a record of the last eight connection strings).

· Click the button with the ellipsis (…) to bring up the standard connection string builder.

You can specify the RecordSource string in two ways:

· Click the Table button and select a table from the list.

· Click the SQL button and type (or paste) an SQL statement into the editor.

2. Select the fields you want to include in the report.

This page contains a list of the fields available from the recordset you selected in Step 1, and two lists that define the group and detail fields for the report. Group fields define how the data will be sorted and summarized, and detail fields define what information you want to appear in the report.

You can move fields from one list to another by dragging them. Drag fields into the Detail list to include them in the report, or drag within the list to change their order. Drag fields back into the Available list to remove them from the report.

3. Select the layout for the new report

This page offers you several options to define how the data will be organized on the page. When you select a layout, a thumbnail preview appears on the left to give you an idea of what the layout will look like on the page. There are two groups of layouts, one for reports that have no groups and one for reports with groups. Select the layout that best approximates what you want the final report to look like.

This page also allows you to select the page orientation and whether fields should be adjusted to fit the page width.

The Labels layout option is used to print Avery-style labels. If you select this option, you will see a page that prompts you for the type of label you want to print.

4. Select the Style for the new report

· Group and No Group Layouts

This page allows you to select the fonts and colors that will be used in the new report. Like the previous page, it shows a preview to give you an idea of what each style looks like. Select the one that you like best (and remember, you can refine it and adjust the details later).

· Label Layout Only

This page allows you to select the type of label you want to create. The Designer has over 170 predefined label types for you to choose from. The labels are divided into four groups, depending on whether they use metric or English measurements, and on the type of paper they use (sheets or continuous forms).

5. Select a Title for the new report.

This last page allows you to select a title for the new report and to decide whether you would like to preview the new report right away or whether you would like to go into edit mode and start improving the design before previewing it.

If you choose to preview the report and click finish, you will immediately see the report in the preview pane of the Designer. It should look like this:

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Modifying the report layout

Modifying the report layout

The report generated for you by the wizard is a good starting point, but you will usually need to adjust and enhance it to get exactly what you want. You can do this with the Designer.

To start using the designer, click the Design button on the View toolbar or select Design in the View menu. The right pane of the main window will switch from Review mode into Design mode, and it will show the controls and fields that make up the report:

The picture shows how the report is divided into sections (Header, Page Header, etc). The sections contain fields that hold the labels, variables, and expressions that you want in the printed report. In our example, the Header section contains a label with the report title. The Page Header section contains labels that identify the fields in the Detail section, and the Page Footer section contains fields that show the current time, the page number and the total page count for the report.

The sections of the report determine what each page, group, and the beginning and end of the report look like. The table below describes where each section appears in the report and what it is typically used for.

Section | Appears | Typically Contains
Report header | Once per report | The report title and summary information for the whole report. Page header Once per page Labels that describe detail fields, and/or page numbers.
Group header | Once per group | Fields that identify the current group, and possibly aggregate values for the group (e.g. total, percentage of the grand total).
Detail | Once per record | Fields containing data from the source recordset.
Group footer | Once per group | Aggregate values for the group.
Page footer | Once per page | Page number, page count, date printed, report name.
Report footer | Once per report | Summary information for the whole report.

Note that you cannot add and delete sections directly. The number of groups determines the number of sections in a report. Every report has exactly five fixed sections (Report Header/Footer, Page Header/Footer, and Detail) plus two sections per group (a Header and a Footer). You can hide sections that you don't want to display by setting their Visible property to false.

To enhance your report, you can add lines, rectangles, and pictures to any section. You can also modify the existing fields and sections by changing their properties with the Property Window, or move and resize them with the mouse.

To resize a section, drag its border to the position where you want it. The rulers on the left and on top of the design window show the size of each section (excluding the page margins). Note that you cannot make the section smaller than the height and width required to contain the fields in it. To reduce the size of a section beyond that, move or resize the fields in it first, then resize the section.

To see how this works, move the mouse to the area between the bottom of the Page Header section and the gray bar on top of the Detail section. The mouse cursor will change to show that you are over the resizing area. Click the mouse and drag the line down until the section is about twice its original height. Release the button and the section will be resized.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Selecting, Moving, and Copying Fields

Selecting, Moving, and Copying Fields

You can use the mouse to select fields in the report designer as usual:

· Click a field to select it.

· Shift-click a field to toggle its selected state.

· Control-drag creates a copy of the selected fields.

· Click the empty area and drag to select multiple fields.

· Drag field corners to resize fields.

· Double-click right or bottom field corners to autosize the field.

To select fields that intersect vertical or horizontal regions of the report, click and drag the mouse on the rulers along the edges of the designer.

If fields are small or close together, it may be easier to select them by name. You can select fields and sections by picking them from the drop-down list above the property window.

The Show Grid and Snap to Grid buttons provide a grid that helps position controls at discrete positions. While the grid is on, the top left corner of the fields will snap to the grid when you create or move fields. You can change the grid units (English or metric) by selecting Options in the View menu.

When multiple fields are selected, you can use the buttons on the Format toolbar to align, resize, and space them. When you click any of these buttons, the last field in the selection is used as a reference and the settings are applied to the remaining fields in the selection.

The Apply Style button applies the style of the reference field to the entire selection. The style of a field includes all font, color, line, alignment, and margin properties. You can use the property grid to apply set the value of individual properties to the entire selection.

If some fields overlap, you can control their z-order using the Bring to Front/Send to Back buttons. This will determine which fields are rendered before (behind) the others.

The Report Designer also allows you to select and move fields using the keyboard:

· Use the tab key to select the next field.

· Use shift-tab to select the previous field.

· Use the arrow keys to move the selection one pixel at a time (or shift arrow to by 5 pixels).

· Use the delete key to delete the selected fields.

· When a single field is selected, you can type into it to set the Text property.

After you have placed the fields in the desired positions, you can lock them to prevent inadvertently moving them with the mouse or keyboard. Use the Lock Fields button to lock and unlock the fields.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Changing Field, Section, and Report properties

Changing Field, Section, and Report properties

Once an object is selected, you can use the Property Window to edit its properties.

When one or more fields are selected, the property window will show property values that all fields have in common, and will leave the other properties blank. If no fields are selected and you click on a section (or on the bar above a section), the Section properties will be displayed. If you click the gray area in the background, the Report properties will be displayed.

To see how this works, click the label in the Header section and change its Font and ForeColor properties. You can also change a field's position and dimensions by typing new values for the Left, Top, Width, and Height properties.

The property window expresses all measurements in twips (the native unit used by C1Report), but you can type in values in other units (in, cm, mm, pix, pt) and they will be automatically converted into twips. For example, if you set the field's Height property to "0.5in", the property window will convert it into 720 twips.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Changing the data source

Changing the data source

The data source is defined by the ConnectionString, RecordSource, and Filter properties. These are regular Report properties and may be set using the Property Window and clicking on the background area where there are no sections.

Or click the DataSource button to get a dialog box that allows you to set the ConnectionString and RecordSource properties directly.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Adding fields to the report

Adding fields to the report

Use the ToolBox to add fields to your report. Each button creates a field and initializes its properties as follows:

Button | Name | Description
 | Label field | Creates a field that displays static text.
 | Bound field | Creates a field that is bound to the source recordset. When you click this button, a menu appears and you can select the recordset field. Bound Fields are not limited to displaying raw data from the database. You can edit their Text property and use any VBScript expression.
 | Checkbox field | Creates a bound field that displays a Boolean value as a check box. By default, the checkbox displays a regular checkmark. You can change it into a radio button or crossmark by changing the value of the field's Checkbox property after it has been created.
 | Expression field | Creates a calculated field. When you click this button, the code editor dialog box will appear so you can enter the VBScript expression whose value you want to display.
 | Common expression field | Creates a field with a commonly used expression. When you click this button, a menu appears and you can select expressions that render the date or time when the report was created or printed, the page number, page count, or "page n of m", or the report name.
 | Unbound Picture field | Creates a field that displays a static picture, such as a logo. When you click this button, a dialog box will appear to prompt you for a picture file to insert in the report. A copy will be made of the picture you select and placed in the same directory as the report file. You must distribute this file with the application unless you embed the report file in the application. When you embed a report file in your application, any unbound picture files are embedded too.
 | Bound Picture field | Creates a field that displays a picture (or object) stored in the recordset. When you click this button, a menu appears so you can select a picture field in the source recordset (if there is one; not all recordsets contain this type of field).
 | Line field | Creates a line. Lines are often used as separators.
 | Rectangle field | Creates a rectangle. Rectangles are often used to highlight groups of fields or to create tables and grids.
 | Subreport field | Creates a field that displays another report. When you click this button, a menu appears and you can select other reports that are contained in the same report definition file.
 | Page Break field | Creates a field that inserts a page break.

After you click any of these buttons, drag the mouse over the report and the cursor will change into a cross-hair. Click and drag to define the rectangle that the new field will occupy, and then release the button to create the new field. If you change your mind, hit the ESC key or click the arrow button to cancel the operation.

Note that C1Report only has one type of Field object. The buttons simply set some properties on the Field object to make it look and act in a certain way.

You can also add fields by copying and pasting existing fields, or by holding down the control key and dragging a field or group of fields to a new position to create a copy. To see how this works, click the Unbound Picture button and select a picture file. Then move the mouse over the Page Header section and mark a rectangular area above the first label. The picture you selected will appear in the area you marked.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Linking subreports to the main report

Linking subreports to the main report

Subreports are regular reports contained in a field in another report (the main report).

Subreports are usually designed to display detail information based on a current value in the main report, in a master-detail scenario. For example, the main report may contain orders, and a subreport in the detail section will contain order details for the current order.

This master-detail relationship is controlled by the Text property of the subreport field. This property should contain an expression that evaluates into a filter condition that can be applied to the subreport data source.

The Report Designer can build this expression automatically for you. Right-click the subreport field and select the Link Subreport menu. This will show a dialog that allows you to select which fields should be linked.

Once you make a selection and click OK, the Report Designer will build the link expression and assign it to the Text property of the subreport field. In this case, the expression is:

"[OrderID] = '" & [OrderID] & "'"

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Grouping and sorting data

Grouping and sorting data

After designing the basic layout, you may decide that grouping the records by certain fields or other criteria would make the report easier to read. Grouping allows you to separate groups of records visually and display introductory and summary data for each group. The group break is based on a grouping expression. This expression is usually based on one or more recordset fields but it can be as complex as you like.

Groups are also used for sorting the data, even if you don't plan to show the Group Header and Footer sections.

To add or edit the groups in the report, click the Sorting and Grouping button or select in the View menu Grouping Window. The Sorting and Grouping dialog box will appear. You can use this dialog box to create, edit, reorder, and delete groups.

To create a group, click the Add button and set the properties for the new group.

The Group By field defines how the records will be grouped in the report. For simple grouping, you can select fields directly from the drop-down list. For more complex grouping, you can type grouping expressions. For example, you could use "Country" to group by country or "Left(Country, 1)" to group by country initial. To follow along with our report, select "Country" for the Group By expression.

Next, select the type of sorting you want ("Ascending" in our example). You can also specify whether the new group will have visible Header and Footer sections, and whether the group should be rendered together on a page.

Note: You cannot use memo or binary (object) fields for grouping and sorting. This is a limitation imposed by OLEDB.

Here's what the Sorting and Grouping dialog box should look like at this point:

If you add more fields, you can change their order using the arrow buttons on the right of the group list. This will automatically adjust the position of the Group Header and Footer sections in the report. To delete a field, use the Delete button.

Once you are done arranging the fields, click OK to dismiss the dialog box and see the changes in the Designer. There are two new sections, a Header and Footer for the new group. Both have height zero at this point, you can expand them by dragging the edges with the mouse. Notice that the group header section is visible, and the footer is not. This is because we checked the Group Header button in the dialog, and left the Group Footer button unchecked. Invisible sections are displayed with a hatch pattern to indicate they are invisible.

On the gray bars that mark the top of the new sections there are labels that contain the section name and the value of the group's GroupBy property.

To see how groups work, click the Bound Field button, select "Country" from the menu and mark an area in the newly created Group Header Section. Click the new field to select it and change its Font property to make the new field stand out a little.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Previewing and printing your report

Previewing and printing your report

To preview a report, select it from the Report List on the left pane of the Designer window and click the Preview button, or select the Preview in the View menu. The report will be displayed on the right pane, as shown below:

The main window has a preview navigation toolbar, with buttons that let you page through the document and select the zoom mode.

At this point, you can print the report by clicking the Print button or in the File menu, select Print.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Exporting and publishing your report

Exporting and publishing your report

Instead of printing the report, you may want to export it into a file and distribute it electronically to your clients or co-workers. The Designer supports several export formats, listed below:

Format | Description
Excel | Creates an XLS file that can be opened by Microsoft Excel.
Paged HMTL | Creates one HTML file for each page in the report. The HTML pages contain links that let the user navigate the report.
Drill-Down HTML | Creates a single HTML file with sections that can be collapsed and expanded by the user by clicking on them.
Plain HMTL | Creates a single HTML file with no drill-down functionality.
PDF | Creates a PDF file that can be viewed on any computer equipped with Adobe's Acrobat viewer or browser plug-ins.
PDF with embedded fonts | Creates a PDF file with embedded font information for extra portability. This option significantly increases the size of the PDF file.
RTF | Creates an RTF file that can be opened by most popular word processors (e.g., Microsoft Word, WordPad).
Text | Creates a plain text file.
TIFF | Creates a multi-page TIFF file.

To create an export file, in the File menu select Export and use the File Save dialog box to select the type of file you want to create, its name, and location.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Saving your report definition

Saving your report definition

When you are done creating and viewing your report, use the Save button or the in the File menu, select Save to save the report definition file. The Designer will save the report definition in XML format, which can be read back into the Designer or directly into a C1Report component.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Managing your report definition files

Managing your report definition files

A report definition file may contain several reports. Occasionally, you may want to copy or move a report from one file to another.

To move a report from one file to another, open two instances of the Designer and drag the report from one instance to the other. If you hold down the control key while doing this, the report will be copied. Otherwise, it will be moved.

You can also copy a report within a single file. This will create a new copy of the report, which is a good way to start designing a new report that is similar to an existing one.

Note that the report definition files are saved in XML, so you can also edit and maintain them using any text editor.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Importing Microsoft Access reports

Importing Microsoft Access reports

One of the most powerful features of the C1Report Designer is the ability to import reports created with Microsoft Access. This feature requires Access to be installed on the computer. Once the report is imported into the Designer, Access is no longer required.

To import reports from an Access file, click the Import button or in the File menu, select Import. A dialog box will prompt you for the name of the file you want to import.

Select a Microsoft Access file (MDB or ADP) and the designer scan the file and show a dialog where you can select which reports you would like to import:

The dialog also allows you to specify if the designer should clear all currently defined reports before starting the import process.

The import process handles most elements of the source reports, with a few exceptions listed below:

· Event handler code

Access reports can use VBA, macros and forms to format the report dynamically. C1Report can do the same things, but it only uses VBScript. Because of this, all report code needs to be translated manually.

· Form-oriented field types

Access reports may include certain fields that are not handled by the Designer's import procedure. The field types not supported are Chart, CommandButton, ToggleButton, OptionButton, OptionGroup, ComboBox, ListBox, TabCtl, and CustomControl.

· Reports that use VBScript reserved words

Because Access does not use VBScript, you may have designed reports that use VBScript reserved words as identifiers for report objects or dataset field names. This causes problems when the VBScript engine tries to evaluate the expression, and will prevent the report from rendering correctly.

Reserved words you shouldn't use as identifiers include Date, Day, Hour, Length, Minute, Month, Second, Time, TimeValue, Value, Weekday, and Year. For a complete list, please refer to a VBScript reference.

· Reports that sort dates by quarter (or weekday, month of the year, etc.)

C1Report uses the ADO.NET dataset Sort property to sort groups. This property sorts datasets according to field values only and does not take expressions. (Note that you can group according to an arbitrary expression, but you can't sort.) An Access report that sorts groups by quarter will sort them by date after it is imported. To fix this, you have two options: Either create a field that contains the value for the expression you want to sort on or change the SQL statement that creates the dataset and perform the sorting that way.

These limitations affect a relatively small number of reports, but you should preview all reports after importing them, to make sure they still work correctly.

To illustrate how the Designer fares in a real-life example, try importing the NWind.mdb file. It contains 13 reports, listed below with some comments. (The NWind.XML file that ships with C1Report already contains all the modifications described below.)

1. Alphabetical List of Products

No action required.

2. Catalog

No action required.

3. Customer Labels

No action required.

4. Employee Sales by Country

This report contains code which needs to be translated manually. The following code should be assigned to the Group 1 Header Section's OnPrint event:

· Visual Basic

· C#

· Delphi

5. Invoice

No action required.

6. Products by Category

No action required.

7. Sales by Category

This report contains a Chart control that is not imported. To add a chart to your report, you could use an unbound picture field, then write a VB event handler that would create the chart and assign it to the field as a picture.

8. Sales by Category Subreport

No action required.

9. Sales by Year

This report contains code and references to a Form object which need to be translated manually. To replace the Form object, edit the RecordSource property to add a [Show Details] parameter:

· Visual Basic

· C#

· Delphi

Use the new parameter in the report's OnOpen event:

· Visual Basic

· C#

· Delphi

Finally, two more lines of code need to be translated:

· Visual Basic

· C#

· Delphi

10. Sales by Year Subreport

No action required.

11. Sales Totals by Amount

This report contains code that needs to be translated manually. The following code should be assigned to the Page Header Section's OnPrint event:

· Visual Basic

· C#

· Delphi

The following code should be assigned to the Detail Section's OnPrint event:

· Visual Basic

· C#

· Delphi

12. Summary of Sales by Quarter

This report has a group that is sorted by quarter (see item 4 above). To fix this, add a field to the source dataset that contains the value of the ShippedDate quarter, by changing the RecordSource property as follows:

SELECT DISTINCTROW Orders.ShippedDate,

Orders.OrderID,

[Order Subtotals].Subtotal,

DatePart("q",Orders.ShippedDate) As ShippedQuarter

FROM Orders INNER JOIN [Order Subtotals]

ON Orders.OrderID = [Order Subtotals].OrderID

WHERE (((Orders.ShippedDate) Is Not Null));

Change the group's GroupBy property to use the new field, ShippedQuarter.

13. Summary of Sales by Year

No action required.

Summarizing the information on the table: out of 13 reports imported from the NorthWind database, eight did not require any editing, three required some code translation, one required changes to the SQL statement and one had a chart control that was not replaced.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Importing Crystal reports

Importing Crystal reports

The C1Report Designer can also import Crystal report definition files (.rpt files).

To import reports from a Crystal report definition file, click the Import button or in the File menu, select Import. A dialog box will prompt you for the name of the file you want to import.

Select a Crystal report definition file (RPT) and the designer will convert the report into the C1Report format.

The import process handles most elements of the source reports, with a few exceptions for elements that are not exposed by the Crystal object model or not supported by C1Report. The exceptions include image fields, charts, and cross-tab fields.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report Task-Based Help

C1Report Task-Based Help

The task-based help assumes that you are familiar with programming in .NET, have a basic knowledge of reports, and know how to use controls in general. By following the steps outlined in the help, you will be able to create projects demonstrating a variety of C1Report features, and get a good sense of what the C1Report component can do.

Most of the topics below have pre-built reports that illustrate them. The pre-built reports can be found in the CommonTasks.xml report definition file, which is available for download from the ComponentOne HelpCentral Sample page.

Load report definitions

Load report data

Render reports (preview, print, export)

Display a Progress Indicator while the report renders

Create a report with Alternating Background Color ('Greenbar')

Create a report with a Custom Paper Size

Create a report with Unbound Images

Create a report with Bound Images

Create a report with a Watermark

Create a report with CanGrow/CanShrink fields

Control Page Breaks in a report

Define and use Global Constants in a report

Change Page Headers dynamically

Create a report with a Gutter margin

Create reports with Charts

Create reports with Custom Fields

Add Subtotals and other aggregates to reports

Add Page Headers to Subreports

Retrieve Values from Subreports

Add Conditional Formatting to reports

Add Running Sums to reports

Add a "Continued" label to headers on page breaks

Sort report Data

Create Cross-tab reports

Suppress or Force the display of Zeros

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Load report definitions

Load report definitions

C1Report works by combining a report definition with raw data to create reports. In order to create reports, you need to load the report definition into C1Report. There are several ways to do that:

Load a report definition from a file

Create or modify a report definition at design time

Load a report definition from a string

Create a report definition using code

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Load a report definition from a file

Load a report definition from a file

You can use the C1Report Designer to create report definition files. Report definition files are XML files that may contain one or more report definitions. For details on how to use the C1Report Designer, see the Using the C1Report Designer section of the documentation.

To load a report definition from a file at design time, right-click the C1Report component and select the Load Report menu option. Use the Report Picker dialog to select the report you want, click Load and close the dialog. This is what the report picker dialog looks like:

To load a report definition from a file at run time, use the C1Report Load method. It takes as parameters the name of the report definition file and the name of the report you want to load. If you want to list the reports contained in a report definition file, use the C1Report GetReportInfo method. It returns a list of the reports in the file.

For example:

· Visual Basic

· C#

· Delphi

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Create or modify a report definition at design time

Create or modify a report definition at design time

You can also use the C1Report Designer directly from Visual Studio, without report definition files. To create or edit a report definition at design time, right-click the C1Report component and select the Edit Report menu option. This will start the C1Report Designer, where you can change the report definition. When you are done, close the designer and the component will be automatically updated with the modified report definition.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Load a report definition from a string

Load a report definition from a string

C1Report has a ReportDefinition property that allows you to get or set the entire report definition as a string. This is a convenient way to store and retrieve report definitions in databases or in data structures within your application.

The ReportDefinition string contains the exact same XML that would be stored in the report definition file.

For example:

· Visual Basic

· C#

· Delphi

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Create a report definition using code

Create a report definition using code

C1Report exposes a rich object model that allows you to create entire reports using code. That is how the C1Report Designer works. It starts with a Wizard that presents some options to the user, then adds groups and fields to the report based on the user's choices. This is useful in cases where you want to create your own report designers, fully customized ad-hoc reports, or special reports without a pre-defined structure (i.e. data schema).

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Load report data

Load report data

In addition to a report definition, C1Report needs the actual data to create the report. In most cases, the data comes from a database, but there are other options.

Let C1Report load the data from a database

Let C1Report load the data from an XSD file

Use a DataTable object as a data source

Use a custom data source objects

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Let C1Report load the data from a database

Let C1Report load the data from a database

The simplest option for loading the report data is to set the C1Report DataSource properties ConnectionString and RecordSource. If these properties are set, C1Report uses them to load the data from the database automatically and no additional work is needed.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Let C1Report load the data from an XSD file

Let C1Report load the data from an XSD file

Another option is to set the ConnectionString property to the name of an XSD file. XSD files contain XML representations of ADO.NET DataSet objects. In this case, set the RecordSource property to the name of a table in the DataSet.

Note: to create an XSD file, take an existing DataSet object and call the WriteXml method using the XmlWriteMode.WriteSchema parameter.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Use a DataTable object as a data source

Use a DataTable object as a data source

Many applications need to work on the data outside of C1Report and load it into DataTable objects. In these cases, you may use these objects as report data sources, avoiding the need to load them again when rendering the report.

This approach is also useful in applications where:

· Security restrictions dictate that connection strings must be kept private and only the data itself may be exposed (not its source)

· The database is not supported by OleDb (the provider used internally by C1Report).

· The data does not come from a database at all. Instead, the DataTable is created and populated using custom code.

To use a DataTable object as a C1Report data source, simply load the report definition and then assign the DataTable to the C1Report Recordset property. For example:

· Visual Basic

· C#

· Delphi

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Use a custom data source objects

Use a custom data source objects

Finally, you can use custom objects as data sources. The only requirement is that the custom object must implement the IC1ReportRecordset interface.

IC1ReportRecordset is a simple and easy-to-implement interface that can be added easily to virtually any collection of data. This is often more efficient than creating a DataTable object and copying all the data into it. For example, you could use custom data source objects to wrap a file system or custom XML files.

To use a custom data source objects, load the report definition and then assign the object to the C1Report Recordset property. For example:

· Visual Basic

· C#

· Delphi

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Render reports (preview, print, export)

Render reports (preview, print, export)

Once the report definition has been loaded into the component and a data source has been defined, you can render the report to the printer, into preview controls, or to report files.

Print reports

Preview reports

Export the report to common file formats

Export the report to custom formats

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Print reports

Print reports

To print a report directly to the printer, use the C1Report Document property. This property returns a standard PrintDocument object that has a Print method and exposes printer and page settings.

For example, the code below shows a print dialog and prints the report:

· Visual Basic

· C#

· Delphi

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Preview reports

Preview reports

You can also use the use the C1Report Document property to preview the report. Assign it to the Document property in the C1Preview control or to the .NET PrintPreview or PrintPreviewDialog controls and the preview controls will display the report and allow the user to browse, zoom, or print it. For example:

· Visual Basic

· C#

· Delphi

Note: C1Report works with the .NET preview components, but it is optimized to work with C1Preview. When used with C1Preview, you can see each report page as it is generated. With the standard controls, you have to wait until the entire report is ready before the first page is displayed.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Export the report to common file formats

Export the report to common file formats

C1Report has a RenderToFile method that allows you to export your report to several file formats, including HTML, RTF, PDF, TIFF, Text, and XLS. For example, the code below creates PDF and XLS versions of a report:

· Visual Basic

· C#

· Delphi

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Export the report to custom formats

Export the report to custom formats

If you want to export the report to a format that is not supported by C1Report, you can write your own export filter class and use the RenderToFilter method to render the report into your custom filter.

Custom filters are classes that derive from the C1.Win.C1Report.ExportFilter class and override a few simple methods like StartReport, StartSection,RenderField, EndSection, and EndReport.

Writing a custom export filter is not difficult. It can be used for example to create custom XML representations of your reports for later processing by other applications.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Display a Progress Indicator while the report renders

Display a Progress Indicator while the report renders

Most preview applications have progress indicators that show which page is being rendered and have a button that allows the user to cancel the report while it is being generated. The .NET print preview controls provide this automatically for you.

If you are printing the report directly to the printer or exporting it to a file, however, there is no built-in progress report UI.

To create a progress report dialog, or to update a status bar while the report is being rendered, you should use C1Report events. The StartPage and EndReport events are sufficient to provide feedback on which page is being printed and when the report is finished. To cancel the report before it is finished, add a Cancel button to your application and use it to set the C1Report Cancel property to true.

You may also want to provide progress bars and "page n of m" indicators, but that is generally difficult to do because the page count is not knows until the report has been rendered.

For a generic example, see the "ProgressIndicator" sample available for download at http://helpcentral.componentone.com/ProductResources.aspx?View=Samples.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Create a report with Alternating Background Color ('Greenbar')

Create a report with Alternating Background Color ('Greenbar')

To create a report with alternating background color, use the OnPrint event of the detail section to change the BackColor property of the section. For example:

' VBScript: Report.OnOpen event

' initialize counter

cnt = 0

' VBScript: Detail.OnPrint event

' alternate back color

cnt = cnt + 1

if cnt mod 2 = 0 then

detail.backcolor = rgb(200,220,200)

else

detail.backcolor = rgb(255,255,255)

endif

Whenever a detail section is rendered, the counter is incremented and the BackColor property of the detail section is toggled.

See report "01: Alternating Background (Greenbar report)" in CommonTasks.xml, which is available for download from the ComponentOne HelpCentral Sample page.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Create a report with a Custom Paper Size

Create a report with a Custom Paper Size

By default, C1Report creates reports using the default paper size on the default printer.

You can specify the paper size and orientation using the PaperSize and Orientation properties. However, C1Report checks that the selected paper size is available on the current printer before rendering, and changes to the default paper size if the selected setting is not available.

If you want to specify a certain paper size and use it regardless of the printers available, set the PaperSize property to Custom, and set the CustomWidth and CustomHeight properties to the page dimensions (in twips).

For example, the code below sets the report paper size to 25 x 11", regardless of what is available on the printer:

· Visual Basic

· C#

· Delphi

Note that you can make these settings using the property grid in the report designer. The property grid allows you to type in measurements with units, and converts them into twips automatically. If you type "11in", the grid will display the measurement in twips (36000).

See report "02: Custom Paper Size" in CommonTasks.xml, which is available for download from the ComponentOne HelpCentral Sample page.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Create a report with Unbound Images

Create a report with Unbound Images

Unbound images are static images such as logos and watermarks that are not stored in the database.

To add bound image fields in the C1Report Designer, click the Unbound Image button. This will show a dialog where you can pick the image file you want to include in the report. The image file can be embedded in the report definition, or it can be a reference to an external file. In the Designer's View menu, select Options to choose the option you prefer.

See report " 03: Unbound Images" in CommonTasks.xml, which is available for download from the ComponentOne HelpCentral Sample page.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Create a report with Bound Images

Create a report with Bound Images

Bound images are images stored in database fields. To display these images in your reports, add a field to the report and set its Picture property to a string containing the name of the column where the image is stored.

For example, if the field "Photo" in the database contains embedded OLE objects or raw image streams, and the report contains a field called "fEmployeePhoto", then the following code would display the employee photo in the field:

· Visual Basic

· C#

· Delphi

To add bound image fields in the C1Report Designer, click the Bound Image button. This will show a menu with all binary fields in the current data source, where you can select the field you want to add to the report.

See report " 04: Bound Images" in CommonTasks.xml, which is available for download from the ComponentOne HelpCentral Sample page.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Create a report with a Watermark

Create a report with a Watermark

Watermarks are images displayed behind the report content. The images are often washed-out to prevent them from interfering with the actual report content.

To display an image as a watermark, set the Picture property to a file that contains the image. You can also control the way the watermark is scaled and the pages on which it should appear using the PictureAlign and PictureShow properties.

See report " 05: Watermark" in CommonTasks.xml, which is available for download from the ComponentOne HelpCentral Sample page.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Create a report with CanGrow/CanShrink fields

Create a report with CanGrow/CanShrink fields

It is common for report fields to have content that may span multiple lines or collapse to no lines at all. In some cases, you may want to allow these fields to grow or shrink to fit their content rather than clip the excess or leave white spaces in the report.

To do this, set the Field object's CanGrow and CanShrink properties to true.

Fields that grow push down the fields below them. Likewise, fields that can shrink push up the fields below them. Below in this case means "strictly" below, as shown in the diagram below:

Field 1 will push or pull fields 2 and 3 when it grows or shrinks. Field 4 will not be affected because it is not directly below field 1. The shaded area in the diagram shows the region affected by field 1.

If you want field 4 to remain aligned with fields 2 and 3, add an extra field spanning the whole area above fields 2 and 3. The new field will be pushed down by field 1 and will in turn push fields 2, 3, and 4. The diagram below shows this new layout:

See report "06: CanGrow CanShrink" in CommonTasks.xml, which is available for download from the ComponentOne HelpCentral Sample page.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Control Page Breaks in a report

Control Page Breaks in a report

By default, C1Report fills each page until the bottom, inserts a page break, and continues rendering in the next page. You can override this behavior using several properties:

· KeepTogether: Determines whether group header sections are allowed to render on a page by themselves, if they must be rendered with at least one detail section, or if the entire group should be kept together on a page.

· KeepTogether: Determines whether page breaks are allowed within sections. It has lower precedence than KeepTogether.

· ForcePageBreak: Allows you to specify that page breaks should be inserted before, after, or before and after the section.

· KeepTogether: Determines whether page breaks are allowed within fields. This allows long text fields to span multiple pages. It has lower precedence than KeepTogether.

· ForcePageBreak: Allows you to specify that page breaks should be inserted before, after, or before and after the field.

You set these properties at design time, and you can use script to change these them while the report is being rendered. For example, the script below causes page breaks after each 10 detail sections:

' VBScript: Report.OnOpen event

cnt = 0 ' initialize detail counter

' VBScript: Detail.OnPrint event

cnt = cnt + 1

detail.forcepagebreak = "none"

if cnt >= 10 then

cnt = 0

detail.forcepagebreak = "after"

endif

See report "07: Force Page Breaks" in CommonTasks.xml, which is available for download from the ComponentOne HelpCentral Sample page.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Define and use Global Constants in a report

Define and use Global Constants in a report

There is no special mechanism for doing this, but you can add hidden fields to the report and use their values as global parameters.

For example, if you add a field called "linesPerPage" to the report, set its Text property to a number, and Visible to false, then you can control the number of detail lines per page using a script similar to the one described above:

' VBScript: Report.OnOpen event

cnt = 0 ' initialize detail counter

' VBScript: Detail.OnPrint event

cnt = cnt + 1

detail.forcepagebreak = "none"

if cnt >= linesPerPage then

cnt = 0

detail.forcepagebreak = "after"

endif

The value in the "linesPerPage" field can be set prior to rendering the report, by changing the field's Text property,

See report "08: Global Constant" in CommonTasks.xml, which is available for download from the ComponentOne HelpCentral Sample page.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Change Page Headers dynamically

Change Page Headers dynamically

C1Report has PageHeader and PageFooter properties that allow you to specify whether page header and page footer sections should appear on all pages, or be suppressed on the pages that contain the report header and report footer sections.

Sometimes you may want to further customize this behavior. For example, you may want to render different headers on odd and even pages. This can be done with some script that shows or hides fields depending on the page being rendered.

For example, if a report header contains several fields named "h<x>odd" and "h<x>even", then the following script would show or hide these fields for odd and even pages:

' VBSsript: PageHeader.OnFormat event

odd = (page mod 2 <> 0)

h1odd.Visible = odd

h2odd.Visible = odd

h1even.Visible = not odd

h2even.Visible = not odd

To prevent the page header from showing blank spaces, all the fields should have the CanShrink property set to true.

See report "09: Dynamic Page Header" in CommonTasks.xml, which is available for download from the ComponentOne HelpCentral Sample page.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Create a report with a Gutter margin

Create a report with a Gutter margin

Gutter margins are extra space added to the margins next to the binding. They make it easier to bind the pages into folders, brochures, etc.

To add a gutter margin to a report, you should increase the MarginLeft property on odd pages and use the default value on even pages. This can be done with script that changes the margins based on the page being rendered. For example:

' VBScript: Report.OnOpen

gutter = report.layout.marginleft ' initialize variable

' VBScript: Report.OnPage

report.layout.marginleft = _

iif(page mod 2 = 1, gutter, gutter - 1440)

See report "10: Gutter" in CommonTasks.xml, which is available for download from the ComponentOne HelpCentral Sample page.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Create reports with Charts

Create reports with Charts

In the initial versions of C1Report, adding charts to reports required handling the StartSection event, generating the chart, and assigning the chart image to a field's Picture property. This is not hard to do, and continues to be the most flexible way to add dynamic images to reports.

However, this approach has two drawbacks:

1. It requires you to write code outside the report definition, which means only your application will be capable of showing the report the way it is meant to be shown.

2. It does require you to write code for generating the chart, which can be tedious.

The current C1Report supports custom report fields, including a Chart field that is based on the C1Chart control.

To add a Chart field to a report, use the C1ReportDesigner to add a Chart field to a group header section and set the Chart field's DataX and DataY properties to the values you want to display on the chart. You can show several series by setting the DataY property to a list of fields delimited by semicolons (e.g. "UnitsInStock;ReorderLevel").

The chart data is automatically scoped to the current report group, so when rendering the "Beverages" section, only data for that category will be charted. You can customize the chart using many other properties such as ChartType, GridLines, Use3D, and Palette properties.

See report "11: Charts" in CommonTasks.xml, which is available for download from the ComponentOne HelpCentral Sample page.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Create reports with Custom Fields

Create reports with Custom Fields

You can create your own custom fields and add them to the report designer palette. To do that, you have to:

1. Create a custom field class that derives from C1.Win.C1Report.Field.

2. Register your custom field assembly in the report designer's settings file.

This is how the Chart and Gradient fields are implemented. The source code for these custom fields is available; you can use it as a starting point to create your own custom fields.

The Chart and Gradient fields are registered in the C1Report Designer settings file with this entry:

<customfields>

<item value="C1.Win.C1Report.CustomFields;C1.Win.C1Report.CustomFields.Chart" />

<item value="C1.Win.C1Report.CustomFields;C1.Win.C1Report.CustomFields.Gradient" />

</customfields>

See report "12: Custom Fields" in CommonTasks.xml, which is available for download from the ComponentOne HelpCentral Sample page.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Add Subtotals and other aggregates to reports

Add Subtotals and other aggregates to reports

C1Report supports aggregate expressions in all its calculated fields. The aggregate expressions include all the usual Sum, Avg, Min, Max, Count, Range, StDev, etc.

All aggregate functions take an expression as argument and evaluate it within a scope that is determined by their position in the report. For example, aggregates in group headers or footers have the scope of the group. Aggregates in the report header or footer have the scope of the entire report.

For example, "Sum(Sales)" would return the sum of all values in the "Sales" field for the scope of the aggregate (group or report). "Sum(Sales * 0.085)" would return the total amount of sales taxes paid for all values in the report (assuming an 8.5% sales tax).

You can reduce the scope of any aggregate using a second argument called 'domain'. The domain argument is an expression that determines whether each value in the current scope should be included in the aggregate calculation.

For example, "Sum(Sales, Category = 1)" would return the sum of all values in the "Sales" field for products in category 1. "Count(*, Sales > 10000)" would return the number of sales over $10,000.

See report "13: Subtotals and other Aggregates" in CommonTasks.xml, which is available for download from the ComponentOne HelpCentral Sample page.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Add Page Headers to Subreports

Add Page Headers to Subreports

C1Report ignores page header and page footer sections in subreports. Instead, it uses the page header and page footer sections defined in the main report. This is the same behavior as in Microsoft Access.

In many cases, however, you would like your subreports to include header information across page breaks. To do this, place the headers in a group header section and set the section's Repeat property to true. If your subreport doesn't have any groups, add an empty one.

See report "14: Page Headers in Subreports" in CommonTasks.xml, which is available for download from the ComponentOne HelpCentral Sample page.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Retrieve Values from Subreports

Retrieve Values from Subreports

In some cases you may want to pass data from the subreport back to the main report. Script variables can't be used for this because each report has its own script scope (this avoids the possibility of conflicting variable names).

To pass data from a subreport back to the main report, you have to store values in subreport fields or in the subreport's Tag property, then have the main report read those values.

In this sample, the subreport calculates the average unit price per product category and stores that value in its Tag property. The main report retrieves and displays that value.

See report "15: Retrieve Values from Subreports" in CommonTasks.xml, which is available for download from the ComponentOne HelpCentral Sample page.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Add Conditional Formatting to reports

Add Conditional Formatting to reports

In some cases you may want to change a field's appearance depending on the data it represents. For example, you may want to highlight items that are expensive, or low in stock.

To do this, attach some script to the OnFormat property of the section that contains the fields of interest. For example, the script below changes the detail section's BackColor property depending on the value of the fields UnitsInStock, UnitsOnOrder, ReorderLevel, and Discontinued:

' VBScript: Detail.OnFormat

If UnitsInStock + UnitsOnOrder < ReorderLevel And _

Discontinued = False Then

Detail.BackColor = rgb(255,190,190)

Else

Detail.BackColor = vbWhite

Endif

See report "16: Conditional Formatting" in CommonTasks.xml, which is available for download from the ComponentOne HelpCentral Sample page.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Add Running Sums to reports

Add Running Sums to reports

C1Report Field objects have a RunningSum property that makes it easy to maintain running sums over groups or over the entire report.

To keep running sums over pages, you need to use script. For example, you could add a "pageSum" field to the report and update it with script as shown below:

' VBScript: Report.OnPage event

pageSum = 0

' VBScript: Detail.OnPrint event

pageSum = pageSum + UnitsInStock

See report "17: Running Sums" in CommonTasks.xml, which is available for download from the ComponentOne HelpCentral Sample page.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Add a "Continued" label to headers on page breaks

Add a "Continued" label to headers on page breaks

Group header sections are repeated across page breaks if their Repeat property is set to true. This makes the report easier to read, but it can be hard to tell if a group header on a page marks the beginning of a group or is just a continuation.

One way to address this is to add a field with a "Continued" label to the group header and control its visibility with script.

For example, if the field with the label is called "fContinued" and is initially invisible, then the following script would show the label only on continued page headers:

VBScript: Detail.OnPrint

fContinued.Visible = true

VBScript: GroupFooter.OnPrint

fContinued.Visible = false

This script ensures that the "fContinued" field is visible within the group. Any page breaks created after the group footer and before the next detail section will not show the label.

See report "18: Continued Headers" in CommonTasks.xml, which is available for download from the ComponentOne HelpCentral Sample page.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Sort report Data

Sort report Data

There are two ways to sort data in reports. You can sort the data source object itself (e.g. using a SQL statement with an ORDER BY clause), or you can add groups to the report and specify how each group should be sorted using the group's GroupBy and Sort properties.

This is what the group editor looks like in the C1Report Designer. Note the fields where you can specify group sorting:

If you use both approaches, the sorting set in the report groups will prevail (it is applied after the data has been retrieved from the database).

See report "19: Sorting" in CommonTasks.xml, which is available for download from the ComponentOne HelpCentral Sample page.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Create Cross-tab reports

Create Cross-tab reports

Cross-tab reports group data in two dimensions (down and across). They are useful for summarizing large amounts of data in a format that cross-references information.

To create cross-tab reports, you will typically start with a GROUP BY query to summarize the data into rows, then use a transformation (pivot) service to create the grouped columns. The transformation service can be provided by the database server itself, it can be a custom program, or you can use C1Report's built-in domain aggregates.

In all cases, the most important element in the cross-tab report is the original summarized view of the data. For example, a typical summarized view would look like this:

Year | Quarter | Amount
1990 | 1 | 1.1
1990 | 2 | 1.2
1990 | 3 | 1.3
1990 | 4 | 1.4
1991 | 1 | 2.1
1991 | 2 | 2.2
1991 | 3 | 2.3
1991 | 4 | 2.4

This data would then be transformed by adding columns for each quarter and consolidating the values into the new columns:

Year | Total | Q1 | Q2 | Q3 | Q4
1990 | 5 | 1.1 | 1.2 | 1.3 | 1.4
1991 | 9 | 2.1 | 2.2 | 2.3 | 2.4

You can do this using C1Report aggregate functions. The report would be grouped by year. The detail section would be invisible, and the group header would contain the following aggregates:

Year | Total | Q1 | Q2 | Q3 | Q4
[Year] | Sum(Amount) | Sum(Amount, Quarter=1) | Sum(Amount, Quarter=2) | Sum(Amount, Quarter=3) | Sum(Amount, Quarter=4)

The first aggregate would calculate the total amount sold in the current year. The quarter-specific aggregates specify a domain to restrict the aggregate to the specified quarter.

See report "20: Cross-tab Reports" in CommonTasks.xml, which is available for download from the ComponentOne HelpCentral Sample page.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Suppress or Force the display of Zeros

Suppress or Force the display of Zeros

To suppress the display of fields with value zero, set their Format property to "#". The pound sign is a formatting symbol that displays only significant digits (no leading or trailing zeros).

To force the display of a certain number of digits, use a format like "0000". The zero forces the display of a digit, including leading and trailing zeros.

Each format string can have up to three sections separated by semi-colons. If two sections are provided, the first is used for positive values and zero, the second for negative values. If three sections are provided, the first is used for positive values, the second for negative values, and the third for zero. For example: "#;(#);ZERO".

See report "21: Suppress or Force Zeros" in CommonTasks.xml, which is available for download from the ComponentOne HelpCentral Sample page.

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1.Win.C1Report Assembly

C1.Win.C1Report Assembly

Namespaces

C1.Win.C1Report

C1.Win.C1Report.Design

C1.Win.C1Report.Util

C1.Win.C1Report.Util.Styles

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1.Win.C1Report Namespace

C1.Win.C1Report Namespace

C1.Win.C1Report Hierarchy

Classes

Class | Description
C1Report | The C1Report component generates Access-style, data-based banded reports that can be rendered directly to a printer, exported to various portable formats (including HTML, PDF, and text), or rendered into preview controls such as the Microsoft PrintPreview or ComponentOne C1PrintPreview controls.
DataAccessException | System.Exception that is thrown when a data access error occurs.
DataSource | Provides data for reports.
DialogEventArgs | Provides data for InitializeParametersDialog event.
ExportFilter | Base class for all export filters, used with the RenderToFilter method to render reports into different formats.
Field | Displays individual data items in a report.
FieldCollection | FieldCollection class represents a collection of the Field objects.
Group | Object used to sort and group report data.
GroupCollection | GroupCollection class represents a collection of the Group objects.
HtmlFilter | Used with the RenderToFilter method to render reports into HTML streams or files.
Layout | The Layout object controls how the report is rendered on pages.
PdfFilter | Used with the RenderToFilter method to render reports into PDF (portable document format) streams or files.
ReportEventArgs | Provides data for StartPage, EndPage, StartSection, PrintSection, EndSection and the ReportError events.
RtfFilter | Used with the RenderToFilter method to render reports into RTF (rich text format) streams or files.
RtfLabelFilter | Class is used with the RenderToFilter method to render reports into RTF (rich text format) streams or files.
Section | Represents a report band.
SectionCollection | Collection of the Section objects.
TextFilter | Used with the RenderToFilter method to render reports into plain text streams or files.
TiffFilter | Used with the RenderToFilter method to render reports into TIFF streams or files.
XlsFilter | Class used with the RenderToFiltermethod to render reports into Microsoft Excel (XLS) files.

Interfaces

Interface | Description
IC1ReportRecordset | Interface used to access report data from data source objects.

Delegates

Delegate | Description
DialogEventHandler | Represents the method that will handle the InitializeParametersDialog event.
ReportEventHandler | Represents the method that will handle StartPage, EndPage, StartSection, PrintSection, EndSection and the ReportError events.

Enumerations

Enumeration | Description
AnchorEnum | Determines how the field is positioned with respect to its containing section when the section grows or shrinks as a result of the section's CanGrow and CanShrink properties.
BackStyleEnum | Determines whether the field will be rendered with an opaque or transparent background.
BarCodeEnum | Determines what type of barcode will be used in the field.
BorderStyleEnum | Specifies the Field痴 border style.
CheckBoxEnum | Specifies how boolean values are translated into checkboxes.
ColumnLayoutEnum | Specifies the layout for the columns (down or across).
FieldAlignEnum | Specifies the alignment of text within the field's rectangle.
FileFormatEnum | Specifies the format of the export file.
ForcePageBreakEnum | Determines whether page breaks should be inserted before or after a field or section.
GrowShrinkModeEnum | Specifies the logic for handling CanGrow/CanShrink fields.
HdrFtrEnum | Specifies where the Page Footer and Page Header sections are displayed.
KeepTogetherEnum | Specifies whether the group should be kept together on a page.
LineSlantEnum | Determines whether/how a line should be drawn across the field (as opposed to a box around the field).
OrientationEnum | Specifies the page orientation.
PictureAlignEnum | Specifies the alignment of images within the field's rectangle.
PictureScaleEnum | Specifies the scaling of images within the field's rectangle.
PictureShowEnum | Specifies where the background picture is displayed.
RunningSumEnum | Determines whether to calculate a running sum.
SectionTypeEnum | Specifies the section type, which is equivalent to a the index of a Section object in the control's Sections collection.
SortEnum | Specifies how groups should be sorted.
TextDirectionEnum | Specifies the direction of the text in the field.

See Also

C1.Win.C1Report Assembly

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


AnchorEnum Enumeration

AnchorEnum Enumeration

Determines how the field is positioned with respect to its containing section when the section grows or shrinks as a result of the section's CanGrow and CanShrink properties.

[Visual Basic]

Public Enum AnchorEnum

[C#]

public enum AnchorEnum

[Delphi]

type AnchorEnum = (Bottom, Top, TopAndBottom);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

Remarks

Use the members of this enumeration to set the value of the Anchor property in the Field class.

Members

Member name | Description
Bottom | The field moves vertically. The space between the bottom of the field and the bottom of the section remains the same.
Top | The field does not move. The space between the top of the field and the top of the section remains the same.
TopAndBottom | The field grows or shrinks. The space between field and the section remains the same (above and below).

See Also

C1.Win.C1Report Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


BackStyleEnum Enumeration

BackStyleEnum Enumeration

Determines whether the field will be rendered with an opaque or transparent background.

[Visual Basic]

Public Enum BackStyleEnum

[C#]

public enum BackStyleEnum

[Delphi]

type BackStyleEnum = (Opaque, Transparent);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

Members

Member name | Description
Opaque | Opaque background.
Transparent | Transparent background.

See Also

C1.Win.C1Report Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


BarCodeEnum Enumeration

BarCodeEnum Enumeration

Determines what type of barcode will be used in the field.

[Visual Basic]

Public Enum BarCodeEnum

[C#]

public enum BarCodeEnum

[Delphi]

type BarCodeEnum = (Codabar, Code128, Code39, Code93, CodeI2of5, Ean13, Ean8, None, PostNet);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

Remarks

Use the members of this enumeration to set the value of the BarCode property in the Field class.

Members

Member name | Description
Codabar | Numeric only, slightly denser than Code39.
Code128 | Alpha-numeric, denser than Code39 and required at least 6 characters.
Code39 | Alpha-numeric, (Code 3 of 9).
Code93 | Alpha-numeric.
CodeI2of5 | Numeric only.
Ean13 | EAN-13 barcode. EAN-13 encodes 12-digit article codes (plus one check digit created by the control).
Ean8 | EAN-8 barcode. EAN-8 encodes 7-digit article codes (plus one check digit created by the control).
None | No barcode.
PostNet | Numeric only, US Postal Service.

See Also

C1.Win.C1Report Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


BorderStyleEnum Enumeration

BorderStyleEnum Enumeration

Specifies the Field痴 border style.

[Visual Basic]

Public Enum BorderStyleEnum

[C#]

public enum BorderStyleEnum

[Delphi]

type BorderStyleEnum = (Dash, DashDot, DashDotDot, Dot, Solid, Transparent);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

Remarks

Use the members of this enumeration to set the value of the BorderStyle property in the Field class.

Members

Member name | Description
Dash | Dashed border.
DashDot | Dash-dot border.
DashDotDot | Dash-dot-dot border.
Dot | Dotted border.
Solid | Solid border.
Transparent | No border.

See Also

C1.Win.C1Report Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report Class

C1Report Class

The C1Report component generates Access-style, data-based banded reports that can be rendered directly to a printer, exported to various portable formats (including HTML, PDF, and text), or rendered into preview controls such as the Microsoft PrintPreview or ComponentOne C1PrintPreview controls.

For a list of all members of this type, see C1Report Members.

System.Object

System.MarshalByRefObject

System.ComponentModel.Component

C1.Win.C1Report.C1Report

[Visual Basic]

Public Class C1Report

Inherits Component

Implements ISupportInitialize

[C#]

public class C1Report : Component , ISupportInitialize

[Delphi]

type C1Report = class (Component, ISupportInitialize);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report Members

C1Report Members

C1Report overview

Public Constructors

C1Report Constructor

Initializes a new instance of the C1Report component.

Public Properties

Cancel | Gets or sets whether to cancel generation of the current report.
DataSource | Gets a reference to the report's DataSource object.
Document | Gets a System.Drawing.Printing.PrintDocument object that can be used to render the report to a printer or into a print preview control.
DoEvents | Gets or sets whether the control should handle Windows messages while rendering reports.
Fields | Gets the collection of Field objects in the report definition.
Font | Gets or sets the default font for new fields.
Groups | Gets a collection with all the groups in the report.
GrowShrinkMode | Gets or sets the method used to process CanGrow/CanShrink fields.
IsBusy | Gets a value that determines whether a report is currently being generated.
LabelOffset | Gets or sets the position of the first label on a partially used sheet.
Layout | Gets a reference to the report's Layout object.
MaxPages | Gets or sets the maximum number of pages allowed for a report.
OnClose | Gets or sets the VBScript that is executed when the report finishes rendering.
OnError | Gets or sets the VBScript that is executed when an error occurs.
OnNoData | Gets or sets the VBScript that is executed when the report starts rendering and its source recordset is empty.
OnOpen | Gets or sets the VBScript that is executed when the report starts rendering.
OnPage | Gets or sets the VBScript that is executed when a new page is created.
OutlineRootLevel | Gets or sets the starting outline level for the groups in this report.
Page | Gets or sets the current page number.
PageImages | Gets a list of System.Drawing.Imaging.Metafile objects that correspond to the pages in the report.
ParentReport | Gets the main report that contains this subreport (null for main reports).
ReportDefinition | Gets or sets an Xml string containing the complete report definition.
ReportName | Gets or sets the name of the report (used with the Load method).
Sections | Gets the collection of Section objects in the report definition.
Tag | Gets or sets extra data needed by the calling program.

Public Methods

AddScriptObject | Adds an object to the report's script context.
BeginInit | Signals the object that initialization is starting.
Clear | Clears the current report.
CopyFrom | Copies a report definition from another C1Report component.
EndInit | Signals the object that initialization is complete.
Evaluate | Evaluates a VBScript expression in the current report context.
Execute | Executes a VBScript statement in the current report context.
GetReportInfo | Overloaded. Gets a list of reports available in an XML report definition file.
GetReportList | Overloaded. Gets a list of reports available in an XML report definition file.
Load | Overloaded. Loads a report from an XML report definition file.
Render | Renders the report into an internal collection of images.
RenderToFile | Renders the report into a file.
RenderToFilter | Renders the report into an ExportFilter object.
RenderToStream | Overloaded. Renders the report into a System.IO.Stream object.
Save | Overloaded. Saves the current report definition to a file.

Public Events

EndPage | Fired when the control finishes rendering each page.
EndReport | Fired when the control finishes rendering the report.
EndSection | Fired when the control finishes rendering each Section.
InitializeParametersDialog | Fired before the control displays the Report Parameters dialog.
NoData | Fired when the control starts rendering a report and the source recordset is empty.
PrintSection | Fired before each Section is printed (after it is formatted.)
ReportError | Fired when an error occurs while rendering a report.
StartPage | Fired when the control starts rendering each page.
StartReport | Fired when the control starts rendering the report, before it opens the source recordset.
StartSection | Fired before each Section is formatted.

Protected Methods

Dispose | Overloaded. Overriden. Releases the resources used by the component.
OnEndPage | Raises the EndPage event.
OnEndReport | Raises the EndReport event.
OnEndSection | Raises the EndSection event.
OnNoReportData | Raises the NoData event.
OnPrintSection | Raises the PrintSection event.
OnReportError | Raises the ReportError event.
OnStartPage | Raises the StartPage event.
OnStartReport | Raises the StartReport event.
OnStartSection | Raises the StartSection event.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report Constructor

C1Report Constructor

Initializes a new instance of the C1Report component.

[Visual Basic]

Public Function New()

[C#]

public C1Report()

[Delphi]

public constructor Create();

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report Properties

C1Report Properties

The properties of the C1Report class are listed here. For a complete list of C1Report class members, see the C1Report Members topic.

Public Properties

Cancel | Gets or sets whether to cancel generation of the current report.
DataSource | Gets a reference to the report's DataSource object.
Document | Gets a System.Drawing.Printing.PrintDocument object that can be used to render the report to a printer or into a print preview control.
DoEvents | Gets or sets whether the control should handle Windows messages while rendering reports.
Fields | Gets the collection of Field objects in the report definition.
Font | Gets or sets the default font for new fields.
Groups | Gets a collection with all the groups in the report.
GrowShrinkMode | Gets or sets the method used to process CanGrow/CanShrink fields.
IsBusy | Gets a value that determines whether a report is currently being generated.
LabelOffset | Gets or sets the position of the first label on a partially used sheet.
Layout | Gets a reference to the report's Layout object.
MaxPages | Gets or sets the maximum number of pages allowed for a report.
OnClose | Gets or sets the VBScript that is executed when the report finishes rendering.
OnError | Gets or sets the VBScript that is executed when an error occurs.
OnNoData | Gets or sets the VBScript that is executed when the report starts rendering and its source recordset is empty.
OnOpen | Gets or sets the VBScript that is executed when the report starts rendering.
OnPage | Gets or sets the VBScript that is executed when a new page is created.
OutlineRootLevel | Gets or sets the starting outline level for the groups in this report.
Page | Gets or sets the current page number.
PageImages | Gets a list of System.Drawing.Imaging.Metafile objects that correspond to the pages in the report.
ParentReport | Gets the main report that contains this subreport (null for main reports).
ReportDefinition | Gets or sets an Xml string containing the complete report definition.
ReportName | Gets or sets the name of the report (used with the Load method).
Sections | Gets the collection of Section objects in the report definition.
Tag | Gets or sets extra data needed by the calling program.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.Cancel Property

C1Report.Cancel Property

Gets or sets whether to cancel generation of the current report.

[Visual Basic]

Public Property Cancel As Boolean

[C#]

public bool Cancel {get;set;}

[Delphi]

public property Cancel: Boolean read get_Cancel write set_Cancel;

Remarks

Setting this property to true while a report is being generated stops the report generation process. Any pages already created are kept in the document and can be previewed or printed by an attached print preview control.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.DataSource Property

C1Report.DataSource Property

Gets a reference to the report's DataSource object.

[Visual Basic]

Public ReadOnly Property DataSource As DataSource

[C#]

public DataSource DataSource {get;}

[Delphi]

public property DataSource: DataSource read get_DataSource;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.Document Property

C1Report.Document Property

Gets a System.Drawing.Printing.PrintDocument object that can be used to render the report to a printer or into a print preview control.

[Visual Basic]

Public ReadOnly Property Document As PrintDocument

[C#]

public PrintDocument Document {get;}

[Delphi]

public property Document: PrintDocument read get_Document;

Example

The examples below show how you can use the Document property to print the report or show it in a System.Windows.Forms.PrintPreviewDialog control.

// print the report to the default printer

_c1r.Document.Print();

// show the report in a PrintPreviewDialog

PrintPreviewDialog p = new PrintPreviewDialog():

p.Document = _c1r.Document;

p.ShowDialog();

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.DoEvents Property

C1Report.DoEvents Property

Gets or sets whether the control should handle Windows messages while rendering reports.

[Visual Basic]

Public Property DoEvents As Boolean

[C#]

public bool DoEvents {get;set;}

[Delphi]

public property DoEvents: Boolean read get_DoEvents write set_DoEvents;

Remarks

Setting this property to true allows users to resize forms, click buttons, etc. while reports are being generated. This makes applications more responsive, and is necessary if you want to provide a "Cancel Report" button (otherwise users wouldn't be able to click the button until the report was done).

Setting this property to false will cause reports to render slightly faster.

Example

The code belows implements "Render" and a "Cancel" buttons attached to a C1Report component.

The "Render" button checks whether the C1Report component is busy before starting to render a report. This is necessary because the user could click the "Render" button several times in a row, before the component got a chance to finish rendering the report. (Calling the Render method while the component is busy throws an System.Exception).

The "Cancel" button checks whether the component is rendering a report and sets the Cancel property to true.

_c1r.DoEvents = true;

private void Render_Click(object sender, EventArgs e)

{

if (_c1r.IsBusy)

{

Console.WriteLine("Cannot render now, component is busy");

}

else

{

ppv.Document = c1r.Document;

}

}

private void Cancel_Click(object sender, EventArgs e)

{

if (_c1r.IsBusy)

{

_c1r.Cancel = true;

}

else

{

Console.WriteLine("No report to cancel");

}

}

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.Fields Property

C1Report.Fields Property

Gets the collection of Field objects in the report definition.

[Visual Basic]

Public ReadOnly Property Fields As FieldCollection

[C#]

public FieldCollection Fields {get;}

[Delphi]

public property Fields: FieldCollection read get_Fields;

Remarks

The Section object also contains a collection of fields in that section.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.Font Property

C1Report.Font Property

Gets or sets the default font for new fields.

[Visual Basic]

Public Property Font As FontHolder

[C#]

public FontHolder Font {get;set;}

[Delphi]

public property Font: FontHolder read get_Font write set_Font;

Remarks

This property is not used directly when rendering the report. It is used as the default font for new fields.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.Groups Property

C1Report.Groups Property

Gets a collection with all the groups in the report.

[Visual Basic]

Public ReadOnly Property Groups As GroupCollection

[C#]

public GroupCollection Groups {get;}

[Delphi]

public property Groups: GroupCollection read get_Groups;

Remarks

The Groups collection contains all Group objects defined in the current report.

Removing a Group from the collection also removes its associated header and footer sections, as well as any fields in those sections.

Adding a Group to the collection adds the corresponding group header and footer sections to the report.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.GrowShrinkMode Property

C1Report.GrowShrinkMode Property

Gets or sets the method used to process CanGrow/CanShrink fields.

[Visual Basic]

Public Property GrowShrinkMode As GrowShrinkModeEnum

[C#]

public GrowShrinkModeEnum GrowShrinkMode {get;set;}

[Delphi]

public property GrowShrinkMode: GrowShrinkModeEnum read get_GrowShrinkMode write set_GrowShrinkMode;

Remarks

If this property is set to GrowShrinkModeEnum.C1Report, fields with CanGrow or CanShrink properties set to true will move fields directly below them when they grow or shrink. Fields located below but off to the side are not moved.

If this property is set to GrowShrinkModeEnum.Access, fields that grow or shrink will affect all fields below, even those which are not directly under the field that was modified as a result of CanGrow/CanShrink. (This is the Microsoft Access behavior).

For example, if fields are arranged in a grid layout and GrowShrinkMode is set to GrowShrinkModeEnum.Access, fields within each row will remain vertically aligned when fields above them grow or shrink.

If GrowShrinkMode is set to GrowShrinkModeEnum.C1Report, fields within each column will move independently of fields in other columns, and fields within each row will not remain vertically aligned.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.IsBusy Property

C1Report.IsBusy Property

Gets a value that determines whether a report is currently being generated.

[Visual Basic]

Public ReadOnly Property IsBusy As Boolean

[C#]

public bool IsBusy {get;}

[Delphi]

public property IsBusy: Boolean read get_IsBusy;

Remarks

Use this property to determine whether the control is currently busy generating a report.

This property is especially useful when the DoEvents property is set to true. In this case, the application continues to process user input while the control generates reports, and there is a change that the user might try to start another report before the current one is done.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.LabelOffset Property

C1Report.LabelOffset Property

Gets or sets the position of the first label on a partially used sheet.

[Visual Basic]

Public Property LabelOffset As Integer

[C#]

public int LabelOffset {get;set;}

[Delphi]

public property LabelOffset: Int32 read get_LabelOffset write set_LabelOffset;

Remarks

This property allows you to print labels on partially used label sheets. For example, if you have a sheet with 12 labels and have already used 5, set the LabelOffset property to 6 in order to skip the labels that have already been used.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.Layout Property

C1Report.Layout Property

Gets a reference to the report's Layout object.

[Visual Basic]

Public ReadOnly Property Layout As Layout

[C#]

public Layout Layout {get;}

[Delphi]

public property Layout: Layout read get_Layout;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.MaxPages Property

C1Report.MaxPages Property

Gets or sets the maximum number of pages allowed for a report.

[Visual Basic]

Public Property MaxPages As Integer

[C#]

public int MaxPages {get;set;}

[Delphi]

public property MaxPages: Int32 read get_MaxPages write set_MaxPages;

Remarks

This property is useful if you want to limit the maximum number of pages in a report.

For example, you may write a report designer with a preview window that shows only the first five pages of a report.

Setting this property to zero allows reports of any length.

You can also limit the size of reports by setting the MaxRecords property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.OnClose Property

C1Report.OnClose Property

Gets or sets the VBScript that is executed when the report finishes rendering.

[Visual Basic]

Public Property OnClose As String

[C#]

public string OnClose {get;set;}

[Delphi]

public property OnClose: String read get_OnClose write set_OnClose;

Remarks

The control also fires the EndReport event at this time.

The difference between the regular event and the VBScript property is that the handler for the regular event belongs to the application, and should thus be used to support tasks that are independent of the report. For example, to display a message on the main window when rendering finishes.

The VBScript handler in the property belongs to the report, and will be executed regardless of the application. For example, a report might contain a VBScript handler that resets global variables in the VBScript context when a report starts rendering.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.OnError Property

C1Report.OnError Property

Gets or sets the VBScript that is executed when an error occurs.

[Visual Basic]

Public Property OnError As String

[C#]

public string OnError {get;set;}

[Delphi]

public property OnError: String read get_OnError write set_OnError;

Remarks

The control also fires the ReportError event at this time.

The difference between the regular event and the VBScript property is that the handler for the regular event belongs to the application, and should thus be used to support tasks that are independent of the report. For example, to display a an application dialog box when an error occurs.

The VBScript handler in the property belongs to the report, and will be executed regardless of the application. For example, a report might contain a VBScript handler that changes the value of a field when an error occurs.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.OnNoData Property

C1Report.OnNoData Property

Gets or sets the VBScript that is executed when the report starts rendering and its source recordset is empty.

[Visual Basic]

Public Property OnNoData As String

[C#]

public string OnNoData {get;set;}

[Delphi]

public property OnNoData: String read get_OnNoData write set_OnNoData;

Remarks

The control also fires the NoData event at this time.

The difference between the regular event and the VBScript property is that the handler for the regular event belongs to the application, and should thus be used to support tasks that are independent of the report. For example, to cancel rendering reports with no data.

The VBScript handler in the property belongs to the report, and will be executed regardless of the application. For example, a report might contain a VBScript handler that changes the value of a field when the source recordset is empty.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.OnOpen Property

C1Report.OnOpen Property

Gets or sets the VBScript that is executed when the report starts rendering.

[Visual Basic]

Public Property OnOpen As String

[C#]

public string OnOpen {get;set;}

[Delphi]

public property OnOpen: String read get_OnOpen write set_OnOpen;

Remarks

The control also fires the StartReport event at this time.

The difference between the regular event and the VBScript property is that the handler for the regular event belongs to the application, and should thus be used to support tasks that are independent of the report. For example, to display a message on the main window when rendering starts.

The VBScript handler in the property belongs to the report, and will be executed regardless of the application. For example, a report might contain a VBScript handler that resets global variables in the VBScript context when a report starts rendering.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.OnPage Property

C1Report.OnPage Property

Gets or sets the VBScript that is executed when a new page is created.

[Visual Basic]

Public Property OnPage As String

[C#]

public string OnPage {get;set;}

[Delphi]

public property OnPage: String read get_OnPage write set_OnPage;

Remarks

The control also fires the StartPage event at this time.

The difference between the regular event and the VBScript property is that the handler for the regular event belongs to the application, and should thus be used to support tasks that are independent of the report. For example, to update a label showing how many pages have been rendered so far.

The VBScript handler in the property belongs to the report, and will be executed regardless of the application. For example, a report might contain a VBScript handler that updates a variable at every page break.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.OutlineRootLevel Property

C1Report.OutlineRootLevel Property

Gets or sets the starting outline level for the groups in this report.

[Visual Basic]

Public Property OutlineRootLevel As Integer

[C#]

public int OutlineRootLevel {get;set;}

[Delphi]

public property OutlineRootLevel: Int32 read get_OutlineRootLevel write set_OutlineRootLevel;

Remarks

By default, C1Report creates an outline based on the report groups. The outline starts at level zero, and is visible in PDF versions of the report.

This property allows you to start the report at a custom level, which can be useful if you are rendering multiple reports into a larger document (using C1PrintDocument for example).

You can set this property to -1 to suppress the outline.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.Page Property

C1Report.Page Property

Gets or sets the current page number.

[Visual Basic]

Public Property Page As Integer

[C#]

public int Page {get;set;}

[Delphi]

public property Page: Int32 read get_Page write set_Page;

Remarks

This property is a global variable available to VBScript expressions.

It is automatically initialized by the control with the value 1 when a report starts rendering, and it is automatically incremented after each page break.

This property is read-write, so you can reset it using scripts. For example, you can reset the current page to 1 whenever a new group starts rendering.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.PageImages Property

C1Report.PageImages Property

Gets a list of System.Drawing.Imaging.Metafile objects that correspond to the pages in the report.

[Visual Basic]

Public ReadOnly Property PageImages As ArrayList

[C#]

public ArrayList PageImages {get;}

[Delphi]

public property PageImages: ArrayList read get_PageImages;

Remarks

Use the Render method to create or refresh the page images.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.ParentReport Property

C1Report.ParentReport Property

Gets the main report that contains this subreport (null for main reports).

[Visual Basic]

Public ReadOnly Property ParentReport As C1Report

[C#]

public C1Report ParentReport {get;}

[Delphi]

public property ParentReport: C1Report read get_ParentReport;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.ReportDefinition Property

C1Report.ReportDefinition Property

Gets or sets an Xml string containing the complete report definition.

[Visual Basic]

Public Property ReportDefinition As String

[C#]

public string ReportDefinition {get;set;}

[Delphi]

public property ReportDefinition: String read get_ReportDefinition write set_ReportDefinition;

Remarks

This property can be used to store report definitions into databases, to place them in the clipboard, or to copy reports from one C1Report component to another.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.ReportName Property

C1Report.ReportName Property

Gets or sets the name of the report (used with the Load method).

[Visual Basic]

Public Property ReportName As String

[C#]

public string ReportName {get;set;}

[Delphi]

public property ReportName: String read get_ReportName write set_ReportName;

Remarks

This property identifies the report when it is saved in a report definition file.

To retrieve a report from a report definition file, use the Load (String, String) method and pass this name as a parameter.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.Sections Property

C1Report.Sections Property

Gets the collection of Section objects in the report definition.

[Visual Basic]

Public ReadOnly Property Sections As SectionCollection

[C#]

public SectionCollection Sections {get;}

[Delphi]

public property Sections: SectionCollection read get_Sections;

Remarks

This collection always contains at least five items, which correspond to the standard report sections that are always present: Detail, Header, Footer, PageHeader, and PageFooter.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.Tag Property

C1Report.Tag Property

Gets or sets extra data needed by the calling program.

[Visual Basic]

Public Property Tag As Object

[C#]

public object Tag {get;set;}

[Delphi]

public property Tag: Object read get_Tag write set_Tag;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report Methods

C1Report Methods

The methods of the C1Report class are listed here. For a complete list of C1Report class members, see the C1Report Members topic.

Public Methods

AddScriptObject | Adds an object to the report's script context.
BeginInit | Signals the object that initialization is starting.
Clear | Clears the current report.
CopyFrom | Copies a report definition from another C1Report component.
EndInit | Signals the object that initialization is complete.
Evaluate | Evaluates a VBScript expression in the current report context.
Execute | Executes a VBScript statement in the current report context.
GetReportInfo | Overloaded. Gets a list of reports available in an XML report definition file.
GetReportList | Overloaded. Gets a list of reports available in an XML report definition file.
Load | Overloaded. Loads a report from an XML report definition file.
Render | Renders the report into an internal collection of images.
RenderToFile | Renders the report into a file.
RenderToFilter | Renders the report into an ExportFilter object.
RenderToStream | Overloaded. Renders the report into a System.IO.Stream object.
Save | Overloaded. Saves the current report definition to a file.

Protected Methods

Dispose | Overloaded. Overriden. Releases the resources used by the component.
OnEndPage | Raises the EndPage event.
OnEndReport | Raises the EndReport event.
OnEndSection | Raises the EndSection event.
OnNoReportData | Raises the NoData event.
OnPrintSection | Raises the PrintSection event.
OnReportError | Raises the ReportError event.
OnStartPage | Raises the StartPage event.
OnStartReport | Raises the StartReport event.
OnStartSection | Raises the StartSection event.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.AddScriptObject Method

C1Report.AddScriptObject Method

Adds an object to the report's script context.

[Visual Basic]

Public Sub AddScriptObject( _

ByVal name As String, _

ByVal value As Object _

)

[C#]

public void AddScriptObject(

string name,

object value

);

[Delphi]

public procedure AddScriptObject(

name: String;

value: Object

);

Parameters

name

Name of the new object (case-insensitive).

value

Value of the new object.

Remarks

This method allows you to add custom objects to the context of the C1Report script interpreter.

The script interpreter context is cleared whenever a report starts rendering, so this method should always be called from the StartReport event handler.

Example

The code below uses the StartReport event to add a variable called "mainForm" to the script context. It then attaches some script to the report's OnOpen event to show the caption of the form when the report starts rendering.

private void _c1r_StartReport(object sender, System.EventArgs e)

{

_c1r.AddScriptObject("mainForm", this);

}

private void button1_Click(object sender, System.EventArgs e)

{

_c1r.OnOpen = "msgbox(mainForm.Text)";

_c1r.Render();

}

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.BeginInit Method

C1Report.BeginInit Method

Signals the object that initialization is starting.

[Visual Basic]

Overridable Public Sub BeginInit() Implements ISupportInitialize.BeginInit

[C#]

virtual public void BeginInit()

[Delphi]

public procedure BeginInit(); virtual;

Implements

ISupportInitialize.BeginInit

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.Clear Method

C1Report.Clear Method

Clears the current report.

[Visual Basic]

Public Sub Clear()

[C#]

public void Clear()

[Delphi]

public procedure Clear();

Remarks

This method removes all groups, group sections, and fields from the current report.

It also resets the DataSource and Layout objects, and clears (but does not remove) the fixed sections that all reports have: Detail, Header, Footer, PageHeader, and PageFooter.

Use this method when you want to clear a report and start creating a new one from scratch.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.CopyFrom Method

C1Report.CopyFrom Method

Copies a report definition from another C1Report component.

[Visual Basic]

Public Sub CopyFrom( _

ByVal sourceReport As C1Report _

)

[C#]

public void CopyFrom(

C1Report sourceReport

);

[Delphi]

public procedure CopyFrom(

sourceReport: C1Report

);

Parameters

sourceReport

C1Report that contains the report to be copied.

Remarks

This method is equivalent to copying the ReportDefinition property from one C1Report to another, but is substantially faster.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.Dispose Method

C1Report.Dispose Method

Releases the resources used by the component.

[Visual Basic]

Overrides Protected Sub Dispose( _

ByVal disposing As Boolean _

)

[C#]

override protected void Dispose(

bool disposing

);

[Delphi]

strict protected procedure Dispose(

disposing: Boolean

); overload; override;

Parameters

disposing

If true, managed resources as well as unmanaged resources are released; if false, only unmanaged resources are disposed.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.EndInit Method

C1Report.EndInit Method

Signals the object that initialization is complete.

[Visual Basic]

Overridable Public Sub EndInit() Implements ISupportInitialize.EndInit

[C#]

virtual public void EndInit()

[Delphi]

public procedure EndInit(); virtual;

Implements

ISupportInitialize.EndInit

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.Evaluate Method

C1Report.Evaluate Method

Evaluates a VBScript expression in the current report context.

[Visual Basic]

Public Function Evaluate( _

ByVal expression As String _

) As Object

[C#]

public object Evaluate(

string expression

);

[Delphi]

public function Evaluate(

expression: String

): Object;

Parameters

expression

A string with a VBScript expression to be evaluated.

Return Value

The value of the expression.

Remarks

Use this method to evaluate expressions as they would be evaluated while generating a report. This can be useful in designer-type applications, to provide an "Immediate Window" where users can test expressions.

If the expression string contains invalid syntax or causes an evaluation error, the control raises the ReportError event. In this case, the Handled parameter of the event is set to true, so the exception is ignored by default.

Example

Expressions may contain simple VBScript expressions such as:

Console.WriteLine(_c1r.Evaluate("2+2"));

Console.WriteLine(_c1r.Evaluate(" \"A\" & \"B\" ");

4AB

Expressions may also contain references to the Report object and all its sub-objects. For example:

Console.WriteLine(_c1r.Evaluate("Report.DataSource.RecordSource"));

Console.WriteLine(_c1r.Evaluate("Report.DataSource.Recordset.Fields.Count"));

Console.WriteLine(_c1r.Evaluate("Report.Fields(0).Name"));

SELECT * FROM Employees7FirstNameField

Finally, data fields, Field, and Section objects may be referenced directly by name.

Console.WriteLine(_c1r.Evaluate("FirstNameField.Value"));

Console.WriteLine(_c1r.Evaluate("CategoryName"));

AndrewBeverages

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.Execute Method

C1Report.Execute Method

Executes a VBScript statement in the current report context.

[Visual Basic]

Public Sub Execute( _

ByVal statement As String _

)

[C#]

public void Execute(

string statement

);

[Delphi]

public procedure Execute(

statement: String

);

Parameters

statement

A string with VBScript instructions to be executed.

Remarks

This method is similar to the Evaluate method, except it does not return a value.

If the expression string contains invalid syntax or causes an evaluation error, the control raises the ReportError event. In this case, the Handled parameter of the event is set to true, so the exception is ignored by default.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.GetReportInfo Method

C1Report.GetReportInfo Method

Overload List

Gets a list of reports available in an XML report definition file.

[Visual Basic] Overloads Public Function GetReportInfo(String) As String()

[C#] public string[] GetReportInfo(string);

[Delphi] public function GetReportInfo(String) : String[]; overload;

Gets a list of reports available in an System.Xml.XmlDocument.

[Visual Basic] Overloads Public Function GetReportInfo(XmlDocument) As String()

[C#] public string[] GetReportInfo(XmlDocument);

[Delphi] public function GetReportInfo(XmlDocument) : String[]; overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.GetReportInfo Method (String)

C1Report.GetReportInfo Method (String)

Gets a list of reports available in an XML report definition file.

[Visual Basic]

Overloads Public Function GetReportInfo( _

ByVal fileName As String _

) As String

[C#]

public string GetReportInfo(

string fileName

);

[Delphi]

public function GetReportInfo(

fileName: String

): String; overload;

Parameters

fileName

Contains the full name of the XML report definition file.

Return Value

A string array containing the names of all reports in the XML file.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.GetReportInfo Method (XmlDocument)

C1Report.GetReportInfo Method (XmlDocument)

Gets a list of reports available in an System.Xml.XmlDocument.

[Visual Basic]

Overloads Public Function GetReportInfo( _

ByVal doc As XmlDocument _

) As String

[C#]

public string GetReportInfo(

XmlDocument doc

);

[Delphi]

public function GetReportInfo(

doc: XmlDocument

): String; overload;

Parameters

doc

Reference to the System.Xml.XmlDocument that contains the reports.

Return Value

A string array containing the names of all reports in the XmlDocument.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.GetReportList Method

C1Report.GetReportList Method

Overload List

Gets a list of reports available in an XML report definition file.

[Visual Basic] Overloads Public Shared Function GetReportList(String) As String()

[C#] public static string[] GetReportList(string);

[Delphi] public class function GetReportList(String) : String[]; overload;

Gets a list of reports available in an System.Xml.XmlDocument.

[Visual Basic] Overloads Public Shared Function GetReportList(XmlDocument) As String()

[C#] public static string[] GetReportList(XmlDocument);

[Delphi] public class function GetReportList(XmlDocument) : String[]; overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.GetReportList Method (String)

C1Report.GetReportList Method (String)

Gets a list of reports available in an XML report definition file.

[Visual Basic]

Overloads Public Shared Function GetReportList( _

ByVal fileName As String _

) As String

[C#]

public static string GetReportList(

string fileName

);

[Delphi]

public class function GetReportList(

fileName: String

): String; overload;

Parameters

fileName

Contains the full name of the XML report definition file.

Return Value

A string array containing the names of all reports in the XML file.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.GetReportList Method (XmlDocument)

C1Report.GetReportList Method (XmlDocument)

Gets a list of reports available in an System.Xml.XmlDocument.

[Visual Basic]

Overloads Public Shared Function GetReportList( _

ByVal doc As XmlDocument _

) As String

[C#]

public static string GetReportList(

XmlDocument doc

);

[Delphi]

public class function GetReportList(

doc: XmlDocument

): String; overload;

Parameters

doc

Reference to System.Xml.XmlDocument object.

Return Value

A string array containing the names of all reports in the XmlDocument.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.Load Method

C1Report.Load Method

Overload List

Loads a report from an XML report definition file.

[Visual Basic] Overloads Public Sub Load(String, String)

[C#] public Load(string, string);

[Delphi] public procedure Load(String; String); overload;

Loads a report from an System.Xml.XmlDocument.

[Visual Basic] Overloads Public Sub Load(XmlDocument, String)

[C#] public Load(XmlDocument, string);

[Delphi] public procedure Load(XmlDocument; String); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.Load Method (String, String)

C1Report.Load Method (String, String)

Loads a report from an XML report definition file.

[Visual Basic]

Overloads Public Sub Load( _

ByVal fileName As String, _

ByVal reportName As String _

)

[C#]

public void Load(

string fileName,

string reportName

);

[Delphi]

public procedure Load(

fileName: String;

reportName: String

); overload;

Parameters

fileName

Full name of the XML report definition file.

reportName

Name of the report to retrieve from the file (case-insensitive).

Remarks

You can get a list of reports available in the file using the GetReportInfo (String) method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.Load Method (XmlDocument, String)

C1Report.Load Method (XmlDocument, String)

Loads a report from an System.Xml.XmlDocument.

[Visual Basic]

Overloads Public Sub Load( _

ByVal doc As XmlDocument, _

ByVal reportName As String _

)

[C#]

public void Load(

XmlDocument doc,

string reportName

);

[Delphi]

public procedure Load(

doc: XmlDocument;

reportName: String

); overload;

Parameters

doc

Reference to the System.Xml.XmlDocument that contains the reports.

reportName

Name of the report to retrieve from the file (case-insensitive).

Remarks

You can get a list of reports available in the file using the GetReportInfo (String) method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.OnEndPage Method

C1Report.OnEndPage Method

Raises the EndPage event.

[Visual Basic]

Protected Sub OnEndPage( _

ByVal e As ReportEventArgs _

)

[C#]

protected void OnEndPage(

ReportEventArgs e

);

[Delphi]

strict protected procedure OnEndPage(

e: ReportEventArgs

);

Parameters

e

ReportEventArgs that contains event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.OnEndReport Method

C1Report.OnEndReport Method

Raises the EndReport event.

[Visual Basic]

Protected Sub OnEndReport( _

ByVal e As EventArgs _

)

[C#]

protected void OnEndReport(

EventArgs e

);

[Delphi]

strict protected procedure OnEndReport(

e: EventArgs

);

Parameters

e

System.EventArgs that contains event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.OnEndSection Method

C1Report.OnEndSection Method

Raises the EndSection event.

[Visual Basic]

Protected Sub OnEndSection( _

ByVal e As ReportEventArgs _

)

[C#]

protected void OnEndSection(

ReportEventArgs e

);

[Delphi]

strict protected procedure OnEndSection(

e: ReportEventArgs

);

Parameters

e

ReportEventArgs that contains event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.OnNoReportData Method

C1Report.OnNoReportData Method

Raises the NoData event.

[Visual Basic]

Protected Sub OnNoReportData( _

ByVal e As EventArgs _

)

[C#]

protected void OnNoReportData(

EventArgs e

);

[Delphi]

strict protected procedure OnNoReportData(

e: EventArgs

);

Parameters

e

System.EventArgs that contains event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.OnPrintSection Method

C1Report.OnPrintSection Method

Raises the PrintSection event.

[Visual Basic]

Protected Sub OnPrintSection( _

ByVal e As ReportEventArgs _

)

[C#]

protected void OnPrintSection(

ReportEventArgs e

);

[Delphi]

strict protected procedure OnPrintSection(

e: ReportEventArgs

);

Parameters

e

ReportEventArgs that contains event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.OnReportError Method

C1Report.OnReportError Method

Raises the ReportError event.

[Visual Basic]

Protected Sub OnReportError( _

ByVal e As ReportEventArgs _

)

[C#]

protected void OnReportError(

ReportEventArgs e

);

[Delphi]

strict protected procedure OnReportError(

e: ReportEventArgs

);

Parameters

e

ReportEventArgs that contains event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.OnStartPage Method

C1Report.OnStartPage Method

Raises the StartPage event.

[Visual Basic]

Protected Sub OnStartPage( _

ByVal e As ReportEventArgs _

)

[C#]

protected void OnStartPage(

ReportEventArgs e

);

[Delphi]

strict protected procedure OnStartPage(

e: ReportEventArgs

);

Parameters

e

ReportEventArgs that contains event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.OnStartReport Method

C1Report.OnStartReport Method

Raises the StartReport event.

[Visual Basic]

Protected Sub OnStartReport( _

ByVal e As EventArgs _

)

[C#]

protected void OnStartReport(

EventArgs e

);

[Delphi]

strict protected procedure OnStartReport(

e: EventArgs

);

Parameters

e

System.EventArgs that contains event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.OnStartSection Method

C1Report.OnStartSection Method

Raises the StartSection event.

[Visual Basic]

Protected Sub OnStartSection( _

ByVal e As ReportEventArgs _

)

[C#]

protected void OnStartSection(

ReportEventArgs e

);

[Delphi]

strict protected procedure OnStartSection(

e: ReportEventArgs

);

Parameters

e

ReportEventArgs that contains event data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.Render Method

C1Report.Render Method

Renders the report into an internal collection of images.

[Visual Basic]

Public Sub Render()

[C#]

public void Render()

[Delphi]

public procedure Render();

Remarks

This method is called implicitly when other classes access the Document property, so you rarely have to call Render directly from your code.

In some cases, you may want to access the report as a collection of pages, exposed by the PageImages property. To ensure that the image collection is available and up-to-date, call the Render method directly.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.RenderToFile Method

C1Report.RenderToFile Method

Renders the report into a file.

[Visual Basic]

Public Sub RenderToFile( _

ByVal fileName As String, _

ByVal fmt As FileFormatEnum _

)

[C#]

public void RenderToFile(

string fileName,

FileFormatEnum fmt

);

[Delphi]

public procedure RenderToFile(

fileName: String;

fmt: FileFormatEnum

);

Parameters

fileName

Name of the file that will contain the report.

fmt

Type of file to create.

Remarks

This method causes the control to render the current report into a file. It is especially useful in server applications that create several reports in batch mode, and don't have a user interface.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.RenderToFilter Method

C1Report.RenderToFilter Method

Renders the report into an ExportFilter object.

[Visual Basic]

Public Sub RenderToFilter( _

ByVal filter As ExportFilter _

)

[C#]

public void RenderToFilter(

ExportFilter filter

);

[Delphi]

public procedure RenderToFilter(

filter: ExportFilter

);

Parameters

filter

Export filter that will render the report.

Remarks

C1Report includes several built-in export filters that allow you to export reports to HTML, PDF, RTF, Excel, and other formats.

You may create your own filters by creating classes that derive from any of these base filters.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.RenderToStream Method

C1Report.RenderToStream Method

Overload List

Renders the report into a System.IO.Stream object.

[Visual Basic] Overloads Public Sub RenderToStream(Stream, FileFormatEnum)

[C#] public RenderToStream(Stream, FileFormatEnum);

[Delphi] public procedure RenderToStream(Stream; FileFormatEnum); overload;

Renders the report into an Html System.IO.Stream.

[Visual Basic] Overloads Public Sub RenderToStream(Stream, FileFormatEnum, String, String)

[C#] public RenderToStream(Stream, FileFormatEnum, string, string);

[Delphi] public procedure RenderToStream(Stream; FileFormatEnum; String; String); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.RenderToStream Method (Stream, FileFormatEnum)

C1Report.RenderToStream Method (Stream, FileFormatEnum)

Renders the report into a System.IO.Stream object.

[Visual Basic]

Overloads Public Sub RenderToStream( _

ByVal stream As Stream, _

ByVal fmt As FileFormatEnum _

)

[C#]

public void RenderToStream(

Stream stream,

FileFormatEnum fmt

);

[Delphi]

public procedure RenderToStream(

stream: Stream;

fmt: FileFormatEnum

); overload;

Parameters

stream

Stream that will contain the report.

fmt

Report format to insert into the output stream.

Remarks

This method is especially useful in ASP.NET scenarios where you want to render reports into Html or Pdf streams, without creating temporary files.

Not all types of report can be rendered into streams. The Excel format requires OLE compound files and can only be rendered into files.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.RenderToStream Method (Stream, FileFormatEnum, String, String)

C1Report.RenderToStream Method (Stream, FileFormatEnum, String, String)

Renders the report into an Html System.IO.Stream.

[Visual Basic]

Overloads Public Sub RenderToStream( _

ByVal stream As Stream, _

ByVal fmt As FileFormatEnum, _

ByVal idPrefix As String, _

ByVal fileName As String _

)

[C#]

public void RenderToStream(

Stream stream,

FileFormatEnum fmt,

string idPrefix,

string fileName

);

[Delphi]

public procedure RenderToStream(

stream: Stream;

fmt: FileFormatEnum;

idPrefix: String;

fileName: String

); overload;

Parameters

stream

Stream that will contain the report.

fmt

Report format to insert into the output stream.

idPrefix

Unique ID used to differentiate multiple reports stored in the same stream.

fileName

Base file name used to build temporary image files.

Remarks

This method is used by the C1WebReport control to generate Html reports in ASP.NET pages.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.Save Method

C1Report.Save Method

Overload List

Saves the current report definition to a file.

[Visual Basic] Overloads Public Sub Save(String)

[C#] public Save(string);

[Delphi] public procedure Save(String); overload;

Saves the current report definition to an System.Xml.XmlTextWriter object.

[Visual Basic] Overloads Public Sub Save(XmlTextWriter)

[C#] public Save(XmlTextWriter);

[Delphi] public procedure Save(XmlTextWriter); overload;

Saves the current report definition to a file.

[Visual Basic] Overloads Public Sub Save(String, Boolean)

[C#] public Save(string, bool);

[Delphi] public procedure Save(String; Boolean); overload;

Saves the current report definition to an XmlTextWriter object.

[Visual Basic] Overloads Public Sub Save(XmlTextWriter, Boolean)

[C#] public Save(XmlTextWriter, bool);

[Delphi] public procedure Save(XmlTextWriter; Boolean); overload;

Saves the current report definition to a file.

[Visual Basic] Overloads Public Sub Save(String, Boolean, Boolean)

[C#] public Save(string, bool, bool);

[Delphi] public procedure Save(String; Boolean; Boolean); overload;

Saves the current report definition to an XmlTextWriter object.

[Visual Basic] Overloads Public Sub Save(XmlTextWriter, Boolean, Boolean)

[C#] public Save(XmlTextWriter, bool, bool);

[Delphi] public procedure Save(XmlTextWriter; Boolean; Boolean); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.Save Method (String)

C1Report.Save Method (String)

Saves the current report definition to a file.

[Visual Basic]

Overloads Public Sub Save( _

ByVal fileName As String _

)

[C#]

public void Save(

string fileName

);

[Delphi]

public procedure Save(

fileName: String

); overload;

Parameters

fileName

Full name of the file to be created (if the file already exists, it will be overwritten).

Remarks

This method does not embed pictures and subreports into the output file. It only saves subreport names and saves images in external files.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.Save Method (XmlTextWriter)

C1Report.Save Method (XmlTextWriter)

Saves the current report definition to an System.Xml.XmlTextWriter object.

[Visual Basic]

Overloads Public Sub Save( _

ByVal writer As XmlTextWriter _

)

[C#]

public void Save(

XmlTextWriter writer

);

[Delphi]

public procedure Save(

writer: XmlTextWriter

); overload;

Parameters

writer

An System.Xml.XmlTextWriter object where the report definition will be saved.

Remarks

This method does not embed pictures and subreports into the output file. It only saves subreport names and saves images in external files.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.Save Method (String, Boolean)

C1Report.Save Method (String, Boolean)

Saves the current report definition to a file.

[Visual Basic]

Overloads Public Sub Save( _

ByVal fileName As String, _

ByVal embedAll As Boolean _

)

[C#]

public void Save(

string fileName,

bool embedAll

);

[Delphi]

public procedure Save(

fileName: String;

embedAll: Boolean

); overload;

Parameters

fileName

Full name of the file to be created (if the file already exists, it will be overwritten).

embedAll

Whether to embed images and subreports into the output file.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.Save Method (XmlTextWriter, Boolean)

C1Report.Save Method (XmlTextWriter, Boolean)

Saves the current report definition to an XmlTextWriter object.

[Visual Basic]

Overloads Public Sub Save( _

ByVal writer As XmlTextWriter, _

ByVal embed As Boolean _

)

[C#]

public void Save(

XmlTextWriter writer,

bool embed

);

[Delphi]

public procedure Save(

writer: XmlTextWriter;

embed: Boolean

); overload;

Parameters

writer

An System.Xml.XmlTextWriter object where the report definition will be saved.

embed

Whether to embed images and subreports into the output stream.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.Save Method (String, Boolean, Boolean)

C1Report.Save Method (String, Boolean, Boolean)

Saves the current report definition to a file.

[Visual Basic]

Overloads Public Sub Save( _

ByVal fileName As String, _

ByVal embedPics As Boolean, _

ByVal embedSubs As Boolean _

)

[C#]

public void Save(

string fileName,

bool embedPics,

bool embedSubs

);

[Delphi]

public procedure Save(

fileName: String;

embedPics: Boolean;

embedSubs: Boolean

); overload;

Parameters

fileName

Full name of the file to be created (if the file already exists, it will be overwritten).

embedPics

Whether to embed images into the output file.

embedSubs

Whether to embed subreports into the output file.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.Save Method (XmlTextWriter, Boolean, Boolean)

C1Report.Save Method (XmlTextWriter, Boolean, Boolean)

Saves the current report definition to an XmlTextWriter object.

[Visual Basic]

Overloads Public Sub Save( _

ByVal writer As XmlTextWriter, _

ByVal embedPics As Boolean, _

ByVal embedSubs As Boolean _

)

[C#]

public void Save(

XmlTextWriter writer,

bool embedPics,

bool embedSubs

);

[Delphi]

public procedure Save(

writer: XmlTextWriter;

embedPics: Boolean;

embedSubs: Boolean

); overload;

Parameters

writer

An System.Xml.XmlTextWriter object where the report definition will be saved.

embedPics

Whether to embed images into the output stream.

embedSubs

Whether to embed subreports into the output stream.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report Events

C1Report Events

The events of the C1Report class are listed here. For a complete list of C1Report class members, see the C1Report Members topic.

Public Events

EndPage | Fired when the control finishes rendering each page.
EndReport | Fired when the control finishes rendering the report.
EndSection | Fired when the control finishes rendering each Section.
InitializeParametersDialog | Fired before the control displays the Report Parameters dialog.
NoData | Fired when the control starts rendering a report and the source recordset is empty.
PrintSection | Fired before each Section is printed (after it is formatted.)
ReportError | Fired when an error occurs while rendering a report.
StartPage | Fired when the control starts rendering each page.
StartReport | Fired when the control starts rendering the report, before it opens the source recordset.
StartSection | Fired before each Section is formatted.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.EndPage Event

C1Report.EndPage Event

Fired when the control finishes rendering each page.

[Visual Basic]

Public Event EndPage As ReportEventHandler

[C#]

public event ReportEventHandler EndPage

[Delphi]

public property EndPage: ReportEventHandler read remove_EndPage write add_EndPage;

Remarks

This event is useful for updating the user interface to show how many pages have been printed so far.

You can use the Cancel property while handling this event to cancel rendering the report. To limit the number of pages that can be printed, use the MaxPages property instead.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.EndReport Event

C1Report.EndReport Event

Fired when the control finishes rendering the report.

[Visual Basic]

Public Event EndReport As EventHandler

[C#]

public event EventHandler EndReport

[Delphi]

public property EndReport: EventHandler read remove_EndReport write add_EndReport;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.EndSection Event

C1Report.EndSection Event

Fired when the control finishes rendering each Section.

[Visual Basic]

Public Event EndSection As ReportEventHandler

[C#]

public event ReportEventHandler EndSection

[Delphi]

public property EndSection: ReportEventHandler read remove_EndSection write add_EndSection;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.InitializeParametersDialog Event

C1Report.InitializeParametersDialog Event

Fired before the control displays the Report Parameters dialog.

[Visual Basic]

Public Event InitializeParametersDialog As DialogEventHandler

[C#]

public event DialogEventHandler InitializeParametersDialog

[Delphi]

public property InitializeParametersDialog: DialogEventHandler read remove_InitializeParametersDialog write add_InitializeParametersDialog;

Remarks

Reports that have a PARAMETERS clause in their DataSource property show a dialog where the user can enter report parameters.

This event fires before the dialog is displayed and allows you to customize the dialog by changing its caption, font, colors, etc.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.NoData Event

C1Report.NoData Event

Fired when the control starts rendering a report and the source recordset is empty.

[Visual Basic]

Public Event NoData As EventHandler

[C#]

public event EventHandler NoData

[Delphi]

public property NoData: EventHandler read remove_NoData write add_NoData;

Remarks

You can use this event to cancel rendering a report when the source recordset is empty.

If you don't cancel the report, it will be rendered as an unbound report (a self-contained report with no underlying data).

Example

The code below cancels a report when it has no data:

private void c1r_NoData(object sender, EventArgs e)

{

_c1r.Cancel = true;

}

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.PrintSection Event

C1Report.PrintSection Event

Fired before each Section is printed (after it is formatted.)

[Visual Basic]

Public Event PrintSection As ReportEventHandler

[C#]

public event ReportEventHandler PrintSection

[Delphi]

public property PrintSection: ReportEventHandler read remove_PrintSection write add_PrintSection;

Remarks

When this event fires, the field values and sizes have been set by the control.

You may still make changes, but they will not affect the field layout. For example, changing a field's Text property at this point will not cause it to grow or shrink.

This event is equivalent to the OnPrint script property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.ReportError Event

C1Report.ReportError Event

Fired when an error occurs while rendering a report.

[Visual Basic]

Public Event ReportError As ReportEventHandler

[C#]

public event ReportEventHandler ReportError

[Delphi]

public property ReportError: ReportEventHandler read remove_ReportError write add_ReportError;

Remarks

The most common types of errors found when rendering reports are:

1) Invalid DataSource or DataSource parameters. This usually indicates that the system could not open the specified database (a server may be off line, or a database file may be in a different location than what was specified) or that the SQL syntax used for the DataSource property contains errors.

2) Error executing scripts or evaluating expressions. This usually indicates that the VBScript expression used contains a syntax error. In these cases, make sure you look at the exception message. It usually contains a good explanation of what caused the error.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.StartPage Event

C1Report.StartPage Event

Fired when the control starts rendering each page.

[Visual Basic]

Public Event StartPage As ReportEventHandler

[C#]

public event ReportEventHandler StartPage

[Delphi]

public property StartPage: ReportEventHandler read remove_StartPage write add_StartPage;

Remarks

This event is useful for updating the user interface to show how many pages have been printed so far.

You can use the Cancel property while handling this event to cancel rendering the report. To limit the number of pages that can be printed, use the MaxPages property instead.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.StartReport Event

C1Report.StartReport Event

Fired when the control starts rendering the report, before it opens the source recordset.

[Visual Basic]

Public Event StartReport As EventHandler

[C#]

public event EventHandler StartReport

[Delphi]

public property StartReport: EventHandler read remove_StartReport write add_StartReport;

Remarks

You can use this event to provide user feedback or to make changes to the ConnectionString and RecordSource properties.

For example, you may implement your own version of parameterized queries by asking the user to provide some information and changing the RecordSource property accordingly.

You may also use this event to assign a System.Data.DataTable object directly to the report's Recordset property. Applications that already have the report data should do this to save time by preventing C1Report from loading its own copy of the data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1Report.StartSection Event

C1Report.StartSection Event

Fired before each Section is formatted.

[Visual Basic]

Public Event StartSection As ReportEventHandler

[C#]

public event ReportEventHandler StartSection

[Delphi]

public property StartSection: ReportEventHandler read remove_StartSection write add_StartSection;

Remarks

When this event fires, the report fields have not been updated with the current values or sizes.

This is a good point to set field formatting parameters and visibility based on the current data values.

This event is equivalent to the OnFormat script property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CheckBoxEnum Enumeration

CheckBoxEnum Enumeration

Specifies how boolean values are translated into checkboxes.

[Visual Basic]

Public Enum CheckBoxEnum

[C#]

public enum CheckBoxEnum

[Delphi]

type CheckBoxEnum = (CheckBox, CrossBox, NoCheckBox, RadioButton);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

Remarks

Use the members of this enumeration to set the value of the CheckBox property in the Field class. This property is useful when you wish to display boolean values graphically, rather than using text.

Members

Member name | Description
CheckBox | Checkbox.
CrossBox | Crossbox.
NoCheckBox | No checkbox (display as text).
RadioButton | Radio button.

See Also

C1.Win.C1Report Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ColumnLayoutEnum Enumeration

ColumnLayoutEnum Enumeration

Specifies the layout for the columns (down or across).

[Visual Basic]

Public Enum ColumnLayoutEnum

[C#]

public enum ColumnLayoutEnum

[Delphi]

type ColumnLayoutEnum = (Across, Down, Labels);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

Remarks

Use the members of this enumeration to set the value of the ColumnLayout property in the Layout class.

Members

Member name | Description
Across | Columns are laid out across the page, then down.
Down | Columns are laid out down the page, then across.
Labels | Causes the report designer to discount label spacing in the design surface, hide header/footer sections, disable grouping button, and disable automatic section resizing when fields are moved or dragged.

See Also

C1.Win.C1Report Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataAccessException Class

DataAccessException Class

System.Exception that is thrown when a data access error occurs.

For a list of all members of this type, see DataAccessException Members.

System.Object

System.Exception

System.ApplicationException

C1.Win.C1Report.DataAccessException

[Visual Basic]

Public Class DataAccessException

Inherits ApplicationException

[C#]

public class DataAccessException : ApplicationException

[Delphi]

type DataAccessException = class (ApplicationException);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataAccessException Members

DataAccessException Members

DataAccessException overview

Public Constructors

DataAccessException Constructor

Initializes a new instance of the DataAccessException class.

Protected Constructors

DataAccessException Constructor

Initializes a new instance of the DataAccessException class with serialized data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataAccessException Constructor

DataAccessException Constructor

Overload List

Initializes a new instance of the DataAccessException class.

[Visual Basic] Public Function New()

[C#] public DataAccessException();

[Delphi] public constructor Create(); overload;

Initializes a new instance of the DataAccessException class with a specified error message.

[Visual Basic] Public Function New(String)

[C#] public DataAccessException(string);

[Delphi] public constructor Create(String); overload;

Initializes a new instance of the DataAccessException class with serialized data.

[Visual Basic] Protected Function New(SerializationInfo, StreamingContext)

[C#] protected DataAccessException(SerializationInfo, StreamingContext);

[Delphi] strict protected constructor Create(SerializationInfo; StreamingContext); overload;

Initializes a new instance of the DataAccessException class with a specified error message and a reference to the inner exception that is the cause of this exception.

[Visual Basic] Public Function New(String, Exception)

[C#] public DataAccessException(string, Exception);

[Delphi] public constructor Create(String; Exception); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataAccessException Constructor ()

DataAccessException Constructor ()

Initializes a new instance of the DataAccessException class.

[Visual Basic]

Public Function New()

[C#]

public DataAccessException()

[Delphi]

public constructor Create(); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataAccessException Constructor (String)

DataAccessException Constructor (String)

Initializes a new instance of the DataAccessException class with a specified error message.

[Visual Basic]

Public Function New( _

ByVal msg As String _

)

[C#]

public DataAccessException(

string msg

);

[Delphi]

public constructor Create(

msg: String

); overload;

Parameters

msg

A message that describes the error.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataAccessException Constructor (SerializationInfo, StreamingContext)

DataAccessException Constructor (SerializationInfo, StreamingContext)

Initializes a new instance of the DataAccessException class with serialized data.

[Visual Basic]

Protected Function New( _

ByVal si As SerializationInfo, _

ByVal sc As StreamingContext _

)

[C#]

protected DataAccessException(

SerializationInfo si,

StreamingContext sc

);

[Delphi]

strict protected constructor Create(

si: SerializationInfo;

sc: StreamingContext

); overload;

Parameters

si

The object that holds the serialized object data.

sc

The contextual information about the source or destination.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataAccessException Constructor (String, Exception)

DataAccessException Constructor (String, Exception)

Initializes a new instance of the DataAccessException class with a specified error message and a reference to the inner exception that is the cause of this exception.

[Visual Basic]

Public Function New( _

ByVal msg As String, _

ByVal x As Exception _

)

[C#]

public DataAccessException(

string msg,

Exception x

);

[Delphi]

public constructor Create(

msg: String;

x: Exception

); overload;

Parameters

msg

The error message that explains the reason for the exception.

x

The exception that is the cause of the current exception.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataSource Class

DataSource Class

Provides data for reports.

For a list of all members of this type, see DataSource Members.

System.Object

C1.Win.C1Report.DataSource

[Visual Basic]

Public Class DataSource

[C#]

public class DataSource

[Delphi]

type DataSource = class;

Remarks

Most reports specify their data sources by setting the ConnectionString and RecordSource properties. The DataSource object uses these values to connect to a database and retrieve the report data.

Alternatively, you can assign data objects directly to the Recordset property. This approach is more efficient in scenarios where the data has already been loaded by the application for other purposes, and can be used in the report directly instead of loading a copy.

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataSource Members

DataSource Members

DataSource overview

Public Properties

CommandTimeOut | Gets or sets the number of seconds to wait before the data connection times out (set to -1 to use the default value, usually 30s).
ConnectionString | Gets or sets the string used to open a database.
Filter | Gets or sets the expression used to filter which data rows are included in the report.
MaxRecords | Gets or sets the maximum number of data rows to be included in the report (set to zero to include all rows).
ParentReport | Gets the report that contains this DataSource.
Recordset | Sets or gets the data source object that provides data to the report.
RecordSource | Gets or sets a string that specifies which table, stored procedure, or Sql command to use for retrieving the report data.

Public Methods

BOF | Returns true if the cursor is pointing at the first record in the data source.
EOF | Returns true if the cursor is pointing at the last record in the data source.
GetBookmark | Returns the current cursor position.
GetFieldValue | Gets the value of the given field, at the cursor position.
GetRecordSource | Processes the PARAMETERS clause in the RecordSource string and returns the result.
MoveFirst | Moves the cursor to the first record in the data source.
MoveLast | Moves the cursor to the last record in the data source.
MoveNext | Moves the cursor to the next record in the data source.
MovePrevious | Moves the cursor to the previous record in the data source.
SetBookmark | Sets the current cursor position to supplied value.
ToString | Overriden. Returns a string representation of DataSource object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataSource Properties

DataSource Properties

The properties of the DataSource class are listed here. For a complete list of DataSource class members, see the DataSource Members topic.

Public Properties

CommandTimeOut | Gets or sets the number of seconds to wait before the data connection times out (set to -1 to use the default value, usually 30s).
ConnectionString | Gets or sets the string used to open a database.
Filter | Gets or sets the expression used to filter which data rows are included in the report.
MaxRecords | Gets or sets the maximum number of data rows to be included in the report (set to zero to include all rows).
ParentReport | Gets the report that contains this DataSource.
Recordset | Sets or gets the data source object that provides data to the report.
RecordSource | Gets or sets a string that specifies which table, stored procedure, or Sql command to use for retrieving the report data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataSource.CommandTimeOut Property

DataSource.CommandTimeOut Property

Gets or sets the number of seconds to wait before the data connection times out (set to -1 to use the default value, usually 30s).

[Visual Basic]

Public Property CommandTimeOut As Integer

[C#]

public int CommandTimeOut {get;set;}

[Delphi]

public property CommandTimeOut: Int32 read get_CommandTimeOut write set_CommandTimeOut;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataSource.ConnectionString Property

DataSource.ConnectionString Property

Gets or sets the string used to open a database.

[Visual Basic]

Public Property ConnectionString As String

[C#]

public string ConnectionString {get;set;}

[Delphi]

public property ConnectionString: String read get_ConnectionString write set_ConnectionString;

Remarks

The ConnectionString is used by the DataSource class to load the report data.

The DataSource class uses an System.Data.OleDb.OleDbConnection object to retrieve the data, so the syntax for the ConnectionString is the one used OleDb connection strings. For details on the syntax, see the documentation for the System.Data.OleDb.OleDbConnection class.

The ConnectionString specifies the database that contains the report data. The RecordSource property specifies which table, stored procedure, or Sql command to use for retrieveing the data.

If you want to use a different type of connection (e.g. a System.Data.SqlClient.SqlConnection, or if your application already has the data available in a System.Data.DataTable object, you can assign the data directly to the Recordset property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataSource.Filter Property

DataSource.Filter Property

Gets or sets the expression used to filter which data rows are included in the report.

[Visual Basic]

Public Property Filter As String

[C#]

public string Filter {get;set;}

[Delphi]

public property Filter: String read get_Filter write set_Filter;

Remarks

Use the Filter property to restrict the records that you want to include in a report without modifying the RecordSource property.

Using a filter is similar to specifying a WHERE clause in the SQL statement assigned to the RecordSource property. Both techniques will filter the data according to the condidtion specified. The difference is that the Filter property is applied to a table that has already been loaded in memory, while the WHERE statement causes only the filtered records to be loaded from the database into memory.

When creating reports that include only small subsets large tables, the WHERE statement is a better option, because it doesn't require the entire table to be loaded into memory. On the other hand, if the table has already been loaded in memory, the Filter property is a better option, since it does not require any additional data to be loaded.

The syntax for the filter expression is the same used to specify the System.Data.DataView.RowFilter property for System.Data.DataView objects. The expressions consist of conditions in the form ColumnNameOperatorValue, where ColumnName is the name of a column in the data source (optionally enclosed in square brackets), Operator is one of the regular Visual Basic comparison operators, and Value is a literal enclosed in single quotes. Conditions may be concatenated using AND and OR operators.

Example

The code below shows how to apply a filter to a data source using the Filter property and using a WHERE clause in a SQL statement:

if (useFilterProperty)

{

// load all records, filter in memory

_c1r.DataSource.RecordSource = "SELECT * from Employees";

_c1r.DataSource.Filter = "HireDate >= '1/1/1993' AND Country = 'UK'";

}

else

{

// load selected records only

_c1r.DataSource.RecordSource = "SELECT * from Employees " +

"WHERE HireDate >= #1/1/1993# AND Country = 'UK'";

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataSource.MaxRecords Property

DataSource.MaxRecords Property

Gets or sets the maximum number of data rows to be included in the report (set to zero to include all rows).

[Visual Basic]

Public Property MaxRecords As Integer

[C#]

public int MaxRecords {get;set;}

[Delphi]

public property MaxRecords: Int32 read get_MaxRecords write set_MaxRecords;

Remarks

This property is useful if you want to limit the size of a report. For example, you may write a report designer with a preview window that shows only the first 500 records from the database.

Setting this property to zero causes the control to retrieve all records.

You can also limit the size of reports by setting the MaxPages property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataSource.ParentReport Property

DataSource.ParentReport Property

Gets the report that contains this DataSource.

[Visual Basic]

Public ReadOnly Property ParentReport As C1Report

[C#]

public C1Report ParentReport {get;}

[Delphi]

public property ParentReport: C1Report read get_ParentReport;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataSource.Recordset Property

DataSource.Recordset Property

Sets or gets the data source object that provides data to the report.

[Visual Basic]

Public Property Recordset As Object

[C#]

public object Recordset {get;set;}

[Delphi]

public property Recordset: Object read get_Recordset write set_Recordset;

Property Value

You can assign objects of the following types to the Recordset property: (1) System.Data.DataTable objects, (2) System.Data.DataView objects, or (3) any object that implements the IC1ReportRecordset interface.

Remarks

Usually, the control creates a System.Data.DataTable object based on the value of the ConnectionString and RecordSource properties, and uses that object as the report data source.

Alternatively, you may want to create the data source object yourself, and assign it to the control. You can do that by assigning your data source object to the Recordset property. You can assign objects of the following types to the Recordset property: (1) System.Data.DataTable objects, (2) System.Data.DataView objects, or (3) any object that implements the IC1ReportRecordset interface.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataSource.RecordSource Property

DataSource.RecordSource Property

Gets or sets a string that specifies which table, stored procedure, or Sql command to use for retrieving the report data.

[Visual Basic]

Public Property RecordSource As String

[C#]

public string RecordSource {get;set;}

[Delphi]

public property RecordSource: String read get_RecordSource write set_RecordSource;

Remarks

The ConnectionString specifies the database that contains the report data. The RecordSource property specifies which table, stored procedure, or Sql command to use for retrieveing the data.

If you want to use a different type of connection (e.g. a System.Data.SqlClient.SqlConnection, or if your application already has the data available in a System.Data.DataTable object, you can assign the data directly to the Recordset property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataSource Methods

DataSource Methods

The methods of the DataSource class are listed here. For a complete list of DataSource class members, see the DataSource Members topic.

Public Methods

BOF | Returns true if the cursor is pointing at the first record in the data source.
EOF | Returns true if the cursor is pointing at the last record in the data source.
GetBookmark | Returns the current cursor position.
GetFieldValue | Gets the value of the given field, at the cursor position.
GetRecordSource | Processes the PARAMETERS clause in the RecordSource string and returns the result.
MoveFirst | Moves the cursor to the first record in the data source.
MoveLast | Moves the cursor to the last record in the data source.
MoveNext | Moves the cursor to the next record in the data source.
MovePrevious | Moves the cursor to the previous record in the data source.
SetBookmark | Sets the current cursor position to supplied value.
ToString | Overriden. Returns a string representation of DataSource object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataSource.BOF Method

DataSource.BOF Method

Returns true if the cursor is pointing at the first record in the data source.

[Visual Basic]

Public Function BOF() As Boolean

[C#]

public bool BOF()

[Delphi]

public function BOF(): Boolean;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataSource.EOF Method

DataSource.EOF Method

Returns true if the cursor is pointing at the last record in the data source.

[Visual Basic]

Public Function EOF() As Boolean

[C#]

public bool EOF()

[Delphi]

public function EOF(): Boolean;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataSource.GetBookmark Method

DataSource.GetBookmark Method

Returns the current cursor position.

[Visual Basic]

Public Function GetBookmark() As Integer

[C#]

public int GetBookmark()

[Delphi]

public function GetBookmark(): Int32;

Return Value

Index of current record.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataSource.GetFieldValue Method

DataSource.GetFieldValue Method

Gets the value of the given field, at the cursor position.

[Visual Basic]

Public Function GetFieldValue( _

ByVal fieldIndex As Integer _

) As Object

[C#]

public object GetFieldValue(

int fieldIndex

);

[Delphi]

public function GetFieldValue(

fieldIndex: Int32

): Object;

Parameters

fieldIndex

Index of the field.

Return Value

Value of the field.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataSource.GetRecordSource Method

DataSource.GetRecordSource Method

Processes the PARAMETERS clause in the RecordSource string and returns the result.

[Visual Basic]

Public Function GetRecordSource( _

ByVal prompt As Boolean _

) As String

[C#]

public string GetRecordSource(

bool prompt

);

[Delphi]

public function GetRecordSource(

prompt: Boolean

): String;

Parameters

prompt

If set to true, user will be prompted for the parameters before the method returns. If set to false, the default values will be used.

Return Value

The string (SQL statement or table name) that can be used to open a recordset.

Remarks

This property is related to the RecordSource property. The RecordSource property sets or returns a string that specifies the source dataset for the report, and it may contain a PARAMETERS clause that causes C1Report to prompt the user for information.

If you wanted to use the value of the RecordSource property to open a dataset directly from your program, you would have to parse the PARAMETERS clause yourself.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataSource.MoveFirst Method

DataSource.MoveFirst Method

Moves the cursor to the first record in the data source.

[Visual Basic]

Public Sub MoveFirst()

[C#]

public void MoveFirst()

[Delphi]

public procedure MoveFirst();

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataSource.MoveLast Method

DataSource.MoveLast Method

Moves the cursor to the last record in the data source.

[Visual Basic]

Public Sub MoveLast()

[C#]

public void MoveLast()

[Delphi]

public procedure MoveLast();

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataSource.MoveNext Method

DataSource.MoveNext Method

Moves the cursor to the next record in the data source.

[Visual Basic]

Public Sub MoveNext()

[C#]

public void MoveNext()

[Delphi]

public procedure MoveNext();

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataSource.MovePrevious Method

DataSource.MovePrevious Method

Moves the cursor to the previous record in the data source.

[Visual Basic]

Public Sub MovePrevious()

[C#]

public void MovePrevious()

[Delphi]

public procedure MovePrevious();

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataSource.SetBookmark Method

DataSource.SetBookmark Method

Sets the current cursor position to supplied value.

[Visual Basic]

Public Sub SetBookmark( _

ByVal bkmk As Integer _

)

[C#]

public void SetBookmark(

int bkmk

);

[Delphi]

public procedure SetBookmark(

bkmk: Int32

);

Parameters

bkmk

Index of record.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataSource.ToString Method

DataSource.ToString Method

Returns a string representation of DataSource object.

[Visual Basic]

Overrides Public Function ToString() As String

[C#]

override public string ToString()

[Delphi]

public function ToString(): String; override;

Return Value

The value of RecordSource property if supplied by the user, or "(none)" otherwise.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DialogEventArgs Class

DialogEventArgs Class

Provides data for InitializeParametersDialog event.

For a list of all members of this type, see DialogEventArgs Members.

System.Object

System.EventArgs

C1.Win.C1Report.DialogEventArgs

[Visual Basic]

Public Class DialogEventArgs

Inherits EventArgs

[C#]

public class DialogEventArgs : EventArgs

[Delphi]

type DialogEventArgs = class (EventArgs);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DialogEventArgs Members

DialogEventArgs Members

DialogEventArgs overview

Public Fields

Dialog

Reference to a System.Windows.Forms.Form that is about to be displayed.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DialogEventArgs Fields

DialogEventArgs Fields

The fields of the DialogEventArgs class are listed here. For a complete list of DialogEventArgs class members, see the DialogEventArgs Members topic.

Public Fields

Dialog

Reference to a System.Windows.Forms.Form that is about to be displayed.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DialogEventArgs.Dialog Field

DialogEventArgs.Dialog Field

Reference to a System.Windows.Forms.Form that is about to be displayed.

[Visual Basic]

Public ReadOnly Dialog As Form

[C#]

public readonly Form Dialog

[Delphi]

public Dialog: Form;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DialogEventHandler Delegate

DialogEventHandler Delegate

Represents the method that will handle the InitializeParametersDialog event.

[Visual Basic]

Public Delegate Sub DialogEventHandler( _

ByVal sender As Object, _

ByVal e As DialogEventArgs _

)

[C#]

public delegate void DialogEventHandler(

object sender,

DialogEventArgs e

);

[Delphi]

type DialogEventHandler = procedure (

sender: Object;

e: DialogEventArgs

) of object;

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

C1.Win.C1Report Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ExportFilter Class

ExportFilter Class

Base class for all export filters, used with the RenderToFilter method to render reports into different formats.

For a list of all members of this type, see ExportFilter Members.

System.Object

C1.Win.C1Report.ExportFilter

C1.Win.C1Report.HtmlFilter

C1.Win.C1Report.PdfFilter

C1.Win.C1Report.RtfFilter

C1.Win.C1Report.TextFilter

C1.Win.C1Report.TiffFilter

C1.Win.C1Report.XlsFilter

[Visual Basic]

MustInherit Public Class ExportFilter

Implements IDisposable

[C#]

public abstract class ExportFilter : IDisposable

[Delphi]

type ExportFilter = class abstract (TObject, IDisposable);

Remarks

ExportFilter is an abstract class used as a base class for all the built-in export filter classes, HtmlFilter, PdfFilter, RtfFilter, XlsFilter, TextFilter, and TiffFilter.

You can write your own export filters by deriving from ExportFilter.

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ExportFilter Members

ExportFilter Members

ExportFilter overview

Public Constructors

ExportFilter Constructor

Initializes a new instance of the ExportFilter class.

Public Methods

AddOutlineEntry | Called when the component renders the beginning of a report group.
Dispose | Releases the resources used by the filter.
EndReport | Called when the component finishes rendering a report.
EndSection | Called when the component finishes rendering each Section.
IsPaged | Determines whether this filter generates single or multi-page reports.
NewPage | Called after each page break on paged reports (see the IsPaged property).
RenderField | Called when the component needs to render a report field with specific content at a specific position on the current page.
StartOverlays | Called after the component has finished rendering the first pass of the report, and before it starts rendering overlay fields.
StartReport | Called when the component starts rendering a report.
StartSection | Called when the component starts rendering a section.
UsesImages | Returns a value that determines whether the filter requires page images to be generated.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ExportFilter Constructor

ExportFilter Constructor

Initializes a new instance of the ExportFilter class.

[Visual Basic]

Public Function New()

[C#]

public ExportFilter()

[Delphi]

public constructor Create();

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ExportFilter Methods

ExportFilter Methods

The methods of the ExportFilter class are listed here. For a complete list of ExportFilter class members, see the ExportFilter Members topic.

Public Methods

AddOutlineEntry | Called when the component renders the beginning of a report group.
Dispose | Releases the resources used by the filter.
EndReport | Called when the component finishes rendering a report.
EndSection | Called when the component finishes rendering each Section.
IsPaged | Determines whether this filter generates single or multi-page reports.
NewPage | Called after each page break on paged reports (see the IsPaged property).
RenderField | Called when the component needs to render a report field with specific content at a specific position on the current page.
StartOverlays | Called after the component has finished rendering the first pass of the report, and before it starts rendering overlay fields.
StartReport | Called when the component starts rendering a report.
StartSection | Called when the component starts rendering a section.
UsesImages | Returns a value that determines whether the filter requires page images to be generated.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ExportFilter.AddOutlineEntry Method

ExportFilter.AddOutlineEntry Method

Called when the component renders the beginning of a report group.

[Visual Basic]

Overridable Public Sub AddOutlineEntry( _

ByVal heading As String, _

ByVal level As Integer, _

ByVal x As Double, _

ByVal y As Double _

)

[C#]

virtual public void AddOutlineEntry(

string heading,

int level,

Double x,

Double y

);

[Delphi]

public procedure AddOutlineEntry(

heading: String;

level: Int32;

x: Double;

y: Double

); virtual;

Parameters

heading

Outline header.

level

Outline level.

x

Left position of the outline, in twips.

y

Top position of the outline, in twips.

Remarks

This method allows the filter to build a report outline.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ExportFilter.Dispose Method

ExportFilter.Dispose Method

Releases the resources used by the filter.

[Visual Basic]

Overridable Public Sub Dispose() Implements IDisposable.Dispose

[C#]

virtual public void Dispose()

[Delphi]

public procedure Dispose(); virtual;

Implements

IDisposable.Dispose

Remarks

Override this method in derived classes to free any disposable objects used by the filter.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ExportFilter.EndReport Method

ExportFilter.EndReport Method

Called when the component finishes rendering a report.

[Visual Basic]

Overridable Public Sub EndReport()

[C#]

virtual public void EndReport()

[Delphi]

public procedure EndReport(); virtual;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ExportFilter.EndSection Method

ExportFilter.EndSection Method

Called when the component finishes rendering each Section.

[Visual Basic]

Overridable Public Sub EndSection( _

ByVal section As Section _

)

[C#]

virtual public void EndSection(

Section section

);

[Delphi]

public procedure EndSection(

section: Section

); virtual;

Parameters

section

Section that was rendered.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ExportFilter.IsPaged Method

ExportFilter.IsPaged Method

Determines whether this filter generates single or multi-page reports.

[Visual Basic]

Overridable Public Function IsPaged() As Boolean

[C#]

virtual public bool IsPaged()

[Delphi]

public function IsPaged(): Boolean; virtual;

Return Value

True if report is paged.

Remarks

When generating paged reports, the component calls the filter's NewPage method on page breaks and updates the value of the Page property.

When generating non-paged (continuous) reports, only one long page is generated.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ExportFilter.NewPage Method

ExportFilter.NewPage Method

Called after each page break on paged reports (see the IsPaged property).

[Visual Basic]

Overridable Public Sub NewPage()

[C#]

virtual public void NewPage()

[Delphi]

public procedure NewPage(); virtual;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ExportFilter.RenderField Method

ExportFilter.RenderField Method

Called when the component needs to render a report field with specific content at a specific position on the current page.

[Visual Basic]

Overridable Public Sub RenderField( _

ByVal field As Field, _

ByVal rc As Rectangle, _

ByVal text As String, _

ByVal img As Image _

)

[C#]

virtual public void RenderField(

Field field,

Rectangle rc,

string text,

Image img

);

[Delphi]

public procedure RenderField(

field: Field;

rc: Rectangle;

text: String;

img: Image

); virtual;

Parameters

field

Field object to render.

rc

Rectangle that determines the field position on the page, in twips.

text

Field text to render.

img

Field image to render.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ExportFilter.StartOverlays Method

ExportFilter.StartOverlays Method

Called after the component has finished rendering the first pass of the report, and before it starts rendering overlay fields.

[Visual Basic]

Overridable Public Sub StartOverlays()

[C#]

virtual public void StartOverlays()

[Delphi]

public procedure StartOverlays(); virtual;

Remarks

Overlay fields are used only in reports that contain calculated fields which use the Pages property.

This value is not known until the report has been generated, and is therefore rendered on a second pass.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ExportFilter.StartReport Method

ExportFilter.StartReport Method

Called when the component starts rendering a report.

[Visual Basic]

Overridable Public Sub StartReport( _

ByVal report As C1Report _

)

[C#]

virtual public void StartReport(

C1Report report

);

[Delphi]

public procedure StartReport(

report: C1Report

); virtual;

Parameters

report

Owner report.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ExportFilter.StartSection Method

ExportFilter.StartSection Method

Called when the component starts rendering a section.

[Visual Basic]

Overridable Public Sub StartSection( _

ByVal section As Section, _

ByVal x As Double, _

ByVal y As Double _

)

[C#]

virtual public void StartSection(

Section section,

Double x,

Double y

);

[Delphi]

public procedure StartSection(

section: Section;

x: Double;

y: Double

); virtual;

Parameters

section

The Section to render.

x

Left position of the section, in twips.

y

Top position of the section, in twips.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ExportFilter.UsesImages Method

ExportFilter.UsesImages Method

Returns a value that determines whether the filter requires page images to be generated.

[Visual Basic]

Overridable Public Function UsesImages() As Boolean

[C#]

virtual public bool UsesImages()

[Delphi]

public function UsesImages(): Boolean; virtual;

Return Value

True if the filter requires page images.

Remarks

By default, C1Report will render the report into the filter and also into its own PageImages collection.

Some filters use these images to generate their output (e.g. PDF, TIFF). Other filters don't need the images (e.g. HTML, RTF) and therefore this method returns false, which saves some resources while rendering long reports.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field Class

Field Class

Displays individual data items in a report.

For a list of all members of this type, see Field Members.

System.Object

C1.Win.C1Report.Field

[Visual Basic]

Public Class Field

Implements ICloneable

[C#]

public class Field : ICloneable

[Delphi]

type Field = class (TObject, ICloneable);

Remarks

Every element visible in a report is represented by a Field object. Fields can display text, images, expressions, lines, rectangles, or subreports.

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field Members

Field Members

Field overview

Public Constructors

Field Constructor

Initializes a new instance of the Field class.

Public Properties

Align | Gets or sets how text is aligned within the field.
Anchor | Gets or sets the field's vertical position relative to its containing Section.
BackColor | Gets or sets the field's background color.
BarCode | Allows fields to be rendered in barcode format.
BorderColor | Gets or sets the field's border color.
BorderStyle | Gets or sets the field's border style.
Bounds | Gets or sets the field's size and location within the section, in twips.
Calculated | Gets or sets whether the Text property should be interpreted as a literal value or as a calculated expression.
CanGrow | Gets or sets whether the field height should be automatically increased to fit the field's contents.
CanShrink | Gets or sets whether the field height should be automatically reduced to fit the field's contents.
CheckBox | Gets or sets whether the field should be displayed as a checkbox.
Font | Gets or sets the field's font.
ForcePageBreak | Gets or sets whether to insert page breaks before or after the field.
ForeColor | Gets or sets the field's foreground color.
Format | Gets or sets a string used to format the field value.
Height | Gets or sets the height of the field in twips.
HideDuplicates | Gets or sets whether duplicate values in consecutive records should be suppressed.
Index | Returns the position of the field in the parent report's Fields collection.
KeepTogether | Gets or sets whether the field should be kept together on a page.
Left | Gets or sets the x-coordinate of the field's left edge in twips.
LineSlant | Gets or sets whether a line should be drawn across the field (as opposed to a box around the field).
LineSpacing | Gets or sets the line spacing between text lines in the field, in twips.
LineWidth | Gets or sets the width of the field's border or line.
LinkTarget | Gets or sets an expression that evaluates to a URL to be visited when the field is clicked.
LinkValue | Returns the value of the LinkTarget expression.
Location | Gets or sets the field's location within the section, in twips.
MarginBottom | Gets or sets the spacing between the bottom edge of the field and its content, in twips.
MarginLeft | Gets or sets the spacing between the left edge of the field and its content, in twips.
MarginRight | Gets or sets the spacing between the right edge of the field and its content, in twips.
MarginTop | Gets or sets the spacing between the top edge of the field and its content, in twips.
Name | Gets or sets the field name.
ParentReport | Gets the C1Report that contains this field.
ParentSection | Gets the Section that contains this field.
Picture | Gets or sets a picture to display on the field.
PictureAlign | Gets or sets how field pictures should be the aligned.
PictureScale | Gets or sets how images should be the scaled to fit within the field area.
RenderHeight | Gets the height of the field in twips after the CanGrow and CanShrink properties have been applied to the field.
RenderTop | Gets or sets the y-coordinate of the field's top edge in twips after the CanGrow and CanShrink properties have been applied to the containing Section.
RTF | Gets or sets whether the field should render string enclosed in curly brackets as RTF.
RunningSum | Gets or sets whether to show a running sum for the field.
Section | Gets or sets the section to which the field belongs.
Size | Gets or sets the field's size, in twips.
Subreport | Gets or sets a reference to another report to be rendered within the field (a subreport).
SubreportHasData | Returns whether a subreport has data and suppresses rendering if it doesn't.
Tag | Gets or sets extra data needed by the calling program.
Text | Gets or sets the field's text.
TextDirection | Gets or sets the direction of the text within the field.
Top | Gets or sets the y-coordinate of the field's top edge in twips.
Value | Gets or sets the field's calculated value.
Visible | Gets or sets whether the Field will be rendered in the report.
Width | Gets or sets the width of the field in twips.
WordWrap | Gets or sets whether the field's contents should be allowed to wrap within the field rectangle.
ZOrder | Gets or sets the ZOrder for the field.

Public Methods

Clone | Creates a new object that is a copy of the current Field object.
SetZOrder | Brings a field to the front or sends it to the back of the ZOrder.
ToString | Overriden. Returns a description of the field (name, location, size).

Protected Methods

GetRenderContent

Selects the text or image that will be rendered by the field.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field Constructor

Field Constructor

Initializes a new instance of the Field class.

[Visual Basic]

Public Function New()

[C#]

public Field()

[Delphi]

public constructor Create(); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field Properties

Field Properties

The properties of the Field class are listed here. For a complete list of Field class members, see the Field Members topic.

Public Properties

Align | Gets or sets how text is aligned within the field.
Anchor | Gets or sets the field's vertical position relative to its containing Section.
BackColor | Gets or sets the field's background color.
BarCode | Allows fields to be rendered in barcode format.
BorderColor | Gets or sets the field's border color.
BorderStyle | Gets or sets the field's border style.
Bounds | Gets or sets the field's size and location within the section, in twips.
Calculated | Gets or sets whether the Text property should be interpreted as a literal value or as a calculated expression.
CanGrow | Gets or sets whether the field height should be automatically increased to fit the field's contents.
CanShrink | Gets or sets whether the field height should be automatically reduced to fit the field's contents.
CheckBox | Gets or sets whether the field should be displayed as a checkbox.
Font | Gets or sets the field's font.
ForcePageBreak | Gets or sets whether to insert page breaks before or after the field.
ForeColor | Gets or sets the field's foreground color.
Format | Gets or sets a string used to format the field value.
Height | Gets or sets the height of the field in twips.
HideDuplicates | Gets or sets whether duplicate values in consecutive records should be suppressed.
Index | Returns the position of the field in the parent report's Fields collection.
KeepTogether | Gets or sets whether the field should be kept together on a page.
Left | Gets or sets the x-coordinate of the field's left edge in twips.
LineSlant | Gets or sets whether a line should be drawn across the field (as opposed to a box around the field).
LineSpacing | Gets or sets the line spacing between text lines in the field, in twips.
LineWidth | Gets or sets the width of the field's border or line.
LinkTarget | Gets or sets an expression that evaluates to a URL to be visited when the field is clicked.
LinkValue | Returns the value of the LinkTarget expression.
Location | Gets or sets the field's location within the section, in twips.
MarginBottom | Gets or sets the spacing between the bottom edge of the field and its content, in twips.
MarginLeft | Gets or sets the spacing between the left edge of the field and its content, in twips.
MarginRight | Gets or sets the spacing between the right edge of the field and its content, in twips.
MarginTop | Gets or sets the spacing between the top edge of the field and its content, in twips.
Name | Gets or sets the field name.
ParentReport | Gets the C1Report that contains this field.
ParentSection | Gets the Section that contains this field.
Picture | Gets or sets a picture to display on the field.
PictureAlign | Gets or sets how field pictures should be the aligned.
PictureScale | Gets or sets how images should be the scaled to fit within the field area.
RenderHeight | Gets the height of the field in twips after the CanGrow and CanShrink properties have been applied to the field.
RenderTop | Gets or sets the y-coordinate of the field's top edge in twips after the CanGrow and CanShrink properties have been applied to the containing Section.
RTF | Gets or sets whether the field should render string enclosed in curly brackets as RTF.
RunningSum | Gets or sets whether to show a running sum for the field.
Section | Gets or sets the section to which the field belongs.
Size | Gets or sets the field's size, in twips.
Subreport | Gets or sets a reference to another report to be rendered within the field (a subreport).
SubreportHasData | Returns whether a subreport has data and suppresses rendering if it doesn't.
Tag | Gets or sets extra data needed by the calling program.
Text | Gets or sets the field's text.
TextDirection | Gets or sets the direction of the text within the field.
Top | Gets or sets the y-coordinate of the field's top edge in twips.
Value | Gets or sets the field's calculated value.
Visible | Gets or sets whether the Field will be rendered in the report.
Width | Gets or sets the width of the field in twips.
WordWrap | Gets or sets whether the field's contents should be allowed to wrap within the field rectangle.
ZOrder | Gets or sets the ZOrder for the field.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.Align Property

Field.Align Property

Gets or sets how text is aligned within the field.

[Visual Basic]

Public Property Align As FieldAlignEnum

[C#]

public FieldAlignEnum Align {get;set;}

[Delphi]

public property Align: FieldAlignEnum read get_Align write set_Align;

Remarks

This property determines how text is aligned within the field.

To control picture alignment, use the PictureAlign property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.Anchor Property

Field.Anchor Property

Gets or sets the field's vertical position relative to its containing Section.

[Visual Basic]

Public Property Anchor As AnchorEnum

[C#]

public AnchorEnum Anchor {get;set;}

[Delphi]

public property Anchor: AnchorEnum read get_Anchor write set_Anchor;

Remarks

Normally, fields do not move when sections grow or shrink. In some cases, however, you may want fields to grow with the section or to stay in the same position relative to the bottom of the section.

This is especially common for fields used to create vertical lines that should extend the entire height of the section.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.BackColor Property

Field.BackColor Property

Gets or sets the field's background color.

[Visual Basic]

Public Property BackColor As Color

[C#]

public Color BackColor {get;set;}

[Delphi]

public property BackColor: Color read get_BackColor write set_BackColor;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.BarCode Property

Field.BarCode Property

Allows fields to be rendered in barcode format.

[Visual Basic]

Public Property BarCode As BarCodeEnum

[C#]

public BarCodeEnum BarCode {get;set;}

[Delphi]

public property BarCode: BarCodeEnum read get_BarCode write set_BarCode;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.BorderColor Property

Field.BorderColor Property

Gets or sets the field's border color.

[Visual Basic]

Public Property BorderColor As Color

[C#]

public Color BorderColor {get;set;}

[Delphi]

public property BorderColor: Color read get_BorderColor write set_BorderColor;

Remarks

To draw a border around a field, set the following properties:

BorderColor to define the border color.

BorderStyle to define the border style (e.g., solid, dashed, etc.).

LineWidth to define the border width (in twips).

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.BorderStyle Property

Field.BorderStyle Property

Gets or sets the field's border style.

[Visual Basic]

Public Property BorderStyle As BorderStyleEnum

[C#]

public BorderStyleEnum BorderStyle {get;set;}

[Delphi]

public property BorderStyle: BorderStyleEnum read get_BorderStyle write set_BorderStyle;

Remarks

To draw a border around a field, set the following properties:

BorderColor to define the border color.

BorderStyle to define the border style (e.g., solid, dashed, etc.).

LineWidth to define the border width (in twips).

When you create fields with text and a border, text will be positioned very close to the border. You can control the distance between the text and the border using the MarginLeft, MarginRight, MarginTop, and MarginBottom properties.

To draw lines, see the LineSlant property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.Bounds Property

Field.Bounds Property

Gets or sets the field's size and location within the section, in twips.

[Visual Basic]

Public Property Bounds As RectangleF

[C#]

public RectangleF Bounds {get;set;}

[Delphi]

public property Bounds: RectangleF read get_Bounds write set_Bounds;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.Calculated Property

Field.Calculated Property

Gets or sets whether the Text property should be interpreted as a literal value or as a calculated expression.

[Visual Basic]

Public Property Calculated As Boolean

[C#]

public bool Calculated {get;set;}

[Delphi]

public property Calculated: Boolean read get_Calculated write set_Calculated;

Remarks

If this property is set to false, the value of the Text property is rendered on the report without any further processing.

If it is set to true, the value of the Text property is evaluated as a VBScript expression and the result of the expression is rendered on the report.

Example

The code below creates two fields. One displays the label "Sales Tax", the other displays the tax value by multiplying a database field ("Sales") by a constant.

// display literal Text

_c1r.Field[0].Text = "Sales Tax";

_c1r.Field[0].Calculated = false;

// display a calculated value

_c1r.Field[1].Text = "Sales * 0.085";

_c1r.Field[1].Calculated = true;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.CanGrow Property

Field.CanGrow Property

Gets or sets whether the field height should be automatically increased to fit the field's contents.

[Visual Basic]

Public Property CanGrow As Boolean

[C#]

public bool CanGrow {get;set;}

[Delphi]

public property CanGrow: Boolean read get_CanGrow write set_CanGrow;

Remarks

You can use the CanGrow and CanShrink properties to control the appearance of report fields and sections. When you set both properties to true, the field or section automatically adjusts so any amount of data can be printed. When a field grows or shrinks, the fields below it move down or up the page.

If you set a field's CanGrow property to true, the control automatically sets the CanGrow property of the containing section to true. (However, if you set a control's CanShrink property to true, the control doesn't set the section's CanShrink property to true.)

When you use the CanGrow and CanShrink properties, remember that:

1. The property settings don't affect the horizontal spacing between fields; they affect only the vertical space the fields occupy.

2. The height of a large field can prevent fields beside it from shrinking. For example, if several short controls are on the left side of a report's detail section and one tall control, such as an unbound object frame, is on the right side, the controls on the left won't shrink, even if they contain no data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.CanShrink Property

Field.CanShrink Property

Gets or sets whether the field height should be automatically reduced to fit the field's contents.

[Visual Basic]

Public Property CanShrink As Boolean

[C#]

public bool CanShrink {get;set;}

[Delphi]

public property CanShrink: Boolean read get_CanShrink write set_CanShrink;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.CheckBox Property

Field.CheckBox Property

Gets or sets whether the field should be displayed as a checkbox.

[Visual Basic]

Public Property CheckBox As CheckBoxEnum

[C#]

public CheckBoxEnum CheckBox {get;set;}

[Delphi]

public property CheckBox: CheckBoxEnum read get_CheckBox write set_CheckBox;

Remarks

This property allows you to display boolean values graphically, rather than as plain text.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.Font Property

Field.Font Property

Gets or sets the field's font.

[Visual Basic]

Public Property Font As FontHolder

[C#]

public FontHolder Font {get;set;}

[Delphi]

public property Font: FontHolder read get_Font write set_Font;

Remarks

If you set a field's font Size property to a value that is too large to fit the field box (defined by the Height property), no text will appear in the field.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.ForcePageBreak Property

Field.ForcePageBreak Property

Gets or sets whether to insert page breaks before or after the field.

[Visual Basic]

Public Property ForcePageBreak As ForcePageBreakEnum

[C#]

public ForcePageBreakEnum ForcePageBreak {get;set;}

[Delphi]

public property ForcePageBreak: ForcePageBreakEnum read get_ForcePageBreak write set_ForcePageBreak;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.ForeColor Property

Field.ForeColor Property

Gets or sets the field's foreground color.

[Visual Basic]

Public Property ForeColor As Color

[C#]

public Color ForeColor {get;set;}

[Delphi]

public property ForeColor: Color read get_ForeColor write set_ForeColor;

Remarks

Use the ForeColor property to specify the color for text in a field. You can use this property to make fields easy to read or to convey a special meaning.

Example

The code below uses script to change the color of the text in the UnitsInStock field when its value falls below the reorder level.

// build script

string script = "UnitsInStock.ForeColor = " +

"IIF(UnitsInStock < ReorderLevel, vbRed, vbBlack)";

// assign script to detail section

_c1r.Sections.Detail.OnPrint = script;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.Format Property

Field.Format Property

Gets or sets a string used to format the field value.

[Visual Basic]

Public Property Format As String

[C#]

public string Format {get;set;}

[Delphi]

public property Format: String read get_Format write set_Format;

Remarks

You can use the Format property to customize the way numbers, dates, times, and text are displayed and printed.

For example, if you've created a Price field, you can set its Format property to "Currency". If the field value is set to "4321.678", it would be rendered as $4,321.68.

You can use the Format property to format numbers (including currency and percentage values), dates, boolean values, and strings.

The syntax for the format string is the same used with the .NET System.String.Format(System.String,System.Object) method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.Height Property

Field.Height Property

Gets or sets the height of the field in twips.

[Visual Basic]

Public Property Height As Double

[C#]

public Double Height {get;set;}

[Delphi]

public property Height: Double read get_Height write set_Height;

Remarks

Every Field object has a rectangle, or "field box", where the field contents are rendered.

The field box is defined by the Left, Top, Width, and Height properties.

These properties are expressed in twips, and the position is relative to the field's containing section.

The field's Height property should be set to a value larger than or equal to the height of the field's Font, or no text will appear in the field.

If the field's CanGrow or CanShrink properties are set to true, the control will automatically adjust the RenderHeight property to fit the field's contents and the RenderTop property of fields below the current field to preserve the vertical distance between fields. The value of the Top and Height properties is not affected.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.HideDuplicates Property

Field.HideDuplicates Property

Gets or sets whether duplicate values in consecutive records should be suppressed.

[Visual Basic]

Public Property HideDuplicates As Boolean

[C#]

public bool HideDuplicates {get;set;}

[Delphi]

public property HideDuplicates: Boolean read get_HideDuplicates write set_HideDuplicates;

Remarks

You can use the HideDuplicates property to hide a field on a report when its value is the same as in the preceding record.

For example, on a report listing suppliers and their products, each supplier's name can appear once for each group of products, rather than once for each product.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.Index Property

Field.Index Property

Returns the position of the field in the parent report's Fields collection.

[Visual Basic]

Public ReadOnly Property Index As Integer

[C#]

public int Index {get;}

[Delphi]

public property Index: Int32 read get_Index;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.KeepTogether Property

Field.KeepTogether Property

Gets or sets whether the field should be kept together on a page.

[Visual Basic]

Public Property KeepTogether As Boolean

[C#]

public bool KeepTogether {get;set;}

[Delphi]

public property KeepTogether: Boolean read get_KeepTogether write set_KeepTogether;

Remarks

If this property is set to true, the control will insert page breaks in order to keep the field contents toghether on a page.

If it is set to false, and the containing Section also has its Section property set to false, then the field may be rendered across two or more pages.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.Left Property

Field.Left Property

Gets or sets the x-coordinate of the field's left edge in twips.

[Visual Basic]

Public Property Left As Double

[C#]

public Double Left {get;set;}

[Delphi]

public property Left: Double read get_Left write set_Left;

Remarks

A field's location is the distance from its upper left corner to the upper left corner of its containing Section.

Setting the Left or Top property to zero places the field at the very left or top of its containing section.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.LineSlant Property

Field.LineSlant Property

Gets or sets whether a line should be drawn across the field (as opposed to a box around the field).

[Visual Basic]

Public Property LineSlant As LineSlantEnum

[C#]

public LineSlantEnum LineSlant {get;set;}

[Delphi]

public property LineSlant: LineSlantEnum read get_LineSlant write set_LineSlant;

Remarks

The color, style, and thickness of the line are determined by the BorderColor, BorderStyle, and LineWidth properties.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.LineSpacing Property

Field.LineSpacing Property

Gets or sets the line spacing between text lines in the field, in twips.

[Visual Basic]

Public Property LineSpacing As Double

[C#]

public Double LineSpacing {get;set;}

[Delphi]

public property LineSpacing: Double read get_LineSpacing write set_LineSpacing;

Remarks

Setting this property to zero causes the control to use the default line spacing, which corresponds to the height of the field's font.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.LineWidth Property

Field.LineWidth Property

Gets or sets the width of the field's border or line.

[Visual Basic]

Public Property LineWidth As Double

[C#]

public Double LineWidth {get;set;}

[Delphi]

public property LineWidth: Double read get_LineWidth write set_LineWidth;

Remarks

To draw a border around a field, set the following properties:

BorderColor to define the border color.

BorderStyle to define the border style (e.g., solid, dashed, etc.).

LineWidth to define the border width (in twips).

To draw lines, see the LineSlant property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.LinkTarget Property

Field.LinkTarget Property

Gets or sets an expression that evaluates to a URL to be visited when the field is clicked.

[Visual Basic]

Public Property LinkTarget As String

[C#]

public string LinkTarget {get;set;}

[Delphi]

public property LinkTarget: String read get_LinkTarget write set_LinkTarget;

Remarks

If not empty, this should be an expression that evaluates to a URL. After the report is generated, clicking on the field will cause the report viewer to navigate to the URL. The report viewer can be a web browser (for HTML reports), Adobe Acrobat (for PDF reports), or other viewer applications.

Not all report viewers support hyperlinks. The PrintPreview control that ships with .NET, for example, does not.

The field will be displayed as usual, based on the contents of its Text and Picture properties.

The LinkTarget expression is always evaluated, regardless of the setting of the Calculated property (which only applies to the display text). This allows you to bind the LinkTarget to a field in the data source, as show in the example below.

Example

The code below creates two hyperlink fields, one with a static value and one based on a database value.

// set up a static link

Field f = c1r.Fields["companyInfoLink"];

f.Calculated = false;

f.Text = "click here for more info on our company";

f.LinkTarget = "http://myrealty.com";

// set up a databound link

Field f = c1r.Fields["propertyInfoLink"];

f.Calculated = false;

f.Text = "click here for more info on this property";

f.LinkTarget = "\"http://myrealty.com/moreinfo?id=\" & propertyID";

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.LinkValue Property

Field.LinkValue Property

Returns the value of the LinkTarget expression.

[Visual Basic]

Public ReadOnly Property LinkValue As String

[C#]

public string LinkValue {get;}

[Delphi]

public property LinkValue: String read get_LinkValue;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.Location Property

Field.Location Property

Gets or sets the field's location within the section, in twips.

[Visual Basic]

Public Property Location As PointF

[C#]

public PointF Location {get;set;}

[Delphi]

public property Location: PointF read get_Location write set_Location;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.MarginBottom Property

Field.MarginBottom Property

Gets or sets the spacing between the bottom edge of the field and its content, in twips.

[Visual Basic]

Public Property MarginBottom As Double

[C#]

public Double MarginBottom {get;set;}

[Delphi]

public property MarginBottom: Double read get_MarginBottom write set_MarginBottom;

Remarks

This property is useful for rendering fields with borders or solid backgrounds, to add some space between the borders and the field content.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.MarginLeft Property

Field.MarginLeft Property

Gets or sets the spacing between the left edge of the field and its content, in twips.

[Visual Basic]

Public Property MarginLeft As Double

[C#]

public Double MarginLeft {get;set;}

[Delphi]

public property MarginLeft: Double read get_MarginLeft write set_MarginLeft;

Remarks

This property is useful for rendering fields with borders or solid backgrounds, to add some space between the borders and the field content.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.MarginRight Property

Field.MarginRight Property

Gets or sets the spacing between the right edge of the field and its content, in twips.

[Visual Basic]

Public Property MarginRight As Double

[C#]

public Double MarginRight {get;set;}

[Delphi]

public property MarginRight: Double read get_MarginRight write set_MarginRight;

Remarks

This property is useful for rendering fields with borders or solid backgrounds, to add some space between the borders and the field content.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.MarginTop Property

Field.MarginTop Property

Gets or sets the spacing between the top edge of the field and its content, in twips.

[Visual Basic]

Public Property MarginTop As Double

[C#]

public Double MarginTop {get;set;}

[Delphi]

public property MarginTop: Double read get_MarginTop write set_MarginTop;

Remarks

This property is useful for rendering fields with borders or solid backgrounds, to add some space between the borders and the field content.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.Name Property

Field.Name Property

Gets or sets the field name.

[Visual Basic]

Public Property Name As String

[C#]

public string Name {get;set;}

[Delphi]

public property Name: String read get_Name write set_Name;

Remarks

The field name can be used as an index into the control's Fields collection.

Field names are also used to identify fields in VBScript expressions, as shown in the example below.

Duplicate and empty field names are allowed, but should be avoided if you plan to use the field names in scripts or as indexers.

Example

The code below assigns a script to the report's SectionTypeEnum.Detail section. The script changes a field's ForeColor property depending on a value.

_c1r.Sections.Fields["sampleField"].ForeColor = Color.Black;

_c1r.Sections.Detail.OnFormat =

"sampleField.ForeColor = iif(someValue < 5, vbRed, vbBlack)";

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.ParentReport Property

Field.ParentReport Property

Gets the C1Report that contains this field.

[Visual Basic]

Public ReadOnly Property ParentReport As C1Report

[C#]

public C1Report ParentReport {get;}

[Delphi]

public property ParentReport: C1Report read get_ParentReport;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.ParentSection Property

Field.ParentSection Property

Gets the Section that contains this field.

[Visual Basic]

Public ReadOnly Property ParentSection As Section

[C#]

public Section ParentSection {get;}

[Delphi]

public property ParentSection: Section read get_ParentSection;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.Picture Property

Field.Picture Property

Gets or sets a picture to display on the field.

[Visual Basic]

Public Property Picture As Object

[C#]

public object Picture {get;set;}

[Delphi]

public property Picture: Object read get_Picture write set_Picture;

Remarks

You may set this property to three types of object:

1) Regular .NET System.Drawing.Image objects.

2) Strings containing image file names or urls.

3) Strings containing names of image fields in the report data source.

Options 1 and 2 are used to create unbound images, such as logos. These images do not depend on the report data.

Option 3 is used to create bound images, such as product or employee pictures. These are images stored with the report data.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.PictureAlign Property

Field.PictureAlign Property

Gets or sets how field pictures should be the aligned.

[Visual Basic]

Public Property PictureAlign As PictureAlignEnum

[C#]

public PictureAlignEnum PictureAlign {get;set;}

[Delphi]

public property PictureAlign: PictureAlignEnum read get_PictureAlign write set_PictureAlign;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.PictureScale Property

Field.PictureScale Property

Gets or sets how images should be the scaled to fit within the field area.

[Visual Basic]

Public Property PictureScale As PictureScaleEnum

[C#]

public PictureScaleEnum PictureScale {get;set;}

[Delphi]

public property PictureScale: PictureScaleEnum read get_PictureScale write set_PictureScale;

Remarks

Depending on the setting of this property, images may be clipped, stretched, scaled (which preserves the image's aspect ratio), tiled, or hidden.

PictureScale works with the PictureAlign property so you can control image scaling and alignment independently.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.RenderHeight Property

Field.RenderHeight Property

Gets the height of the field in twips after the CanGrow and CanShrink properties have been applied to the field.

[Visual Basic]

Public ReadOnly Property RenderHeight As Double

[C#]

public Double RenderHeight {get;}

[Delphi]

public property RenderHeight: Double read get_RenderHeight;

Remarks

If the field's CanGrow or CanShrink properties are set to true, the control will automatically adjust the RenderHeight property to fit the field's contents and the RenderTop property of fields below the current field to preserve the vertical distance between fields. The value of the Top and Height properties is not affected.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.RenderTop Property

Field.RenderTop Property

Gets or sets the y-coordinate of the field's top edge in twips after the CanGrow and CanShrink properties have been applied to the containing Section.

[Visual Basic]

Public ReadOnly Property RenderTop As Double

[C#]

public Double RenderTop {get;}

[Delphi]

public property RenderTop: Double read get_RenderTop;

Remarks

If the field's CanGrow or CanShrink properties are set to true, the control will automatically adjust the RenderHeight property to fit the field's contents and the RenderTop property of fields below the current field to preserve the vertical distance between fields. The value of the Top and Height properties is not affected.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.RTF Property

Field.RTF Property

Gets or sets whether the field should render string enclosed in curly brackets as RTF.

[Visual Basic]

Public Property RTF As Boolean

[C#]

public bool RTF {get;set;}

[Delphi]

public property RTF: Boolean read get_RTF write set_RTF;

Remarks

If you set this property to true, any fields containing text enclosed in curly brackets will be rendered as RTF. This allows you to add complex formatting within a field.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.RunningSum Property

Field.RunningSum Property

Gets or sets whether to show a running sum for the field.

[Visual Basic]

Public Property RunningSum As RunningSumEnum

[C#]

public RunningSumEnum RunningSum {get;set;}

[Delphi]

public property RunningSum: RunningSumEnum read get_RunningSum write set_RunningSum;

Remarks

You can use the RunningSum property to calculate record-by-record or group-by-group totals in a report.

The RunningSum property specifies whether a calculated field on a report displays a running total and lets you set the range over which values are accumulated.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.Section Property

Field.Section Property

Gets or sets the section to which the field belongs.

[Visual Basic]

Public Property Section As SectionTypeEnum

[C#]

public SectionTypeEnum Section {get;set;}

[Delphi]

public property Section: SectionTypeEnum read get_Section write set_Section;

Remarks

To move a field from one section to another, set its Section property to a new value.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.Size Property

Field.Size Property

Gets or sets the field's size, in twips.

[Visual Basic]

Public Property Size As SizeF

[C#]

public SizeF Size {get;set;}

[Delphi]

public property Size: SizeF read get_Size write set_Size;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.Subreport Property

Field.Subreport Property

Gets or sets a reference to another report to be rendered within the field (a subreport).

[Visual Basic]

Public Property Subreport As C1Report

[C#]

public C1Report Subreport {get;set;}

[Delphi]

public property Subreport: C1Report read get_Subreport write set_Subreport;

Remarks

A subreport is a report that is inserted in another report. Subreports are useful when you want to combine several reports into one. For example, you may have a main report that integrates several subreports into a single main report. Or you can use the main report to show detailed information and use subreports to show summary data at the beginning of each group.

For some real-world examples, check the "Sales By Category" and "Sales By Year" reports in the NWIND.XML sample that ships with the control.

To define a field as a subreport, you should start by loading the subreport, then assign the subreport control to the field's Subreport property.

Next, link the subreport to the main report using the subreport field's Text property (this is analogous to setting the LinkChildFields/LinkMasterFields properties in a Microsoft Access subreport). The Text property in a subreport field is used as a filter. It specifies which records in the source recordset should be used to render the subreport based on the current record for the main report.

When the main report is being rendered and reaches the subreport field, the Text expression is evaluated and the result is uses as a filter condition for the subreport.

Building the link expression is not difficult, but it is a little tricky because it requires you to create a string that contains quotes, and these internal quotes must be doubled (written as "").

If you are creating reports using the Report Designer, you don't have to worry about building the link expressions in code. Instead, right-click the subreport field and select the Link Subreport... menu. This will show a dialog where you can select the master and detail fields. When you click OK, the Report Designer will build the link expression and assign it to the Text property of the subreport field automatically.

Subreport fields usually have the CanGrow property set to true, so the subreport field can expand to include all its records.

Subreports may contain other subreports. There's no set limit for the depth of report nesting you can have. However, there must be no circular references to reports. In other words, a report cannot contain a reference to itself as a subreport.

Example

// load subreport and assign it to a field in the main report

string sSub = "Sales By Category Subreport";

c1Sub.Load("NWIND.XML", sSub);

c1rMain.Fields[sSub].Subreport = c1Sub;

// set up connection between main report and subreport

c1rMain.Fields[sSub].Calculated = true;

c1rMain.Fields[sSub].Text = "\"CategoryName = '\" & [CategoryName] & \"'\"";

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.SubreportHasData Property

Field.SubreportHasData Property

Returns whether a subreport has data and suppresses rendering if it doesn't.

[Visual Basic]

Public ReadOnly Property SubreportHasData As Boolean

[C#]

public bool SubreportHasData {get;}

[Delphi]

public property SubreportHasData: Boolean read get_SubreportHasData;

Remarks

This property allows you to check whether a subreport has data and prevent it from rendering if it doesn't.

Example

The code below uses script to hide sections with empty subreports:

_c1r.Sections.Detail.OnPrint = "Detail.Visible = fSubreport.SubreportHasData"

The code below uses script to hide a field containing an empty subreport and show another field instead:

_c1r.Sections.Detail.OnPrint =

"hasData = fSubreport.SubreportHasData\r\n" +

"fSubreport.Visible = hasData" +

"fNoData.Visible = Not hasData\r\n" +

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.Tag Property

Field.Tag Property

Gets or sets extra data needed by the calling program.

[Visual Basic]

Public Property Tag As Object

[C#]

public object Tag {get;set;}

[Delphi]

public property Tag: Object read get_Tag write set_Tag;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.Text Property

Field.Text Property

Gets or sets the field's text.

[Visual Basic]

Public Property Text As String

[C#]

public string Text {get;set;}

[Delphi]

public property Text: String read get_Text write set_Text;

Remarks

The Text property contains the text that will be rendered on the report.

This value may be rendered literally (without any translation) or it may be evaluated as a VBScript expression, depending on the setting of the Calculated property.

Example

The code below creates two fields. One displays the label "Sales Tax", the other displays the tax value by multiplying a database field ("Sales") by a constant.

// display literal Text

_c1r.Field[0].Text = "Sales Tax";

_c1r.Field[0].Calculated = false;

// display a calculated value

_c1r.Field[1].Text = "Sales * 0.085";

_c1r.Field[1].Calculated = true;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.TextDirection Property

Field.TextDirection Property

Gets or sets the direction of the text within the field.

[Visual Basic]

Public Property TextDirection As TextDirectionEnum

[C#]

public TextDirectionEnum TextDirection {get;set;}

[Delphi]

public property TextDirection: TextDirectionEnum read get_TextDirection write set_TextDirection;

Remarks

Not all output formats support vertical text. The preview, print, PDF, TIFF, and XLS formats do support vertical text. The HTML, RTF, and plain text formats do not.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.Top Property

Field.Top Property

Gets or sets the y-coordinate of the field's top edge in twips.

[Visual Basic]

Public Property Top As Double

[C#]

public Double Top {get;set;}

[Delphi]

public property Top: Double read get_Top write set_Top;

Remarks

A field's location is the distance from its upper left corner to the upper left corner of its containing Section.

If the field's CanGrow or CanShrink properties are set to true, the control will automatically adjust the RenderHeight property to fit the field's contents and the RenderTop property of fields below the current field to preserve the vertical distance between fields. The value of the Top and Height properties is not affected.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.Value Property

Field.Value Property

Gets or sets the field's calculated value.

[Visual Basic]

Public Property Value As Object

[C#]

public object Value {get;set;}

[Delphi]

public property Value: Object read get_Value write set_Value;

Remarks

When a field's Calculated property is set to true, the control evaluates the expression stored in the Text property and stores the result in the Value property, which gets rendered into the report.

This is the field's default property, so when you use a field name in a VBScript expression, you are actually referring to the field's Value property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.Visible Property

Field.Visible Property

Gets or sets whether the Field will be rendered in the report.

[Visual Basic]

Public Property Visible As Boolean

[C#]

public bool Visible {get;set;}

[Delphi]

public property Visible: Boolean read get_Visible write set_Visible;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.Width Property

Field.Width Property

Gets or sets the width of the field in twips.

[Visual Basic]

Public Property Width As Double

[C#]

public Double Width {get;set;}

[Delphi]

public property Width: Double read get_Width write set_Width;

Remarks

Every Field object has a rectangle, or "field box", where the field contents are rendered.

The field box is defined by the Left, Top, Width, and Height properties.

These properties are expressed in twips, and the position is relative to the field's containing section.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.WordWrap Property

Field.WordWrap Property

Gets or sets whether the field's contents should be allowed to wrap within the field rectangle.

[Visual Basic]

Public Property WordWrap As Boolean

[C#]

public bool WordWrap {get;set;}

[Delphi]

public property WordWrap: Boolean read get_WordWrap write set_WordWrap;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.ZOrder Property

Field.ZOrder Property

Gets or sets the ZOrder for the field.

[Visual Basic]

Public Property ZOrder As Integer

[C#]

public int ZOrder {get;set;}

[Delphi]

public property ZOrder: Int32 read get_ZOrder write set_ZOrder;

Remarks

The ZOrder of a field determines whether it is rendered in front of or behind other fields that overlap with it.

High ZOrder values bring the field to the front, low values send it to the back.

Because ZOrder values are relative, it is usually easier to call the SetZOrder method, which ensures the field is rendered in front of or behind all other overlapping fields.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field Methods

Field Methods

The methods of the Field class are listed here. For a complete list of Field class members, see the Field Members topic.

Public Methods

Clone | Creates a new object that is a copy of the current Field object.
SetZOrder | Brings a field to the front or sends it to the back of the ZOrder.
ToString | Overriden. Returns a description of the field (name, location, size).

Protected Methods

GetRenderContent

Selects the text or image that will be rendered by the field.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.Clone Method

Field.Clone Method

Creates a new object that is a copy of the current Field object.

[Visual Basic]

Overridable Public Function Clone() As Object Implements ICloneable.Clone

[C#]

virtual public object Clone()

[Delphi]

public function Clone(): Object; virtual;

Implements

ICloneable.Clone

Return Value

Copy of the current Field object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.GetRenderContent Method

Field.GetRenderContent Method

Selects the text or image that will be rendered by the field.

[Visual Basic]

Overridable Protected Sub GetRenderContent( _

ByRef value As String, _

ByRef img As Image, _

ByVal designTime As Boolean _

)

[C#]

virtual protected void GetRenderContent(

ref string value,

ref Image img,

bool designTime

);

[Delphi]

strict protected procedure GetRenderContent(

var value: String;

var img: Image;

designTime: Boolean

); virtual;

Parameters

value

Field text.

img

Chart image.

designTime

This parameter allows the field to render differently at design time or run time. This is usually needed for bound controls, since no data is available at design time.

Remarks

Override this method in derived classes to provide custom text or images to be rendered in the report.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.SetZOrder Method

Field.SetZOrder Method

Brings a field to the front or sends it to the back of the ZOrder.

[Visual Basic]

Public Sub SetZOrder( _

ByVal front As Boolean _

)

[C#]

public void SetZOrder(

bool front

);

[Delphi]

public procedure SetZOrder(

front: Boolean

);

Parameters

front

Determines whether the field is brought to the front or sent to the back of the ZOrder.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Field.ToString Method

Field.ToString Method

Returns a description of the field (name, location, size).

[Visual Basic]

Overrides Public Function ToString() As String

[C#]

override public string ToString()

[Delphi]

public function ToString(): String; override;

Return Value

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FieldAlignEnum Enumeration

FieldAlignEnum Enumeration

Specifies the alignment of text within the field's rectangle.

[Visual Basic]

Public Enum FieldAlignEnum

[C#]

public enum FieldAlignEnum

[Delphi]

type FieldAlignEnum = (CenterBottom, CenterMiddle, CenterTop, General, JustBottom, JustMiddle, JustTop, LeftBottom, LeftMiddle, LeftTop, RightBottom, RightMiddle, RightTop);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

Remarks

Use the members of this enumeration to set the value of the Align property in the Field class.

Members

Member name | Description
CenterBottom | Align to the center and to the bottom of the field box.
CenterMiddle | Align to the center and to the middle of the field box.
CenterTop | Align to the center and to the top of the field box.
General | Align numbers to the right, other values to the left.
JustBottom | Justify and align to the bottom of the field box.
JustMiddle | Justify and align to the middle of the field box.
JustTop | Justify and align to the top of the field box.
LeftBottom | Align to the left and to the bottom of the field box.
LeftMiddle | Align to the left and to the middle of the field box.
LeftTop | Align to the left and to the top of the field box.
RightBottom | Align to the right and to the bottom of the field box.
RightMiddle | Align to the right and to the middle of the field box.
RightTop | Align to the right and to the top of the field box.

See Also

C1.Win.C1Report Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FieldCollection Class

FieldCollection Class

FieldCollection class represents a collection of the Field objects.

For a list of all members of this type, see FieldCollection Members.

System.Object

C1.Win.C1Report.FieldCollection

[Visual Basic]

Public Class FieldCollection

Implements ICollection, IEnumerable

[C#]

public class FieldCollection : ICollection, IEnumerable

[Delphi]

type FieldCollection = class (TObject, ICollection, IEnumerable);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FieldCollection Members

FieldCollection Members

FieldCollection overview

Public Properties

Count | Returns the number of fields in a Fields collection.
Item | Overloaded. Returns a field from a Fields collection.

Public Methods

Add | Overloaded. Adds a field or a clone of a field to a Fields collection.
Contains | Overloaded. Determines whether the collection contains a specific field.
CopyTo | Copies the elements of the collection to an System.Array, starting at a particular array index.
Remove | Overloaded. Removes a field from a Fields collection.
RemoveAt | Removes a field from a Fields collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FieldCollection Properties

FieldCollection Properties

The properties of the FieldCollection class are listed here. For a complete list of FieldCollection class members, see the FieldCollection Members topic.

Public Properties

Count | Returns the number of fields in a Fields collection.
Item | Overloaded. Returns a field from a Fields collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FieldCollection.Count Property

FieldCollection.Count Property

Returns the number of fields in a Fields collection.

[Visual Basic]

Overridable Public ReadOnly Property Count As Integer Implements ICollection.Count

[C#]

virtual public int Count {get;}

[Delphi]

public property Count: Int32 read get_Count;

Implements

ICollection.Count

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FieldCollection.Item Property

FieldCollection.Item Property

Overload List

Returns a field from a Fields collection.

[Visual Basic] Overloads Public Default ReadOnly Property Item(Integer) As Field

[C#] public Field this[int]{get;}

[Delphi] public property Item[index: Int32]: Field read get_Item;

Returns a field from a Fields collection.

[Visual Basic] Overloads Public Default ReadOnly Property Item(String) As Field

[C#] public Field this[string]{get;}

[Delphi] public property Item[name: String]: Field read get_Item;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FieldCollection.Item Property (Int32)

FieldCollection.Item Property (Int32)

Returns a field from a Fields collection.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As Field

[C#]

public Field this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: Field read get_Item;

Remarks

The index parameter may be an integer between zero and Count-1.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FieldCollection.Item Property (String)

FieldCollection.Item Property (String)

Returns a field from a Fields collection.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal name As String _

) As Field

[C#]

public Field this[

string name

] {get;}

[Delphi]

public property Item[

name: String

]: Field read get_Item;

Remarks

The name parameter may be a string containing a field name.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FieldCollection Methods

FieldCollection Methods

The methods of the FieldCollection class are listed here. For a complete list of FieldCollection class members, see the FieldCollection Members topic.

Public Methods

Add | Overloaded. Adds a field or a clone of a field to a Fields collection.
Contains | Overloaded. Determines whether the collection contains a specific field.
CopyTo | Copies the elements of the collection to an System.Array, starting at a particular array index.
Remove | Overloaded. Removes a field from a Fields collection.
RemoveAt | Removes a field from a Fields collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FieldCollection.Add Method

FieldCollection.Add Method

Overload List

Adds a field or a clone of a field to a Fields collection.

[Visual Basic] Overloads Public Function Add(Field) As Field

[C#] public Field Add(Field);

[Delphi] public function Add(Field) : Field; overload;

Adds a field to a Fields collection.

[Visual Basic] Overloads Public Function Add(String, String, Rectangle) As Field

[C#] public Field Add(string, string, Rectangle);

[Delphi] public function Add(String; String; Rectangle) : Field; overload;

Adds a field to a Fields collection.

[Visual Basic] Overloads Public Function Add(String, String, Double, Double, Double, Double) As Field

[C#] public Field Add(string, string, Double, Double, Double, Double);

[Delphi] public function Add(String; String; Double; Double; Double; Double) : Field; overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FieldCollection.Add Method (Field)

FieldCollection.Add Method (Field)

Adds a field or a clone of a field to a Fields collection.

[Visual Basic]

Overloads Public Function Add( _

ByVal field As Field _

) As Field

[C#]

public Field Add(

Field field

);

[Delphi]

public function Add(

field: Field

): Field; overload;

Parameters

field

A Field object to add to the collection.

Return Value

A reference to the newly added field.

Remarks

In the field does not belong to any reports, it is added to the collection. If the field already belongs to a report, a clone is created and added to the collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FieldCollection.Add Method (String, String, Rectangle)

FieldCollection.Add Method (String, String, Rectangle)

Adds a field to a Fields collection.

[Visual Basic]

Overloads Public Function Add( _

ByVal name As String, _

ByVal text As String, _

ByVal rc As Rectangle _

) As Field

[C#]

public Field Add(

string name,

string text,

Rectangle rc

);

[Delphi]

public function Add(

name: String;

text: String;

rc: Rectangle

): Field; overload;

Parameters

name

Contains the name of the new field. You should use a consistent naming scheme for the fields and avoid using duplicate names for report fields and database fields. Using repeated names is legal but will cause VBScript expressions that use repeated field names to yield unexpected results.

text

Contains the value for the new field's Text property. This value may be treated as a literal or as a VBScript expression, depending on the setting of the field's Calculated property. By default, Calculated is set to false and the text is rendered as-is.

rc

Defines the position of the field, in twips, with respect to its containing section.

Return Value

A reference to the newly added field.

Remarks

If you add a field to a section's Fields collection, the new field is automatically assigned to that section.

If you add a field to the control's Fields collection, the new field is not assigned to any sections. In this case, you must set the field's Section property or it will not be rendered in the report.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FieldCollection.Add Method (String, String, Double, Double, Double, Double)

FieldCollection.Add Method (String, String, Double, Double, Double, Double)

Adds a field to a Fields collection.

[Visual Basic]

Overloads Public Function Add( _

ByVal name As String, _

ByVal text As String, _

ByVal left As Double, _

ByVal top As Double, _

ByVal width As Double, _

ByVal height As Double _

) As Field

[C#]

public Field Add(

string name,

string text,

Double left,

Double top,

Double width,

Double height

);

[Delphi]

public function Add(

name: String;

text: String;

left: Double;

top: Double;

width: Double;

height: Double

): Field; overload;

Parameters

name

Contains the name of the new field. You should use a consistent naming scheme for the fields and avoid using duplicate names for report fields and database fields. Using repeated names is legal but will cause VBScript expressions that use repeated field names to yield unexpected results.

text

Contains the value for the new field's Text property. This value may be treated as a literal or as a VBScript expression, depending on the setting of the field's Calculated property. By default, Calculated is set to false and the text is rendered as-is.

left

Left coordinate of the new field, in twips, with respect to its containing section.

top

Top coordinate of the new field, in twips, with respect to its containing section.

width

Width of the new field, in twips.

height

Height of the new field, in twips.

Return Value

A reference to the newly added field.

Remarks

If you add a field to a section's Fields collection, the new field is automatically assigned to that section.

If you add a field to the control's Fields collection, the new field is not assigned to any sections. In this case, you must set the field's Section property or it will not be rendered in the report.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FieldCollection.Contains Method

FieldCollection.Contains Method

Overload List

Determines whether the collection contains a specific field.

[Visual Basic] Overloads Public Function Contains(Field) As Boolean

[C#] public bool Contains(Field);

[Delphi] public function Contains(Field) : Boolean; overload;

Determines whether the collection contains a specific field.

[Visual Basic] Overloads Public Function Contains(String) As Boolean

[C#] public bool Contains(string);

[Delphi] public function Contains(String) : Boolean; overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FieldCollection.Contains Method (Field)

FieldCollection.Contains Method (Field)

Determines whether the collection contains a specific field.

[Visual Basic]

Overloads Public Function Contains( _

ByVal f As Field _

) As Boolean

[C#]

public bool Contains(

Field f

);

[Delphi]

public function Contains(

f: Field

): Boolean; overload;

Parameters

f

Reference to the Field object.

Return Value

True if the collection contains specified field; otherwise, false.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FieldCollection.Contains Method (String)

FieldCollection.Contains Method (String)

Determines whether the collection contains a specific field.

[Visual Basic]

Overloads Public Function Contains( _

ByVal name As String _

) As Boolean

[C#]

public bool Contains(

string name

);

[Delphi]

public function Contains(

name: String

): Boolean; overload;

Parameters

name

The name of the field.

Return Value

True if the collection contains a field with the specified name; otherwise, false.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FieldCollection.CopyTo Method

FieldCollection.CopyTo Method

Copies the elements of the collection to an System.Array, starting at a particular array index.

[Visual Basic]

Public Sub CopyTo( _

ByVal array As Field(), _

ByVal index As Integer _

)

[C#]

public void CopyTo(

Field[] array,

int index

);

[Delphi]

public procedure CopyTo(

array: array of Field;

index: Int32

);

Parameters

array

The one-dimensional System.Array that is the destination of the elements copied from collection. The array must have zero-based indexing.

index

The zero-based index in array at which copying begins.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FieldCollection.Remove Method

FieldCollection.Remove Method

Overload List

Removes a field from a Fields collection.

[Visual Basic] Overloads Public Sub Remove(Field)

[C#] public Remove(Field);

[Delphi] public procedure Remove(Field); overload;

Removes a field from a Fields collection.

[Visual Basic] Overloads Public Sub Remove(Integer)

[C#] public Remove(int);

[Delphi] public procedure Remove(Int32); overload;

Removes a field from a Fields collection.

[Visual Basic] Overloads Public Sub Remove(String)

[C#] public Remove(string);

[Delphi] public procedure Remove(String); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FieldCollection.Remove Method (Field)

FieldCollection.Remove Method (Field)

Removes a field from a Fields collection.

[Visual Basic]

Overloads Public Sub Remove( _

ByVal f As Field _

)

[C#]

public void Remove(

Field f

);

[Delphi]

public procedure Remove(

f: Field

); overload;

Parameters

f

The field to be removed.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FieldCollection.Remove Method (Int32)

FieldCollection.Remove Method (Int32)

Removes a field from a Fields collection.

[Visual Basic]

Overloads Public Sub Remove( _

ByVal index As Integer _

)

[C#]

public void Remove(

int index

);

[Delphi]

public procedure Remove(

index: Int32

); overload;

Parameters

index

Specifies the field to be removed.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FieldCollection.Remove Method (String)

FieldCollection.Remove Method (String)

Removes a field from a Fields collection.

[Visual Basic]

Overloads Public Sub Remove( _

ByVal name As String _

)

[C#]

public void Remove(

string name

);

[Delphi]

public procedure Remove(

name: String

); overload;

Parameters

name

The name of the field to be removed.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FieldCollection.RemoveAt Method

FieldCollection.RemoveAt Method

Removes a field from a Fields collection.

[Visual Basic]

Public Sub RemoveAt( _

ByVal index As Integer _

)

[C#]

public void RemoveAt(

int index

);

[Delphi]

public procedure RemoveAt(

index: Int32

);

Parameters

index

Specifies the field to be removed.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FileFormatEnum Enumeration

FileFormatEnum Enumeration

Specifies the format of the export file.

[Visual Basic]

Public Enum FileFormatEnum

[C#]

public enum FileFormatEnum

[Delphi]

type FileFormatEnum = (Excel, HTML, HTMLDrillDown, HTMLPaged, PDF, PDFEmbedFonts, PDFPrintUtil, PDFProtected, RTF, RTFLabels, Text, TIFF);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

Remarks

Use the members of this enumeration to set parameter of the RenderToFile method in the C1Report class.

Members

Member name | Description
Excel | Microsoft Excel files. This setting creates a BIFF-8 Excel file that can be opened with Microsoft Excel 97 or later.
HTML | Plain HTML format. This setting creates a single HTML file that can be viewed in any web browser.
HTMLDrillDown | Drill-down HTML format. This setting creates a single HTML file with collapsible headings. When viewed in a DHTML-capable browser, clicking group headers causes them to collapse and expand to show the detail.
HTMLPaged | Paged HTML format. This setting creates one HTML file for each page in the report, with links to navigate between pages.
PDF | Adobe PDF format. This setting creates a PDF file that can be viewed using Adobe Acrobat software.
PDFEmbedFonts | Adobe PDF format with embedded fonts. This setting creates a PDF file that can be viewed using Adobe Acrobat software.
PDFPrintUtil | Deprecated. Use PDF, PDFEmbedFonts, or PDFProcted instead.
PDFProtected | Protected PDF format. This setting creates a PDF file with a random password. The file can be opened and printed by anyone, but cannot be modified.
RTF | RTF format. This setting creates an RTF file that can be opened in Microsoft Word, WordPad, or any other RTF-capable text editor.
RTFLabels | RTF field-based format. This setting creates RTF files with absolutely-positioned fields. This format renders reports more accurately than the plain RTF format, and is recommended for creating label-style reports. However, the files created with this setting are harder to edit than the plan RTF format, and can only be previewed or printed correctly using Microsoft Word (this format doesn't work with WordPad).
Text | Plain text. This setting creates a plain ASCII file.
TIFF | TIFF format. This setting creates multi-page TIFF files.

See Also

C1.Win.C1Report Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ForcePageBreakEnum Enumeration

ForcePageBreakEnum Enumeration

Determines whether page breaks should be inserted before or after a field or section.

[Visual Basic]

Public Enum ForcePageBreakEnum

[C#]

public enum ForcePageBreakEnum

[Delphi]

type ForcePageBreakEnum = (After, Before, BeforeAndAfter, None, PageAfter, PageBefore);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

Remarks

Use the members of this enumeration to set the value of the ForcePageBreak and ForcePageBreak properties in the Field and Section classes.

Members

Member name | Description
After | A page break is inserted after the field or section.
Before | A page break is inserted before the field or section.
BeforeAndAfter | Page breaks are inserted before and after the field or section.
None | No page breaks.
PageAfter | In multi-column reports, a page break is inserted after the field or section instead of column break.
PageBefore | In multi-column reports, a page break is inserted before the field or section instead of column break.

See Also

C1.Win.C1Report Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Group Class

Group Class

Object used to sort and group report data.

For a list of all members of this type, see Group Members.

System.Object

C1.Win.C1Report.Group

[Visual Basic]

Public Class Group

[C#]

public class Group

[Delphi]

type Group = class;

Remarks

Each Group has a Header section and a Footer section that can be used to display aggregate information for the group.

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Group Members

Group Members

Group overview

Public Properties

GroupBy | Gets or sets the expression used to break records into groups.
KeepTogether | Gets or sets whether the group should be kept together on a page.
Name | Gets or sets the group name.
ParentReport | Gets the C1Report object that contains this Group.
SectionFooter | Returns the Section used as this group's footer.
SectionHeader | Returns the Section used as this group's header.
Sort | Gets or sets how the group is sorted.
Tag | Gets or sets extra data needed by the calling program.

Public Methods

Move

Moves a group to a new position in the Groups collection, optionally adjusting its Sections and Fields.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Group Properties

Group Properties

The properties of the Group class are listed here. For a complete list of Group class members, see the Group Members topic.

Public Properties

GroupBy | Gets or sets the expression used to break records into groups.
KeepTogether | Gets or sets whether the group should be kept together on a page.
Name | Gets or sets the group name.
ParentReport | Gets the C1Report object that contains this Group.
SectionFooter | Returns the Section used as this group's footer.
SectionHeader | Returns the Section used as this group's header.
Sort | Gets or sets how the group is sorted.
Tag | Gets or sets extra data needed by the calling program.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Group.GroupBy Property

Group.GroupBy Property

Gets or sets the expression used to break records into groups.

[Visual Basic]

Public Property GroupBy As String

[C#]

public string GroupBy {get;set;}

[Delphi]

public property GroupBy: String read get_GroupBy write set_GroupBy;

Remarks

This property contains a VBScript expression that is evaluated for every record in the source recordset. A new group is started whenever the value of this expression changes.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Group.KeepTogether Property

Group.KeepTogether Property

Gets or sets whether the group should be kept together on a page.

[Visual Basic]

Public Property KeepTogether As KeepTogetherEnum

[C#]

public KeepTogetherEnum KeepTogether {get;set;}

[Delphi]

public property KeepTogether: KeepTogetherEnum read get_KeepTogether write set_KeepTogether;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Group.Name Property

Group.Name Property

Gets or sets the group name.

[Visual Basic]

Public Property Name As String

[C#]

public string Name {get;set;}

[Delphi]

public property Name: String read get_Name write set_Name;

Remarks

The group name can be used as an index into the control's Groups collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Group.ParentReport Property

Group.ParentReport Property

Gets the C1Report object that contains this Group.

[Visual Basic]

Public ReadOnly Property ParentReport As C1Report

[C#]

public C1Report ParentReport {get;}

[Delphi]

public property ParentReport: C1Report read get_ParentReport;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Group.SectionFooter Property

Group.SectionFooter Property

Returns the Section used as this group's footer.

[Visual Basic]

Public ReadOnly Property SectionFooter As Section

[C#]

public Section SectionFooter {get;}

[Delphi]

public property SectionFooter: Section read get_SectionFooter;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Group.SectionHeader Property

Group.SectionHeader Property

Returns the Section used as this group's header.

[Visual Basic]

Public ReadOnly Property SectionHeader As Section

[C#]

public Section SectionHeader {get;}

[Delphi]

public property SectionHeader: Section read get_SectionHeader;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Group.Sort Property

Group.Sort Property

Gets or sets how the group is sorted.

[Visual Basic]

Public Property Sort As SortEnum

[C#]

public SortEnum Sort {get;set;}

[Delphi]

public property Sort: SortEnum read get_Sort write set_Sort;

Remarks

The specified sorting is applied to the content of the GroupBy property. For example, if GroupBy contains the expression "FirstName" and Sort is set to "Ascending", then the group will be sorted in ascending order based on the content of the "FirstName" column in the data source.

Note that the sorting is performed by the data source itself, not by C1Report. Because of this, sorting is always based on column names rather than calculated expressions. If the GroupBy property contains a calculated expression, the component will extract the first column name from the expression and will sort based on that value. For example, if GroupBy is set to "Left(FirstName, 3)", the sorting will be based on the "FirstName" column, not on the first three characters of the first names.

This can present problems in a few cases, especially if you want ot sort based on date parts (year, month, quarter). In these cases, the recommended procedure is to add a calculated column to the data source (by changing the SQL statement used to retrieve the data), then set the GroupBy property to the name of the calculated column.

Example

The code below uses a SQL statement to add a "HireQuarter" column to the data source, then sorts a group based on this new column. The report will show employees sorted by the quarter when they were hired.

string sql =

"SELECT *, DATEPART('q', HireDate) AS HireQuarter " +

"FROM Employees";

c1r.DataSource.RecordSource = sql;

c1r.Groups[0].GroupBy = "HireQuarter";

c1r.Groups[0].Sort = SortEnum.Ascending;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Group.Tag Property

Group.Tag Property

Gets or sets extra data needed by the calling program.

[Visual Basic]

Public Property Tag As Object

[C#]

public object Tag {get;set;}

[Delphi]

public property Tag: Object read get_Tag write set_Tag;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Group Methods

Group Methods

The methods of the Group class are listed here. For a complete list of Group class members, see the Group Members topic.

Public Methods

Move

Moves a group to a new position in the Groups collection, optionally adjusting its Sections and Fields.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Group.Move Method

Group.Move Method

Moves a group to a new position in the Groups collection, optionally adjusting its Sections and Fields.

[Visual Basic]

Public Sub Move( _

ByVal newIndex As Integer, _

ByVal adjustSections As Boolean _

)

[C#]

public void Move(

int newIndex,

bool adjustSections

);

[Delphi]

public procedure Move(

newIndex: Int32;

adjustSections: Boolean

);

Parameters

newIndex

Contains the new position for the group (index into the Groups collection).

adjustSections

Determines whether only the group should be moved or whether its header and footer sections, along with all the fields in those sections, should also be moved.

Remarks

This method is useful in designer applications, when you want to allow users to change the grouping order.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GroupCollection Class

GroupCollection Class

GroupCollection class represents a collection of the Group objects.

For a list of all members of this type, see GroupCollection Members.

System.Object

C1.Win.C1Report.GroupCollection

[Visual Basic]

Public Class GroupCollection

Implements ICollection, IEnumerable

[C#]

public class GroupCollection : ICollection, IEnumerable

[Delphi]

type GroupCollection = class (TObject, ICollection, IEnumerable);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GroupCollection Members

GroupCollection Members

GroupCollection overview

Public Properties

Count | Returns the number of groups in a Groups collection.
Item | Overloaded. Returns a group from a Groups collection.

Public Methods

Add | Adds a new Group to the collection, along with header and footer sections for the new group.
Contains | Overloaded. Determines whether the collection contains a specific group.
CopyTo | Copies the elements of the collection to an System.Array, starting at a particular array index.
Remove | Overloaded. Removes a Group from the Groups collection, and its header/footer sections from the Sections collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GroupCollection Properties

GroupCollection Properties

The properties of the GroupCollection class are listed here. For a complete list of GroupCollection class members, see the GroupCollection Members topic.

Public Properties

Count | Returns the number of groups in a Groups collection.
Item | Overloaded. Returns a group from a Groups collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GroupCollection.Count Property

GroupCollection.Count Property

Returns the number of groups in a Groups collection.

[Visual Basic]

Overridable Public ReadOnly Property Count As Integer Implements ICollection.Count

[C#]

virtual public int Count {get;}

[Delphi]

public property Count: Int32 read get_Count;

Implements

ICollection.Count

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GroupCollection.Item Property

GroupCollection.Item Property

Overload List

Returns a group from a Groups collection.

[Visual Basic] Overloads Public Default ReadOnly Property Item(Integer) As Group

[C#] public Group this[int]{get;}

[Delphi] public property Item[index: Int32]: Group read get_Item;

Returns a group from a Groups collection.

[Visual Basic] Overloads Public Default ReadOnly Property Item(String) As Group

[C#] public Group this[string]{get;}

[Delphi] public property Item[name: String]: Group read get_Item;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GroupCollection.Item Property (Int32)

GroupCollection.Item Property (Int32)

Returns a group from a Groups collection.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As Group

[C#]

public Group this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: Group read get_Item;

Remarks

The index parameter may be an integer between zero and Count-1.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GroupCollection.Item Property (String)

GroupCollection.Item Property (String)

Returns a group from a Groups collection.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal name As String _

) As Group

[C#]

public Group this[

string name

] {get;}

[Delphi]

public property Item[

name: String

]: Group read get_Item;

Remarks

The name parameter may be a string containing a group name.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GroupCollection Methods

GroupCollection Methods

The methods of the GroupCollection class are listed here. For a complete list of GroupCollection class members, see the GroupCollection Members topic.

Public Methods

Add | Adds a new Group to the collection, along with header and footer sections for the new group.
Contains | Overloaded. Determines whether the collection contains a specific group.
CopyTo | Copies the elements of the collection to an System.Array, starting at a particular array index.
Remove | Overloaded. Removes a Group from the Groups collection, and its header/footer sections from the Sections collection.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GroupCollection.Add Method

GroupCollection.Add Method

Adds a new Group to the collection, along with header and footer sections for the new group.

[Visual Basic]

Public Function Add( _

ByVal name As String, _

ByVal groupBy As String, _

ByVal sort As SortEnum _

) As Group

[C#]

public Group Add(

string name,

string groupBy,

SortEnum sort

);

[Delphi]

public function Add(

name: String;

groupBy: String;

sort: SortEnum

): Group;

Parameters

name

Contains the name of the new group.

groupBy

Contains the value of the GroupBy property for the new group.

sort

Contains the value of the Sort property for the new group.

Return Value

A reference to the newly added group.

Remarks

When a group is added to a report, the control automatically adds two new sections, the group header and group footer sections for the new group. These new sections are invisible by default.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GroupCollection.Contains Method

GroupCollection.Contains Method

Overload List

Determines whether the collection contains a specific group.

[Visual Basic] Overloads Public Function Contains(Group) As Boolean

[C#] public bool Contains(Group);

[Delphi] public function Contains(Group) : Boolean; overload;

Determines whether the collection contains a specific group.

[Visual Basic] Overloads Public Function Contains(String) As Boolean

[C#] public bool Contains(string);

[Delphi] public function Contains(String) : Boolean; overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GroupCollection.Contains Method (Group)

GroupCollection.Contains Method (Group)

Determines whether the collection contains a specific group.

[Visual Basic]

Overloads Public Function Contains( _

ByVal g As Group _

) As Boolean

[C#]

public bool Contains(

Group g

);

[Delphi]

public function Contains(

g: Group

): Boolean; overload;

Parameters

g

Reference to the Group object.

Return Value

True if the collection contains specified field; otherwise, false.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GroupCollection.Contains Method (String)

GroupCollection.Contains Method (String)

Determines whether the collection contains a specific group.

[Visual Basic]

Overloads Public Function Contains( _

ByVal name As String _

) As Boolean

[C#]

public bool Contains(

string name

);

[Delphi]

public function Contains(

name: String

): Boolean; overload;

Parameters

name

The name of the group.

Return Value

True if the collection contains a group with the specified name; otherwise, false.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GroupCollection.CopyTo Method

GroupCollection.CopyTo Method

Copies the elements of the collection to an System.Array, starting at a particular array index.

[Visual Basic]

Public Sub CopyTo( _

ByVal array As Group(), _

ByVal index As Integer _

)

[C#]

public void CopyTo(

Group[] array,

int index

);

[Delphi]

public procedure CopyTo(

array: array of Group;

index: Int32

);

Parameters

array

The one-dimensional System.Array that is the destination of the elements copied from the collection. The array must have zero-based indexing.

index

The zero-based index in array at which copying begins.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GroupCollection.Remove Method

GroupCollection.Remove Method

Overload List

Removes a Group from the Groups collection, and its header/footer sections from the Sections collection.

[Visual Basic] Overloads Public Sub Remove(Group)

[C#] public Remove(Group);

[Delphi] public procedure Remove(Group); overload;

Removes a Group from the Groups collection, and its header/footer sections from the Sections collection.

[Visual Basic] Overloads Public Sub Remove(Integer)

[C#] public Remove(int);

[Delphi] public procedure Remove(Int32); overload;

Removes a Group from the Groups collection, and its header/footer sections from the Sections collection.

[Visual Basic] Overloads Public Sub Remove(String)

[C#] public Remove(string);

[Delphi] public procedure Remove(String); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GroupCollection.Remove Method (Group)

GroupCollection.Remove Method (Group)

Removes a Group from the Groups collection, and its header/footer sections from the Sections collection.

[Visual Basic]

Overloads Public Sub Remove( _

ByVal group As Group _

)

[C#]

public void Remove(

Group group

);

[Delphi]

public procedure Remove(

group: Group

); overload;

Parameters

group

The group to be removed.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GroupCollection.Remove Method (Int32)

GroupCollection.Remove Method (Int32)

Removes a Group from the Groups collection, and its header/footer sections from the Sections collection.

[Visual Basic]

Overloads Public Sub Remove( _

ByVal index As Integer _

)

[C#]

public void Remove(

int index

);

[Delphi]

public procedure Remove(

index: Int32

); overload;

Parameters

index

Specifies the group to be removed.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GroupCollection.Remove Method (String)

GroupCollection.Remove Method (String)

Removes a Group from the Groups collection, and its header/footer sections from the Sections collection.

[Visual Basic]

Overloads Public Sub Remove( _

ByVal name As String _

)

[C#]

public void Remove(

string name

);

[Delphi]

public procedure Remove(

name: String

); overload;

Parameters

name

The name of the group to be removed.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


GrowShrinkModeEnum Enumeration

GrowShrinkModeEnum Enumeration

Specifies the logic for handling CanGrow/CanShrink fields.

[Visual Basic]

Public Enum GrowShrinkModeEnum

[C#]

public enum GrowShrinkModeEnum

[Delphi]

type GrowShrinkModeEnum = (Access, C1Report);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

Remarks

Use the members of this enumeration to set the value of the GrowShrinkModeEnum.C1Report property in the GrowShrinkModeEnum.C1Report class.

Members

Member name | Description
Access | Uses a mode that is similar to MS Access, where fields that grow or shrink affect all fields below, even if they are off to the side of the field that grew or shrank.
C1Report | Uses the standard C1Report mode, where fields that grow or shrink affect only fields directly below.

See Also

C1.Win.C1Report Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HdrFtrEnum Enumeration

HdrFtrEnum Enumeration

Specifies where the Page Footer and Page Header sections are displayed.

[Visual Basic]

Public Enum HdrFtrEnum

[C#]

public enum HdrFtrEnum

[Delphi]

type HdrFtrEnum = (AllPages, NotWithReportFtr, NotWithReportHdr, NotWithReportHdrFtr);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

Remarks

Use the members of this enumeration to set the value of the PageFooter and PageHeader properties in the Layout class.

Members

Member name | Description
AllPages | The page footer and header are printed on all pages of a report.
NotWithReportFtr | The page footer isn't printed on the same page as the report footer.
NotWithReportHdr | The page header isn't printed on the same page as the report header.
NotWithReportHdrFtr | The page footer and header are not printed on a page that has either a report header or a report footer.

See Also

C1.Win.C1Report Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HtmlFilter Class

HtmlFilter Class

Used with the RenderToFilter method to render reports into HTML streams or files.

For a list of all members of this type, see HtmlFilter Members.

System.Object

C1.Win.C1Report.ExportFilter

C1.Win.C1Report.HtmlFilter

[Visual Basic]

Public Class HtmlFilter

Inherits ExportFilter

Implements IDisposable

[C#]

public class HtmlFilter : ExportFilter , IDisposable

[Delphi]

type HtmlFilter = class (ExportFilter, IDisposable);

Remarks

Creating an HtmlFilter and using it in a call to the RenderToFilter method is similar to using the RenderToFile or RenderToStream (Stream, FileFormatEnum) methods, but offers some extra flexibility because you can set properties on the HtmlFilter object before calling RenderToFilter.

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HtmlFilter Members

HtmlFilter Members

HtmlFilter overview

Public Constructors

HtmlFilter Constructor

Initializes a new instance of the HtmlFilter class attached to a stream.

Public Properties

DrillDown | Gets or sets whether the user should be able to expand and collapse groups by clicking on their header sections.
EncodeHtml | Gets or sets whether field contents should be encoded or rendered in raw format. This property allows you to render fields that contain HTML formatting.
MultiFile | Gets or sets whether the built-in HTML filter should break paged reports into multiple HTML files (one per page).
Paged | Gets or sets whether the filter should produce a continuous report into a single HTML file or a paged report into a set of HTML files.
StartCollapsed | Gets or sets whether DrillDown reports should be initially displayed in a collapsed state.

Public Methods

Dispose | Overriden. Called when the component finishes rendering a report, or when the rendering process is canceled by the user or interrupted by an error.
EndReport | Overriden. Called when the component finishes rendering a report.
EndSection | Overriden. Called when the component finishes rendering each section.
IsPaged | Overriden. Determines whether this filter generates single or multi-page reports.
NewPage | Overriden. Called after each page break on paged reports (see the IsPaged property).
RenderField | Overriden. Called when the component needs to render a report field with specific content at a specific position on the current page.
StartOverlays | Overriden. Called after the component has finished rendering the first pass of the report, and before it starts rendering overlay fields.
StartReport | Overriden. Called when the component starts rendering a report.
StartSection | Overriden. Called when the component starts rendering a section.
UsesImages | Overriden. Returns a value that determines whether the filter uses page images.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HtmlFilter Constructor

HtmlFilter Constructor

Overload List

Initializes a new instance of the HtmlFilter class attached to a stream.

[Visual Basic] Public Function New(Stream)

[C#] public HtmlFilter(Stream);

[Delphi] public constructor Create(Stream); overload;

Initializes a new instance of the HtmlFilter class attached to a file.

[Visual Basic] Public Function New(String)

[C#] public HtmlFilter(string);

[Delphi] public constructor Create(String); overload;

Initializes a new instance of the HtmlFilter class attached to a stream.

[Visual Basic] Public Function New(Stream, String, String)

[C#] public HtmlFilter(Stream, string, string);

[Delphi] public constructor Create(Stream; String; String); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HtmlFilter Constructor (Stream)

HtmlFilter Constructor (Stream)

Initializes a new instance of the HtmlFilter class attached to a stream.

[Visual Basic]

Public Function New( _

ByVal stream As Stream _

)

[C#]

public HtmlFilter(

Stream stream

);

[Delphi]

public constructor Create(

stream: Stream

); overload;

Parameters

stream

Output stream where the report will be rendered.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HtmlFilter Constructor (String)

HtmlFilter Constructor (String)

Initializes a new instance of the HtmlFilter class attached to a file.

[Visual Basic]

Public Function New( _

ByVal fileName As String _

)

[C#]

public HtmlFilter(

string fileName

);

[Delphi]

public constructor Create(

fileName: String

); overload;

Parameters

fileName

Contains the name of the file to be created. If the file already exists, it will be overwritten.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HtmlFilter Constructor (Stream, String, String)

HtmlFilter Constructor (Stream, String, String)

Initializes a new instance of the HtmlFilter class attached to a stream.

[Visual Basic]

Public Function New( _

ByVal stream As Stream, _

ByVal idPrefix As String, _

ByVal fileName As String _

)

[C#]

public HtmlFilter(

Stream stream,

string idPrefix,

string fileName

);

[Delphi]

public constructor Create(

stream: Stream;

idPrefix: String;

fileName: String

); overload;

Parameters

stream

Output stream where the report will be rendered.

idPrefix

A unique report identifier used to avoid duplicate style names when adding several reports to the same HTML stream.

fileName

Path and template of file name for member files (pictures etc).

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HtmlFilter Properties

HtmlFilter Properties

The properties of the HtmlFilter class are listed here. For a complete list of HtmlFilter class members, see the HtmlFilter Members topic.

Public Properties

DrillDown | Gets or sets whether the user should be able to expand and collapse groups by clicking on their header sections.
EncodeHtml | Gets or sets whether field contents should be encoded or rendered in raw format. This property allows you to render fields that contain HTML formatting.
MultiFile | Gets or sets whether the built-in HTML filter should break paged reports into multiple HTML files (one per page).
Paged | Gets or sets whether the filter should produce a continuous report into a single HTML file or a paged report into a set of HTML files.
StartCollapsed | Gets or sets whether DrillDown reports should be initially displayed in a collapsed state.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HtmlFilter.DrillDown Property

HtmlFilter.DrillDown Property

Gets or sets whether the user should be able to expand and collapse groups by clicking on their header sections.

[Visual Basic]

Public Property DrillDown As Boolean

[C#]

public bool DrillDown {get;set;}

[Delphi]

public property DrillDown: Boolean read get_DrillDown write set_DrillDown;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HtmlFilter.EncodeHtml Property

HtmlFilter.EncodeHtml Property

Gets or sets whether field contents should be encoded or rendered in raw format. This property allows you to render fields that contain HTML formatting.

[Visual Basic]

Public Property EncodeHtml As Boolean

[C#]

public bool EncodeHtml {get;set;}

[Delphi]

public property EncodeHtml: Boolean read get_EncodeHtml write set_EncodeHtml;

Remarks

By default, field contents are encoded, so a field containing the string "A<B>C" would be rendered as "A&lt;B&gt;C", which would appear as the original string in the browser.

If you set EncodeHtml to False, the same string would be rendered in raw format, causing the browser to display it as "A<B>C" (the "C" would be bold).

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HtmlFilter.MultiFile Property

HtmlFilter.MultiFile Property

Gets or sets whether the built-in HTML filter should break paged reports into multiple HTML files (one per page).

[Visual Basic]

Public Property MultiFile As Boolean

[C#]

public bool MultiFile {get;set;}

[Delphi]

public property MultiFile: Boolean read get_MultiFile write set_MultiFile;

Remarks

Set this property to false to create a single HTML file containing all pages, with <BR> elements at the page breaks.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HtmlFilter.Paged Property

HtmlFilter.Paged Property

Gets or sets whether the filter should produce a continuous report into a single HTML file or a paged report into a set of HTML files.

[Visual Basic]

Public Property Paged As Boolean

[C#]

public bool Paged {get;set;}

[Delphi]

public property Paged: Boolean read get_Paged write set_Paged;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HtmlFilter.StartCollapsed Property

HtmlFilter.StartCollapsed Property

Gets or sets whether DrillDown reports should be initially displayed in a collapsed state.

[Visual Basic]

Public Property StartCollapsed As Boolean

[C#]

public bool StartCollapsed {get;set;}

[Delphi]

public property StartCollapsed: Boolean read get_StartCollapsed write set_StartCollapsed;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HtmlFilter Methods

HtmlFilter Methods

The methods of the HtmlFilter class are listed here. For a complete list of HtmlFilter class members, see the HtmlFilter Members topic.

Public Methods

Dispose | Overriden. Called when the component finishes rendering a report, or when the rendering process is canceled by the user or interrupted by an error.
EndReport | Overriden. Called when the component finishes rendering a report.
EndSection | Overriden. Called when the component finishes rendering each section.
IsPaged | Overriden. Determines whether this filter generates single or multi-page reports.
NewPage | Overriden. Called after each page break on paged reports (see the IsPaged property).
RenderField | Overriden. Called when the component needs to render a report field with specific content at a specific position on the current page.
StartOverlays | Overriden. Called after the component has finished rendering the first pass of the report, and before it starts rendering overlay fields.
StartReport | Overriden. Called when the component starts rendering a report.
StartSection | Overriden. Called when the component starts rendering a section.
UsesImages | Overriden. Returns a value that determines whether the filter uses page images.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HtmlFilter.Dispose Method

HtmlFilter.Dispose Method

Called when the component finishes rendering a report, or when the rendering process is canceled by the user or interrupted by an error.

[Visual Basic]

Overrides Public Sub Dispose() Implements IDisposable.Dispose

[C#]

override public void Dispose()

[Delphi]

public procedure Dispose(); override;

Implements

IDisposable.Dispose

Remarks

Use this method to free any disposable objects used by the filter.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HtmlFilter.EndReport Method

HtmlFilter.EndReport Method

Called when the component finishes rendering a report.

[Visual Basic]

Overrides Public Sub EndReport()

[C#]

override public void EndReport()

[Delphi]

public procedure EndReport(); override;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HtmlFilter.EndSection Method

HtmlFilter.EndSection Method

Called when the component finishes rendering each section.

[Visual Basic]

Overrides Public Sub EndSection( _

ByVal section As Section _

)

[C#]

override public void EndSection(

Section section

);

[Delphi]

public procedure EndSection(

section: Section

); override;

Parameters

section

Section that was rendered.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HtmlFilter.IsPaged Method

HtmlFilter.IsPaged Method

Determines whether this filter generates single or multi-page reports.

[Visual Basic]

Overrides Public Function IsPaged() As Boolean

[C#]

override public bool IsPaged()

[Delphi]

public function IsPaged(): Boolean; override;

Return Value

True if report is paged.

Remarks

When generating paged reports, the component calls the filter's NewPage method on page breaks and updates the value of the Page property.

When generating non-paged (continuous) reports, only one long page is generated.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HtmlFilter.NewPage Method

HtmlFilter.NewPage Method

Called after each page break on paged reports (see the IsPaged property).

[Visual Basic]

Overrides Public Sub NewPage()

[C#]

override public void NewPage()

[Delphi]

public procedure NewPage(); override;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HtmlFilter.RenderField Method

HtmlFilter.RenderField Method

Called when the component needs to render a report field with specific content at a specific position on the current page.

[Visual Basic]

Overrides Public Sub RenderField( _

ByVal field As Field, _

ByVal rc As Rectangle, _

ByVal text As String, _

ByVal img As Image _

)

[C#]

override public void RenderField(

Field field,

Rectangle rc,

string text,

Image img

);

[Delphi]

public procedure RenderField(

field: Field;

rc: Rectangle;

text: String;

img: Image

); override;

Parameters

field

The field to be rendered.

rc

Rectangle that determines the field position on the current page, in twips.

text

Field text to render.

img

Field image to render.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HtmlFilter.StartOverlays Method

HtmlFilter.StartOverlays Method

Called after the component has finished rendering the first pass of the report, and before it starts rendering overlay fields.

[Visual Basic]

Overrides Public Sub StartOverlays()

[C#]

override public void StartOverlays()

[Delphi]

public procedure StartOverlays(); override;

Remarks

Overlay fields are used only in reports that contain calculated fields which use the Pages variable.

This value is not known until the report has been generated, and is therefore rendered on a second pass.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HtmlFilter.StartReport Method

HtmlFilter.StartReport Method

Called when the component starts rendering a report.

[Visual Basic]

Overrides Public Sub StartReport( _

ByVal report As C1Report _

)

[C#]

override public void StartReport(

C1Report report

);

[Delphi]

public procedure StartReport(

report: C1Report

); override;

Parameters

report

Owner report.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HtmlFilter.StartSection Method

HtmlFilter.StartSection Method

Called when the component starts rendering a section.

[Visual Basic]

Overrides Public Sub StartSection( _

ByVal section As Section, _

ByVal x As Double, _

ByVal y As Double _

)

[C#]

override public void StartSection(

Section section,

Double x,

Double y

);

[Delphi]

public procedure StartSection(

section: Section;

x: Double;

y: Double

); override;

Parameters

section

The section being rendered.

x

Left position of the section, in twips.

y

Top position of the section, in twips.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


HtmlFilter.UsesImages Method

HtmlFilter.UsesImages Method

Returns a value that determines whether the filter uses page images.

[Visual Basic]

Overrides Public Function UsesImages() As Boolean

[C#]

override public bool UsesImages()

[Delphi]

public function UsesImages(): Boolean; override;

Return Value

Always returns false.

Remarks

By default, C1Report will render the report into the filter and also into its own PageImages collection.

HtmlFilter doesn't need the images and therefore this method always returns false, which saves some resources while rendering long reports.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


IC1ReportRecordset Interface

IC1ReportRecordset Interface

Interface used to access report data from data source objects.

For a list of all members of this type, see IC1ReportRecordset Members.

[Visual Basic]

Public Interface IC1ReportRecordset

[C#]

public interface IC1ReportRecordset

[Delphi]

type IC1ReportRecordset = interface;

Remarks

Any object that can be used as custom data source for reports must implement this interface.

The C1Report component provides this implementation for common data sources such as System.Data.DataTable and System.Data.DataView classes.

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


IC1ReportRecordset Members

IC1ReportRecordset Members

IC1ReportRecordset overview

Public Methods

ApplyFilter | Applies a filter string. See the System.Data.DataView.RowFilter property for details.
ApplySort | Applies a sort string. See the System.Data.DataView.Sort property for details.
BOF | Returns true if the cursor is pointing at the first record in the data source.
EOF | Returns true if the cursor is pointing past the last record in the data source.
GetBookmark | Returns the current cursor position.
GetFieldNames | Gets a string vector with the names of each field in the data source.
GetFieldTypes | Gets a vector with the types of each field in the data source.
GetFieldValue | Gets the value of the given field, at the cursor position.
MoveFirst | Moves the cursor to the first record in the data source.
MoveLast | Moves the cursor to the last record in the data source.
MoveNext | Moves the cursor to the next record in the data source.
MovePrevious | Moves the cursor to the previous record in the data source.
SetBookmark | Sets the current cursor position to supplied value.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


IC1ReportRecordset Methods

IC1ReportRecordset Methods

The methods of the IC1ReportRecordset interface are listed here. For a complete list of IC1ReportRecordset interface members, see the IC1ReportRecordset Members topic.

Public Methods

ApplyFilter | Applies a filter string. See the System.Data.DataView.RowFilter property for details.
ApplySort | Applies a sort string. See the System.Data.DataView.Sort property for details.
BOF | Returns true if the cursor is pointing at the first record in the data source.
EOF | Returns true if the cursor is pointing past the last record in the data source.
GetBookmark | Returns the current cursor position.
GetFieldNames | Gets a string vector with the names of each field in the data source.
GetFieldTypes | Gets a vector with the types of each field in the data source.
GetFieldValue | Gets the value of the given field, at the cursor position.
MoveFirst | Moves the cursor to the first record in the data source.
MoveLast | Moves the cursor to the last record in the data source.
MoveNext | Moves the cursor to the next record in the data source.
MovePrevious | Moves the cursor to the previous record in the data source.
SetBookmark | Sets the current cursor position to supplied value.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


IC1ReportRecordset.ApplyFilter Method

IC1ReportRecordset.ApplyFilter Method

Applies a filter string. See the System.Data.DataView.RowFilter property for details.

[Visual Basic]

Sub ApplyFilter( _

ByVal filter As String _

)

[C#]

void ApplyFilter(

string filter

);

[Delphi]

procedure ApplyFilter(

filter: String

);

Parameters

filter

Filter string.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


IC1ReportRecordset.ApplySort Method

IC1ReportRecordset.ApplySort Method

Applies a sort string. See the System.Data.DataView.Sort property for details.

[Visual Basic]

Sub ApplySort( _

ByVal sort As String _

)

[C#]

void ApplySort(

string sort

);

[Delphi]

procedure ApplySort(

sort: String

);

Parameters

sort

Sort string.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


IC1ReportRecordset.BOF Method

IC1ReportRecordset.BOF Method

Returns true if the cursor is pointing at the first record in the data source.

[Visual Basic]

Function BOF() As Boolean

[C#]

bool BOF()

[Delphi]

function BOF(): Boolean;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


IC1ReportRecordset.EOF Method

IC1ReportRecordset.EOF Method

Returns true if the cursor is pointing past the last record in the data source.

[Visual Basic]

Function EOF() As Boolean

[C#]

bool EOF()

[Delphi]

function EOF(): Boolean;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


IC1ReportRecordset.GetBookmark Method

IC1ReportRecordset.GetBookmark Method

Returns the current cursor position.

[Visual Basic]

Function GetBookmark() As Integer

[C#]

int GetBookmark()

[Delphi]

function GetBookmark(): Int32;

Return Value

Index of current record.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


IC1ReportRecordset.GetFieldNames Method

IC1ReportRecordset.GetFieldNames Method

Gets a string vector with the names of each field in the data source.

[Visual Basic]

Function GetFieldNames() As String

[C#]

string GetFieldNames()

[Delphi]

function GetFieldNames(): String;

Return Value

A string vector with the names of each field in the data source.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


IC1ReportRecordset.GetFieldTypes Method

IC1ReportRecordset.GetFieldTypes Method

Gets a vector with the types of each field in the data source.

[Visual Basic]

Function GetFieldTypes() As Type()

[C#]

Type[] GetFieldTypes()

[Delphi]

function GetFieldTypes(): array of Type;

Return Value

A vector with the types of each field in the data source.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


IC1ReportRecordset.GetFieldValue Method

IC1ReportRecordset.GetFieldValue Method

Gets the value of the given field, at the cursor position.

[Visual Basic]

Function GetFieldValue( _

ByVal fieldIndex As Integer _

) As Object

[C#]

object GetFieldValue(

int fieldIndex

);

[Delphi]

function GetFieldValue(

fieldIndex: Int32

): Object;

Parameters

fieldIndex

Index of the field.

Return Value

Value of the field.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


IC1ReportRecordset.MoveFirst Method

IC1ReportRecordset.MoveFirst Method

Moves the cursor to the first record in the data source.

[Visual Basic]

Sub MoveFirst()

[C#]

void MoveFirst()

[Delphi]

procedure MoveFirst();

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


IC1ReportRecordset.MoveLast Method

IC1ReportRecordset.MoveLast Method

Moves the cursor to the last record in the data source.

[Visual Basic]

Sub MoveLast()

[C#]

void MoveLast()

[Delphi]

procedure MoveLast();

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


IC1ReportRecordset.MoveNext Method

IC1ReportRecordset.MoveNext Method

Moves the cursor to the next record in the data source.

[Visual Basic]

Sub MoveNext()

[C#]

void MoveNext()

[Delphi]

procedure MoveNext();

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


IC1ReportRecordset.MovePrevious Method

IC1ReportRecordset.MovePrevious Method

Moves the cursor to the previous record in the data source.

[Visual Basic]

Sub MovePrevious()

[C#]

void MovePrevious()

[Delphi]

procedure MovePrevious();

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


IC1ReportRecordset.SetBookmark Method

IC1ReportRecordset.SetBookmark Method

Sets the current cursor position to supplied value.

[Visual Basic]

Sub SetBookmark( _

ByVal bkmk As Integer _

)

[C#]

void SetBookmark(

int bkmk

);

[Delphi]

procedure SetBookmark(

bkmk: Int32

);

Parameters

bkmk

Index of record.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


KeepTogetherEnum Enumeration

KeepTogetherEnum Enumeration

Specifies whether the group should be kept together on a page.

[Visual Basic]

Public Enum KeepTogetherEnum

[C#]

public enum KeepTogetherEnum

[Delphi]

type KeepTogetherEnum = (KeepFirstDetail, KeepNothing, KeepWholeGroup);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

Remarks

Use the members of this enumeration to set the value of the KeepTogether and KeepTogether property in the Group and Section classes.

Members

Member name | Description
KeepFirstDetail | Keep the group header and first detail section together on a page.
KeepNothing | Do not try to keep the group together.
KeepWholeGroup | Keep the group header, detail, and footer together on a page.

See Also

C1.Win.C1Report Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Layout Class

Layout Class

The Layout object controls how the report is rendered on pages.

For a list of all members of this type, see Layout Members.

System.Object

C1.Win.C1Report.Layout

[Visual Basic]

Public Class Layout

[C#]

public class Layout

[Delphi]

type Layout = class;

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Layout Members

Layout Members

Layout overview

Public Properties

ColumnLayout | Gets or sets the layout for the columns (down or across).
Columns | Gets or sets the number of detail columns.
CustomHeight | Gets or sets the custom height for the report, in twips.
CustomWidth | Gets or sets the custom width for the report, in twips.
LabelSpacingX | Used by the designer to discount horizontal label spacing in the design surface.
LabelSpacingY | Used by the designer to discount vertical label spacing in the design surface.
MarginBottom | Gets or sets the bottom margin for each page, in twips.
MarginLeft | Gets or sets the left margin for each page, in twips.
MarginRight | Gets or sets the right margin for each page, in twips.
MarginTop | Gets or sets the top margin for each page, in twips.
Orientation | Gets or sets the page orientation.
PageFooter | Gets or sets a value that determines on which pages the Page Footer section should be displayed.
PageHeader | Gets or sets a value that determines on which pages the Page Header section should be displayed.
PaperSize | Gets or sets the paper size for the report.
ParentReport | Gets the C1Report that contains this Layout object.
Picture | Gets or sets a background picture for the report body.
PictureAlign | Gets or sets how the background picture is aligned.
PictureScale | Gets or sets how the background picture is aligned.
PictureShow | Gets or sets where the background picture is displayed.
Width | Gets or sets the width of the report's detail section, in twips.

Public Methods

ToString | Overriden. Returns a description of layout to show it in designer.
UpdateFromPrintDoc | Copies information from C1.Win.C1Report.PrintDoc to Layout object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Layout Properties

Layout Properties

The properties of the Layout class are listed here. For a complete list of Layout class members, see the Layout Members topic.

Public Properties

ColumnLayout | Gets or sets the layout for the columns (down or across).
Columns | Gets or sets the number of detail columns.
CustomHeight | Gets or sets the custom height for the report, in twips.
CustomWidth | Gets or sets the custom width for the report, in twips.
LabelSpacingX | Used by the designer to discount horizontal label spacing in the design surface.
LabelSpacingY | Used by the designer to discount vertical label spacing in the design surface.
MarginBottom | Gets or sets the bottom margin for each page, in twips.
MarginLeft | Gets or sets the left margin for each page, in twips.
MarginRight | Gets or sets the right margin for each page, in twips.
MarginTop | Gets or sets the top margin for each page, in twips.
Orientation | Gets or sets the page orientation.
PageFooter | Gets or sets a value that determines on which pages the Page Footer section should be displayed.
PageHeader | Gets or sets a value that determines on which pages the Page Header section should be displayed.
PaperSize | Gets or sets the paper size for the report.
ParentReport | Gets the C1Report that contains this Layout object.
Picture | Gets or sets a background picture for the report body.
PictureAlign | Gets or sets how the background picture is aligned.
PictureScale | Gets or sets how the background picture is aligned.
PictureShow | Gets or sets where the background picture is displayed.
Width | Gets or sets the width of the report's detail section, in twips.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Layout.ColumnLayout Property

Layout.ColumnLayout Property

Gets or sets the layout for the columns (down or across).

[Visual Basic]

Public Property ColumnLayout As ColumnLayoutEnum

[C#]

public ColumnLayoutEnum ColumnLayout {get;set;}

[Delphi]

public property ColumnLayout: ColumnLayoutEnum read get_ColumnLayout write set_ColumnLayout;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Layout.Columns Property

Layout.Columns Property

Gets or sets the number of detail columns.

[Visual Basic]

Public Property Columns As Integer

[C#]

public int Columns {get;set;}

[Delphi]

public property Columns: Int32 read get_Columns write set_Columns;

Remarks

Use this property to create multi-column reports.

In multi-column reports, header and footer sections span the full width of the report. Only the detail section is rendered in multiple columns. Use the Width property to specify the width of each column, and the ColumnLayout property to specify whether columns should be laid out across the page or down the page.

Multi-column reports are useful for printing reports on mailing labels and other types of multi-column pre-printed forms. They are also useful for creating compact reports where detail information is laid out across the page.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Layout.CustomHeight Property

Layout.CustomHeight Property

Gets or sets the custom height for the report, in twips.

[Visual Basic]

Public Property CustomHeight As Double

[C#]

public Double CustomHeight {get;set;}

[Delphi]

public property CustomHeight: Double read get_CustomHeight write set_CustomHeight;

Remarks

To create reports using custom paper sizes, set the PaperSize property to System.Drawing.Printing.PaperKind.Custom, then set the CustomWidth and CustomHeight properties to the size of the page measured in twips.

If the PaperSize is set to a value other than System.Drawing.Printing.PaperKind.Custom, the paper size is determined by that setting. The CustomWidth and CustomHeight properties are not used in this case.

If the PaperSize is set to System.Drawing.Printing.PaperKind.Custom and the CustomWidth or CustomHeight properties are set to zero, the printer's default paper size is used.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Layout.CustomWidth Property

Layout.CustomWidth Property

Gets or sets the custom width for the report, in twips.

[Visual Basic]

Public Property CustomWidth As Double

[C#]

public Double CustomWidth {get;set;}

[Delphi]

public property CustomWidth: Double read get_CustomWidth write set_CustomWidth;

Remarks

To create reports using custom paper sizes, set the PaperSize property to System.Drawing.Printing.PaperKind.Custom, then set the CustomWidth and CustomHeight properties to the size of the page measured in twips.

If the PaperSize is set to a value other than System.Drawing.Printing.PaperKind.Custom, the paper size is determined by that setting. The CustomWidth and CustomHeight properties are not used in this case.

If the PaperSize is set to System.Drawing.Printing.PaperKind.Custom and the CustomWidth or CustomHeight properties are set to zero, the printer's default paper size is used.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Layout.LabelSpacingX Property

Layout.LabelSpacingX Property

Used by the designer to discount horizontal label spacing in the design surface.

[Visual Basic]

Public Property LabelSpacingX As Double

[C#]

public Double LabelSpacingX {get;set;}

[Delphi]

public property LabelSpacingX: Double read get_LabelSpacingX write set_LabelSpacingX;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Layout.LabelSpacingY Property

Layout.LabelSpacingY Property

Used by the designer to discount vertical label spacing in the design surface.

[Visual Basic]

Public Property LabelSpacingY As Double

[C#]

public Double LabelSpacingY {get;set;}

[Delphi]

public property LabelSpacingY: Double read get_LabelSpacingY write set_LabelSpacingY;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Layout.MarginBottom Property

Layout.MarginBottom Property

Gets or sets the bottom margin for each page, in twips.

[Visual Basic]

Public Property MarginBottom As Double

[C#]

public Double MarginBottom {get;set;}

[Delphi]

public property MarginBottom: Double read get_MarginBottom write set_MarginBottom;

Remarks

The margins are measured in twips, from the edges of the paper. You can select the paper size and orientation using the PaperSize and Orientation properties.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Layout.MarginLeft Property

Layout.MarginLeft Property

Gets or sets the left margin for each page, in twips.

[Visual Basic]

Public Property MarginLeft As Double

[C#]

public Double MarginLeft {get;set;}

[Delphi]

public property MarginLeft: Double read get_MarginLeft write set_MarginLeft;

Remarks

The margins are measured in twips, from the edges of the paper. You can select the paper size and orientation using the PaperSize and Orientation properties.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Layout.MarginRight Property

Layout.MarginRight Property

Gets or sets the right margin for each page, in twips.

[Visual Basic]

Public Property MarginRight As Double

[C#]

public Double MarginRight {get;set;}

[Delphi]

public property MarginRight: Double read get_MarginRight write set_MarginRight;

Remarks

The margins are measured in twips, from the edges of the paper. You can select the paper size and orientation using the PaperSize and Orientation properties.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Layout.MarginTop Property

Layout.MarginTop Property

Gets or sets the top margin for each page, in twips.

[Visual Basic]

Public Property MarginTop As Double

[C#]

public Double MarginTop {get;set;}

[Delphi]

public property MarginTop: Double read get_MarginTop write set_MarginTop;

Remarks

The margins are measured in twips, from the edges of the paper. You can select the paper size and orientation using the PaperSize and Orientation properties.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Layout.Orientation Property

Layout.Orientation Property

Gets or sets the page orientation.

[Visual Basic]

Public Property Orientation As OrientationEnum

[C#]

public OrientationEnum Orientation {get;set;}

[Delphi]

public property Orientation: OrientationEnum read get_Orientation write set_Orientation;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Layout.PageFooter Property

Layout.PageFooter Property

Gets or sets a value that determines on which pages the Page Footer section should be displayed.

[Visual Basic]

Public Property PageFooter As HdrFtrEnum

[C#]

public HdrFtrEnum PageFooter {get;set;}

[Delphi]

public property PageFooter: HdrFtrEnum read get_PageFooter write set_PageFooter;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Layout.PageHeader Property

Layout.PageHeader Property

Gets or sets a value that determines on which pages the Page Header section should be displayed.

[Visual Basic]

Public Property PageHeader As HdrFtrEnum

[C#]

public HdrFtrEnum PageHeader {get;set;}

[Delphi]

public property PageHeader: HdrFtrEnum read get_PageHeader write set_PageHeader;

Remarks

You can use the PageHeader and PageFooter properties to specify whether a report's page header or page footer should be printed on the same page as a report header or report footer.

For example, you might not want to print a page header containing the page number on the first page of a report if the report header is a cover sheet.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Layout.PaperSize Property

Layout.PaperSize Property

Gets or sets the paper size for the report.

[Visual Basic]

Public Property PaperSize As PaperKind

[C#]

public PaperKind PaperSize {get;set;}

[Delphi]

public property PaperSize: PaperKind read get_PaperSize write set_PaperSize;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Layout.ParentReport Property

Layout.ParentReport Property

Gets the C1Report that contains this Layout object.

[Visual Basic]

Public ReadOnly Property ParentReport As C1Report

[C#]

public C1Report ParentReport {get;}

[Delphi]

public property ParentReport: C1Report read get_ParentReport;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Layout.Picture Property

Layout.Picture Property

Gets or sets a background picture for the report body.

[Visual Basic]

Public Property Picture As Object

[C#]

public object Picture {get;set;}

[Delphi]

public property Picture: Object read get_Picture write set_Picture;

Remarks

Use the Picture property to specify a bitmap or other type of graphic to be displayed as a background picture on a report (watermark-style).

Use the PictureShow, PictureAlign, and PictureScale properties to specify which pages should display the picture and how it should be aligned and scaled.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Layout.PictureAlign Property

Layout.PictureAlign Property

Gets or sets how the background picture is aligned.

[Visual Basic]

Public Property PictureAlign As PictureAlignEnum

[C#]

public PictureAlignEnum PictureAlign {get;set;}

[Delphi]

public property PictureAlign: PictureAlignEnum read get_PictureAlign write set_PictureAlign;

Remarks

To select the background picture and which pages should display it, use the Picture and PictureShow properties.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Layout.PictureScale Property

Layout.PictureScale Property

Gets or sets how the background picture is aligned.

[Visual Basic]

Public Property PictureScale As PictureScaleEnum

[C#]

public PictureScaleEnum PictureScale {get;set;}

[Delphi]

public property PictureScale: PictureScaleEnum read get_PictureScale write set_PictureScale;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Layout.PictureShow Property

Layout.PictureShow Property

Gets or sets where the background picture is displayed.

[Visual Basic]

Public Property PictureShow As PictureShowEnum

[C#]

public PictureShowEnum PictureShow {get;set;}

[Delphi]

public property PictureShow: PictureShowEnum read get_PictureShow write set_PictureShow;

Remarks

To select the background picture and how it should be aligned on the page, use the Picture, PictureAlign, and PictureScale properties.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Layout.Width Property

Layout.Width Property

Gets or sets the width of the report's detail section, in twips.

[Visual Basic]

Public Property Width As Double

[C#]

public Double Width {get;set;}

[Delphi]

public property Width: Double read get_Width write set_Width;

Remarks

This property determines the width of the detail section of the report.

Multi-column reports have header and footer sections that span all columns so their actual width is Width * Columns.

For example, a two-column report with a one-inch wide detail section would have Width = 1440, and its total width would be 2 * 1440 = 2880.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Layout Methods

Layout Methods

The methods of the Layout class are listed here. For a complete list of Layout class members, see the Layout Members topic.

Public Methods

ToString | Overriden. Returns a description of layout to show it in designer.
UpdateFromPrintDoc | Copies information from C1.Win.C1Report.PrintDoc to Layout object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Layout.ToString Method

Layout.ToString Method

Returns a description of layout to show it in designer.

[Visual Basic]

Overrides Public Function ToString() As String

[C#]

override public string ToString()

[Delphi]

public function ToString(): String; override;

Return Value

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Layout.UpdateFromPrintDoc Method

Layout.UpdateFromPrintDoc Method

Copies information from C1.Win.C1Report.PrintDoc to Layout object.

[Visual Basic]

Public Function UpdateFromPrintDoc() As Boolean

[C#]

public bool UpdateFromPrintDoc()

[Delphi]

public function UpdateFromPrintDoc(): Boolean;

Return Value

True if Layout object was changed.

Remarks

This is useful if you want to make changes to the System.Drawing.Printing.PageSettings object instead of the Layout object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


LineSlantEnum Enumeration

LineSlantEnum Enumeration

Determines whether/how a line should be drawn across the field (as opposed to a box around the field).

[Visual Basic]

Public Enum LineSlantEnum

[C#]

public enum LineSlantEnum

[Delphi]

type LineSlantEnum = (Down, NoLine, NoSlant, Up);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

Remarks

Use the members of this enumeration to set the value of the LineSlant property in the Field class.

Members

Member name | Description
Down | Render field as a line between the left-top and right-bottom corners of the field box.
NoLine | Regular field (not a line).
NoSlant | Render field as a vertical line (if Height > Width) or as a horizontal line (if Width > Height).
Up | Render field as a line between the left-bottom and right-top corners of the field box.

See Also

C1.Win.C1Report Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


OrientationEnum Enumeration

OrientationEnum Enumeration

Specifies the page orientation.

[Visual Basic]

Public Enum OrientationEnum

[C#]

public enum OrientationEnum

[Delphi]

type OrientationEnum = (Auto, Landscape, Portrait);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

Remarks

Use the members of this enumeration to set the value of the Orientation property in the Layout class.

Members

Member name | Description
Auto | Set the orientation automatically, based on the current PaperSize and report width ( Width).
Landscape | Use Landscape orientation (wide).
Portrait | Use Portrait orientation (tall).

See Also

C1.Win.C1Report Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PdfFilter Class

PdfFilter Class

Used with the RenderToFilter method to render reports into PDF (portable document format) streams or files.

For a list of all members of this type, see PdfFilter Members.

System.Object

C1.Win.C1Report.ExportFilter

C1.Win.C1Report.PdfFilter

[Visual Basic]

Public Class PdfFilter

Inherits ExportFilter

[C#]

public class PdfFilter : ExportFilter

[Delphi]

type PdfFilter = class (ExportFilter);

Remarks

Creating a PdfFilter and using it in a call to RenderToFilter is similar to using the RenderToFile or RenderToStream (Stream, FileFormatEnum) methods, but offers some extra flexibility because you can set properties on the PdfFilter before calling RenderToFilter.

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PdfFilter Members

PdfFilter Members

PdfFilter overview

Public Constructors

PdfFilter Constructor

Initializes a new instance of the PdfFilter class attached to a stream.

Public Properties

EmbedFonts | Gets or sets whether the filter should embed font information into the PDF output.
Outline | Gets or sets whether the PDF output should include an outline tree.
Password | Gets or sets the owner password associated with the PDF document.

Public Methods

Dispose (inherited from ExportFilter) | Releases the resources used by the filter.
EndReport | Overriden. Called when the component finishes rendering a report.
IsPaged (inherited from ExportFilter) | Determines whether this filter generates single or multi-page reports.
NewPage (inherited from ExportFilter) | Called after each page break on paged reports (see the IsPaged property).
StartOverlays (inherited from ExportFilter) | Called after the component has finished rendering the first pass of the report, and before it starts rendering overlay fields.
StartReport | Overriden. Called when the component starts rendering a report.
UsesImages (inherited from ExportFilter) | Returns a value that determines whether the filter requires page images to be generated.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PdfFilter Constructor

PdfFilter Constructor

Overload List

Initializes a new instance of the PdfFilter class attached to a stream.

[Visual Basic] Public Function New(Stream)

[C#] public PdfFilter(Stream);

[Delphi] public constructor Create(Stream); overload;

Initializes a new instance of the PdfFilter class attached to a file.

[Visual Basic] Public Function New(String)

[C#] public PdfFilter(string);

[Delphi] public constructor Create(String); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PdfFilter Constructor (Stream)

PdfFilter Constructor (Stream)

Initializes a new instance of the PdfFilter class attached to a stream.

[Visual Basic]

Public Function New( _

ByVal stream As Stream _

)

[C#]

public PdfFilter(

Stream stream

);

[Delphi]

public constructor Create(

stream: Stream

); overload;

Parameters

stream

Output System.IO.Stream where the report will be rendered.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PdfFilter Constructor (String)

PdfFilter Constructor (String)

Initializes a new instance of the PdfFilter class attached to a file.

[Visual Basic]

Public Function New( _

ByVal fileName As String _

)

[C#]

public PdfFilter(

string fileName

);

[Delphi]

public constructor Create(

fileName: String

); overload;

Parameters

fileName

Full name of the file to be created. If the file already exists, it will be overwritten.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PdfFilter Properties

PdfFilter Properties

The properties of the PdfFilter class are listed here. For a complete list of PdfFilter class members, see the PdfFilter Members topic.

Public Properties

EmbedFonts | Gets or sets whether the filter should embed font information into the PDF output.
Outline | Gets or sets whether the PDF output should include an outline tree.
Password | Gets or sets the owner password associated with the PDF document.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PdfFilter.EmbedFonts Property

PdfFilter.EmbedFonts Property

Gets or sets whether the filter should embed font information into the PDF output.

[Visual Basic]

Public Property EmbedFonts As Boolean

[C#]

public bool EmbedFonts {get;set;}

[Delphi]

public property EmbedFonts: Boolean read get_EmbedFonts write set_EmbedFonts;

Remarks

Embedding font information makes the PDF document substantially larger, but it allows the file to be viewed faithfully in systems that don't have all the necessary fonts installed.

Enbedding fonts is not necessary if the target systems have the necessary TrueType fonts installed.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PdfFilter.Outline Property

PdfFilter.Outline Property

Gets or sets whether the PDF output should include an outline tree.

[Visual Basic]

Public Property Outline As Boolean

[C#]

public bool Outline {get;set;}

[Delphi]

public property Outline: Boolean read get_Outline write set_Outline;

Remarks

The tree is created automatically based on the report groups and can be used to navigate through the report in the Adobe Acrobat viewer.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PdfFilter.Password Property

PdfFilter.Password Property

Gets or sets the owner password associated with the PDF document.

[Visual Basic]

Public Property Password As String

[C#]

public string Password {get;set;}

[Delphi]

public property Password: String read get_Password write set_Password;

Remarks

The owner password is required for making changes to the document.

By default, the password is set to an empty string, which means anyone can open and edit the PDF document.

The PdfFilter never sets the user password for the file, which means anyone can open and view the PDF document.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PdfFilter Methods

PdfFilter Methods

The methods of the PdfFilter class are listed here. For a complete list of PdfFilter class members, see the PdfFilter Members topic.

Public Methods

Dispose (inherited from ExportFilter) | Releases the resources used by the filter.
EndReport | Overriden. Called when the component finishes rendering a report.
IsPaged (inherited from ExportFilter) | Determines whether this filter generates single or multi-page reports.
NewPage (inherited from ExportFilter) | Called after each page break on paged reports (see the IsPaged property).
StartOverlays (inherited from ExportFilter) | Called after the component has finished rendering the first pass of the report, and before it starts rendering overlay fields.
StartReport | Overriden. Called when the component starts rendering a report.
UsesImages (inherited from ExportFilter) | Returns a value that determines whether the filter requires page images to be generated.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PdfFilter.EndReport Method

PdfFilter.EndReport Method

Called when the component finishes rendering a report.

[Visual Basic]

Overrides Public Sub EndReport()

[C#]

override public void EndReport()

[Delphi]

public procedure EndReport(); override;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PdfFilter.StartReport Method

PdfFilter.StartReport Method

Called when the component starts rendering a report.

[Visual Basic]

Overrides Public Sub StartReport( _

ByVal report As C1Report _

)

[C#]

override public void StartReport(

C1Report report

);

[Delphi]

public procedure StartReport(

report: C1Report

); override;

Parameters

report

Owner report.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PictureAlignEnum Enumeration

PictureAlignEnum Enumeration

Specifies the alignment of images within the field's rectangle.

[Visual Basic]

Public Enum PictureAlignEnum

[C#]

public enum PictureAlignEnum

[Delphi]

type PictureAlignEnum = (CenterBottom, CenterMiddle, CenterTop, Clip, LeftBottom, LeftMiddle, LeftTop, RightBottom, RightMiddle, RightTop, Stretch, Tile, Zoom);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

Remarks

Use the members of this enumeration to set the value of the PictureAlign and PictureAlign properties in the Field and Layout classes.

Members

Member name | Description
CenterBottom | Align to the center and to the bottom, clipping if necessary.
CenterMiddle | Align to the center and to the middle, clipping if necessary.
CenterTop | Align to the center and to the top, clipping if necessary.
Clip | Align to the left and to the top, clipping if necessary.
LeftBottom | Align to the left and to the bottom, clipping if necessary.
LeftMiddle | Align to the left and to the middle, clipping if necessary.
LeftTop | Align to the left and to the top, clipping if necessary.
RightBottom | Align to the right and to the bottom, clipping if necessary.
RightMiddle | Align to the right and to the middle, clipping if necessary.
RightTop | Align to the right and to the top, clipping if necessary.
Stretch | Stretch the picture to fill the page.
Tile | Tile the picture to fill the page.
Zoom | Scale the picture to use as much of the page as possible, while preserving the picture's aspect ratio.

See Also

C1.Win.C1Report Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PictureScaleEnum Enumeration

PictureScaleEnum Enumeration

Specifies the scaling of images within the field's rectangle.

[Visual Basic]

Public Enum PictureScaleEnum

[C#]

public enum PictureScaleEnum

[Delphi]

type PictureScaleEnum = (Clip, Hide, Scale, Stretch, Tile);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

Remarks

Use the members of this enumeration to set the value of the PictureScale and PictureScale properties in the Field and Layout classes.

Members

Member name | Description
Clip | Use the image's original size, clipping it to the display area if necessary.
Hide | Hide the picture.
Scale | Scale the picture to fit the display area. This mode may increase or reduce the size of the image while maintaining its aspect ratio.
Stretch | Stretch the picture to fill the display area. This mode will usually change the image's aspect ratio.
Tile | Tile the picture to fill the display area.

See Also

C1.Win.C1Report Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PictureShowEnum Enumeration

PictureShowEnum Enumeration

Specifies where the background picture is displayed.

[Visual Basic]

Public Enum PictureShowEnum

[C#]

public enum PictureShowEnum

[Delphi]

type PictureShowEnum = (AllButFirstPage, AllPages, FirstPage, NoPages);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

Remarks

Use the members of this enumeration to set the value of the PictureShow property in the Layout class.

Members

Member name | Description
AllButFirstPage | Show the background picture on all pages but the first.
AllPages | Show the background picture on all pages.
FirstPage | Show the background picture on the first page only.
NoPages | Do not show the background picture.

See Also

C1.Win.C1Report Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ReportEventArgs Class

ReportEventArgs Class

Provides data for StartPage, EndPage, StartSection, PrintSection, EndSection and the ReportError events.

For a list of all members of this type, see ReportEventArgs Members.

System.Object

System.EventArgs

C1.Win.C1Report.ReportEventArgs

[Visual Basic]

Public Class ReportEventArgs

Inherits EventArgs

[C#]

public class ReportEventArgs : EventArgs

[Delphi]

type ReportEventArgs = class (EventArgs);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ReportEventArgs Members

ReportEventArgs Members

ReportEventArgs overview

Public Fields

Exception | Exception that caused the error.
Handled | Gets or sets a value that indicates whether the component should throw the Exception that was detected or whether it should ignore the error and continue rendering the report.
Page | The current page.
Section | The current section.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ReportEventArgs Fields

ReportEventArgs Fields

The fields of the ReportEventArgs class are listed here. For a complete list of ReportEventArgs class members, see the ReportEventArgs Members topic.

Public Fields

Exception | Exception that caused the error.
Handled | Gets or sets a value that indicates whether the component should throw the Exception that was detected or whether it should ignore the error and continue rendering the report.
Page | The current page.
Section | The current section.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ReportEventArgs.Exception Field

ReportEventArgs.Exception Field

Exception that caused the error.

[Visual Basic]

Public ReadOnly Exception As Exception

[C#]

public readonly Exception Exception

[Delphi]

public Exception: Exception;

Remarks

This property is only used with the ReportError event.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ReportEventArgs.Handled Field

ReportEventArgs.Handled Field

Gets or sets a value that indicates whether the component should throw the Exception that was detected or whether it should ignore the error and continue rendering the report.

[Visual Basic]

Public Handled As Boolean

[C#]

public bool Handled

[Delphi]

public Handled: Boolean;

Remarks

This property is only used with the ReportError event.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ReportEventArgs.Page Field

ReportEventArgs.Page Field

The current page.

[Visual Basic]

Public ReadOnly Page As Integer

[C#]

public readonly int Page

[Delphi]

public Page: Int32;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ReportEventArgs.Section Field

ReportEventArgs.Section Field

The current section.

[Visual Basic]

Public ReadOnly Section As SectionTypeEnum

[C#]

public readonly SectionTypeEnum Section

[Delphi]

public Section: SectionTypeEnum;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ReportEventHandler Delegate

ReportEventHandler Delegate

Represents the method that will handle StartPage, EndPage, StartSection, PrintSection, EndSection and the ReportError events.

[Visual Basic]

Public Delegate Sub ReportEventHandler( _

ByVal sender As Object, _

ByVal e As ReportEventArgs _

)

[C#]

public delegate void ReportEventHandler(

object sender,

ReportEventArgs e

);

[Delphi]

type ReportEventHandler = procedure (

sender: Object;

e: ReportEventArgs

) of object;

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

C1.Win.C1Report Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfFilter Class

RtfFilter Class

Used with the RenderToFilter method to render reports into RTF (rich text format) streams or files.

For a list of all members of this type, see RtfFilter Members.

System.Object

C1.Win.C1Report.ExportFilter

C1.Win.C1Report.RtfFilter

C1.Win.C1Report.RtfLabelFilter

[Visual Basic]

Public Class RtfFilter

Inherits ExportFilter

Implements IDisposable

[C#]

public class RtfFilter : ExportFilter , IDisposable

[Delphi]

type RtfFilter = class (ExportFilter, IDisposable);

Remarks

Creating an RtfFilter and using it in a call to the RenderToFilter method is similar to using the RenderToFile or RenderToStream (Stream, FileFormatEnum) methods, but offers some extra flexibility because you can set properties on the RtfFilter before calling RenderToFilter.

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfFilter Members

RtfFilter Members

RtfFilter overview

Public Constructors

RtfFilter Constructor

Initializes a new instance of the RtfFilter class attached to a stream.

Public Properties

EmbedPictures

Gets or sets whether filter should embed images in the RTF document.

Public Methods

Dispose | Overriden. Called when the component finishes rendering a report, or when the rendering process is canceled by the user or interrupted by an error.
EndReport | Overriden. Called when the component finishes rendering a report.
IsPaged | Overriden. Determines whether this filter generates single or multi-page reports.
NewPage | Overriden. Called after each page break on paged reports (see the IsPaged property).
RenderField | Overriden. Called when the component needs to render a report field with specific content at a specific position on the current page.
StartOverlays | Overriden. Called after the component has finished rendering the first pass of the report, and before it starts rendering overlay fields.
StartReport | Overriden. Called when the component starts rendering a report.
UsesImages | Overriden. Returns a value that determines whether the filter uses page images.

Protected Properties

MarginLeft | Gets the left margin of the page.
MarginTop | Gets the top margin of the page.
StreamWriter | Gets the StreamWriter object used by filter.

Protected Methods

GetRTFFont

Gets an RTF representation of a a field's System.Drawing.Font.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfFilter Constructor

RtfFilter Constructor

Overload List

Initializes a new instance of the RtfFilter class attached to a stream.

[Visual Basic] Public Function New(Stream)

[C#] public RtfFilter(Stream);

[Delphi] public constructor Create(Stream); overload;

Initializes a new instance of the RtfFilter class attached to a file.

[Visual Basic] Public Function New(String)

[C#] public RtfFilter(string);

[Delphi] public constructor Create(String); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfFilter Constructor (Stream)

RtfFilter Constructor (Stream)

Initializes a new instance of the RtfFilter class attached to a stream.

[Visual Basic]

Public Function New( _

ByVal stream As Stream _

)

[C#]

public RtfFilter(

Stream stream

);

[Delphi]

public constructor Create(

stream: Stream

); overload;

Parameters

stream

Output System.IO.Stream where the report will be rendered.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfFilter Constructor (String)

RtfFilter Constructor (String)

Initializes a new instance of the RtfFilter class attached to a file.

[Visual Basic]

Public Function New( _

ByVal fileName As String _

)

[C#]

public RtfFilter(

string fileName

);

[Delphi]

public constructor Create(

fileName: String

); overload;

Parameters

fileName

Full name of the file to be created. If the file already exists, it will be overwritten.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfFilter Properties

RtfFilter Properties

The properties of the RtfFilter class are listed here. For a complete list of RtfFilter class members, see the RtfFilter Members topic.

Public Properties

EmbedPictures

Gets or sets whether filter should embed images in the RTF document.

Protected Properties

MarginLeft | Gets the left margin of the page.
MarginTop | Gets the top margin of the page.
StreamWriter | Gets the StreamWriter object used by filter.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfFilter.EmbedPictures Property

RtfFilter.EmbedPictures Property

Gets or sets whether filter should embed images in the RTF document.

[Visual Basic]

Public Property EmbedPictures As Boolean

[C#]

public bool EmbedPictures {get;set;}

[Delphi]

public property EmbedPictures: Boolean read get_EmbedPictures write set_EmbedPictures;

Remarks

Documents with embedded images are significantly larger than text-only documents.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfFilter.MarginLeft Property

RtfFilter.MarginLeft Property

Gets the left margin of the page.

[Visual Basic]

Protected ReadOnly Property MarginLeft As Integer

[C#]

protected int MarginLeft {get;}

[Delphi]

strict protected property MarginLeft: Int32 read get_MarginLeft;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfFilter.MarginTop Property

RtfFilter.MarginTop Property

Gets the top margin of the page.

[Visual Basic]

Protected ReadOnly Property MarginTop As Integer

[C#]

protected int MarginTop {get;}

[Delphi]

strict protected property MarginTop: Int32 read get_MarginTop;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfFilter.StreamWriter Property

RtfFilter.StreamWriter Property

Gets the StreamWriter object used by filter.

[Visual Basic]

Protected ReadOnly Property StreamWriter As StreamWriter

[C#]

protected StreamWriter StreamWriter {get;}

[Delphi]

strict protected property StreamWriter: StreamWriter read get_StreamWriter;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfFilter Methods

RtfFilter Methods

The methods of the RtfFilter class are listed here. For a complete list of RtfFilter class members, see the RtfFilter Members topic.

Public Methods

Dispose | Overriden. Called when the component finishes rendering a report, or when the rendering process is canceled by the user or interrupted by an error.
EndReport | Overriden. Called when the component finishes rendering a report.
IsPaged | Overriden. Determines whether this filter generates single or multi-page reports.
NewPage | Overriden. Called after each page break on paged reports (see the IsPaged property).
RenderField | Overriden. Called when the component needs to render a report field with specific content at a specific position on the current page.
StartOverlays | Overriden. Called after the component has finished rendering the first pass of the report, and before it starts rendering overlay fields.
StartReport | Overriden. Called when the component starts rendering a report.
UsesImages | Overriden. Returns a value that determines whether the filter uses page images.

Protected Methods

GetRTFFont

Gets an RTF representation of a a field's System.Drawing.Font.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfFilter.Dispose Method

RtfFilter.Dispose Method

Called when the component finishes rendering a report, or when the rendering process is canceled by the user or interrupted by an error.

[Visual Basic]

Overrides Public Sub Dispose() Implements IDisposable.Dispose

[C#]

override public void Dispose()

[Delphi]

public procedure Dispose(); override;

Implements

IDisposable.Dispose

Remarks

Use this method to free any disposable objects used by the filter.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfFilter.EndReport Method

RtfFilter.EndReport Method

Called when the component finishes rendering a report.

[Visual Basic]

Overrides Public Sub EndReport()

[C#]

override public void EndReport()

[Delphi]

public procedure EndReport(); override;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfFilter.GetRTFFont Method

RtfFilter.GetRTFFont Method

Gets an RTF representation of a a field's System.Drawing.Font.

[Visual Basic]

Protected Function GetRTFFont( _

ByVal field As Field _

) As String

[C#]

protected string GetRTFFont(

Field field

);

[Delphi]

strict protected function GetRTFFont(

field: Field

): String;

Parameters

field

Field that contains the font.

Return Value

A string contianing the RTF representation of the font.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfFilter.IsPaged Method

RtfFilter.IsPaged Method

Determines whether this filter generates single or multi-page reports.

[Visual Basic]

Overrides Public Function IsPaged() As Boolean

[C#]

override public bool IsPaged()

[Delphi]

public function IsPaged(): Boolean; override;

Return Value

Always returns true.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfFilter.NewPage Method

RtfFilter.NewPage Method

Called after each page break on paged reports (see the IsPaged property).

[Visual Basic]

Overrides Public Sub NewPage()

[C#]

override public void NewPage()

[Delphi]

public procedure NewPage(); override;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfFilter.RenderField Method

RtfFilter.RenderField Method

Called when the component needs to render a report field with specific content at a specific position on the current page.

[Visual Basic]

Overrides Public Sub RenderField( _

ByVal field As Field, _

ByVal rc As Rectangle, _

ByVal text As String, _

ByVal img As Image _

)

[C#]

override public void RenderField(

Field field,

Rectangle rc,

string text,

Image img

);

[Delphi]

public procedure RenderField(

field: Field;

rc: Rectangle;

text: String;

img: Image

); override;

Parameters

field

Field object to render.

rc

Rectangle that determines the field position on the page, in twips.

text

Field text to render.

img

Field image to render.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfFilter.StartOverlays Method

RtfFilter.StartOverlays Method

Called after the component has finished rendering the first pass of the report, and before it starts rendering overlay fields.

[Visual Basic]

Overrides Public Sub StartOverlays()

[C#]

override public void StartOverlays()

[Delphi]

public procedure StartOverlays(); override;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfFilter.StartReport Method

RtfFilter.StartReport Method

Called when the component starts rendering a report.

[Visual Basic]

Overrides Public Sub StartReport( _

ByVal report As C1Report _

)

[C#]

override public void StartReport(

C1Report report

);

[Delphi]

public procedure StartReport(

report: C1Report

); override;

Parameters

report

Owner report.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfFilter.UsesImages Method

RtfFilter.UsesImages Method

Returns a value that determines whether the filter uses page images.

[Visual Basic]

Overrides Public Function UsesImages() As Boolean

[C#]

override public bool UsesImages()

[Delphi]

public function UsesImages(): Boolean; override;

Return Value

Always returns false.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfLabelFilter Class

RtfLabelFilter Class

Class is used with the RenderToFilter method to render reports into RTF (rich text format) streams or files.

For a list of all members of this type, see RtfLabelFilter Members.

System.Object

C1.Win.C1Report.ExportFilter

C1.Win.C1Report.RtfFilter

C1.Win.C1Report.RtfLabelFilter

[Visual Basic]

Public Class RtfLabelFilter

Inherits RtfFilter

[C#]

public class RtfLabelFilter : RtfFilter

[Delphi]

type RtfLabelFilter = class (RtfFilter);

Remarks

This filter is similar to the plain RtfFilter, except if generates RTF fields with absolute positioning. The resulting files are more accurate than the ones created with the plain RTF filter, but they are harder to edit and can only be opened in Microsoft Word (WordPad and other simple editors do not support RTF absolute positioning).

Creating an RtfLabelFilter and using it in a call to the RenderToFilter method is similar to using the RenderToFile or RenderToStream (Stream, FileFormatEnum) methods, but offers some extra flexibility because you can set properties on the RtfLabelFilter before calling RenderToFilter.

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfLabelFilter Members

RtfLabelFilter Members

RtfLabelFilter overview

Public Constructors

RtfLabelFilter Constructor

Initializes a new instance of the RtfLabelFilter class attached to a stream.

Public Properties

EmbedPictures (inherited from RtfFilter)

Gets or sets whether filter should embed images in the RTF document.

Public Methods

Dispose (inherited from RtfFilter) | Called when the component finishes rendering a report, or when the rendering process is canceled by the user or interrupted by an error.
EndReport (inherited from RtfFilter) | Called when the component finishes rendering a report.
IsPaged (inherited from RtfFilter) | Determines whether this filter generates single or multi-page reports.
NewPage (inherited from RtfFilter) | Called after each page break on paged reports (see the IsPaged property).
RenderField | Overriden. Called when the component needs to render a report field with specific content at a specific position on the current page.
StartOverlays (inherited from RtfFilter) | Called after the component has finished rendering the first pass of the report, and before it starts rendering overlay fields.
UsesImages (inherited from RtfFilter) | Returns a value that determines whether the filter uses page images.

Protected Properties

MarginLeft (inherited from RtfFilter) | Gets the left margin of the page.
MarginTop (inherited from RtfFilter) | Gets the top margin of the page.
StreamWriter (inherited from RtfFilter) | Gets the StreamWriter object used by filter.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfLabelFilter Constructor

RtfLabelFilter Constructor

Overload List

Initializes a new instance of the RtfLabelFilter class attached to a stream.

[Visual Basic] Public Function New(Stream)

[C#] public RtfLabelFilter(Stream);

[Delphi] public constructor Create(Stream); overload;

Initializes a new instance of the RtfLabelFilter class attached to a file.

[Visual Basic] Public Function New(String)

[C#] public RtfLabelFilter(string);

[Delphi] public constructor Create(String); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfLabelFilter Constructor (Stream)

RtfLabelFilter Constructor (Stream)

Initializes a new instance of the RtfLabelFilter class attached to a stream.

[Visual Basic]

Public Function New( _

ByVal stream As Stream _

)

[C#]

public RtfLabelFilter(

Stream stream

);

[Delphi]

public constructor Create(

stream: Stream

); overload;

Parameters

stream

Output System.IO.Stream where the report will be rendered.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfLabelFilter Constructor (String)

RtfLabelFilter Constructor (String)

Initializes a new instance of the RtfLabelFilter class attached to a file.

[Visual Basic]

Public Function New( _

ByVal fileName As String _

)

[C#]

public RtfLabelFilter(

string fileName

);

[Delphi]

public constructor Create(

fileName: String

); overload;

Parameters

fileName

Full name of the file to be created. If the file already exists, it will be overwritten.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfLabelFilter Properties

RtfLabelFilter Properties

The properties of the RtfLabelFilter class are listed here. For a complete list of RtfLabelFilter class members, see the RtfLabelFilter Members topic.

Public Properties

EmbedPictures (inherited from RtfFilter)

Gets or sets whether filter should embed images in the RTF document.

Protected Properties

MarginLeft (inherited from RtfFilter) | Gets the left margin of the page.
MarginTop (inherited from RtfFilter) | Gets the top margin of the page.
StreamWriter (inherited from RtfFilter) | Gets the StreamWriter object used by filter.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfLabelFilter Methods

RtfLabelFilter Methods

The methods of the RtfLabelFilter class are listed here. For a complete list of RtfLabelFilter class members, see the RtfLabelFilter Members topic.

Public Methods

Dispose (inherited from RtfFilter) | Called when the component finishes rendering a report, or when the rendering process is canceled by the user or interrupted by an error.
EndReport (inherited from RtfFilter) | Called when the component finishes rendering a report.
IsPaged (inherited from RtfFilter) | Determines whether this filter generates single or multi-page reports.
NewPage (inherited from RtfFilter) | Called after each page break on paged reports (see the IsPaged property).
RenderField | Overriden. Called when the component needs to render a report field with specific content at a specific position on the current page.
StartOverlays (inherited from RtfFilter) | Called after the component has finished rendering the first pass of the report, and before it starts rendering overlay fields.
UsesImages (inherited from RtfFilter) | Returns a value that determines whether the filter uses page images.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RtfLabelFilter.RenderField Method

RtfLabelFilter.RenderField Method

Called when the component needs to render a report field with specific content at a specific position on the current page.

[Visual Basic]

Overrides Public Sub RenderField( _

ByVal field As Field, _

ByVal rc As Rectangle, _

ByVal text As String, _

ByVal img As Image _

)

[C#]

override public void RenderField(

Field field,

Rectangle rc,

string text,

Image img

);

[Delphi]

public procedure RenderField(

field: Field;

rc: Rectangle;

text: String;

img: Image

); override;

Parameters

field

The field to be rendered.

rc

Rectangle that determines the field position on the current page, in twips.

text

Field text to render.

img

Field image to render.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


RunningSumEnum Enumeration

RunningSumEnum Enumeration

Determines whether to calculate a running sum.

[Visual Basic]

Public Enum RunningSumEnum

[C#]

public enum RunningSumEnum

[Delphi]

type RunningSumEnum = (NoRunningSum, SumOverAll, SumOverGroup);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

Remarks

Use the members of this enumeration to set the value of the RunningSum property in the Field class.

Members

Member name | Description
NoRunningSum | Do not treat field as a running sum.
SumOverAll | Calculate running sum over the whole report.
SumOverGroup | Calculate running sum over each group.

See Also

C1.Win.C1Report Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Section Class

Section Class

Represents a report band.

For a list of all members of this type, see Section Members.

System.Object

C1.Win.C1Report.Section

[Visual Basic]

Public Class Section

[C#]

public class Section

[Delphi]

type Section = class;

Remarks

Each Section object contains a collection of fields objects that display individual data items within the section.

Every report contains the following sections:

A detail section.

A report header and a report footer section.

A page header and a page footer section.

A group header and a group footer section for each Group object in the report.

The total number of sections in a report is therefore:

5 + 2 * Groups.Count

Sections cannot be added and removed from reports directly. The number of sections is a function of the number of groups.

Although sections cannot be removed, they can be hidden by setting their Visible property to false.

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Section Members

Section Members

Section overview

Public Properties

BackColor | Gets or sets the background color for this Section.
CanGrow | Gets or sets whether the Section height should be automatically increased to fit its contents.
CanShrink | Gets or sets whether the Section height should be reduced when one or more fields shrink.
Fields | Returns a collection of all fields in this Section.
ForcePageBreak | Gets or sets whether page breaks should be inserted before and/or after the section is rendered.
Height | Gets or sets the Section height, in twips.
KeepTogether | Gets or sets whether the Section should be kept together on a page.
Name | Gets or sets the Section name.
OnFormat | Gets or sets a string containing VBScript code to be executed before the Section is formatted.
OnPrint | Gets or sets a string containing VBScript code to be executed before the Section is printed (after it is formatted).
ParentReport | Gets the C1Report object that contains this Section.
RenderHeight | Returns the height of the section after the CanGrow and CanShrink properties have been applied to the section.
Repeat | Gets or sets whether the Section should be repeated at the top of every page.
Tag | Gets or sets extra data used by the calling program.
Type | Returns the Section type (e.g., PageHeader, Detail).
Visible | Gets or sets whether the Section will be rendered in the report.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Section Properties

Section Properties

The properties of the Section class are listed here. For a complete list of Section class members, see the Section Members topic.

Public Properties

BackColor | Gets or sets the background color for this Section.
CanGrow | Gets or sets whether the Section height should be automatically increased to fit its contents.
CanShrink | Gets or sets whether the Section height should be reduced when one or more fields shrink.
Fields | Returns a collection of all fields in this Section.
ForcePageBreak | Gets or sets whether page breaks should be inserted before and/or after the section is rendered.
Height | Gets or sets the Section height, in twips.
KeepTogether | Gets or sets whether the Section should be kept together on a page.
Name | Gets or sets the Section name.
OnFormat | Gets or sets a string containing VBScript code to be executed before the Section is formatted.
OnPrint | Gets or sets a string containing VBScript code to be executed before the Section is printed (after it is formatted).
ParentReport | Gets the C1Report object that contains this Section.
RenderHeight | Returns the height of the section after the CanGrow and CanShrink properties have been applied to the section.
Repeat | Gets or sets whether the Section should be repeated at the top of every page.
Tag | Gets or sets extra data used by the calling program.
Type | Returns the Section type (e.g., PageHeader, Detail).
Visible | Gets or sets whether the Section will be rendered in the report.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Section.BackColor Property

Section.BackColor Property

Gets or sets the background color for this Section.

[Visual Basic]

Public Property BackColor As Color

[C#]

public Color BackColor {get;set;}

[Delphi]

public property BackColor: Color read get_BackColor write set_BackColor;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Section.CanGrow Property

Section.CanGrow Property

Gets or sets whether the Section height should be automatically increased to fit its contents.

[Visual Basic]

Public Property CanGrow As Boolean

[C#]

public bool CanGrow {get;set;}

[Delphi]

public property CanGrow: Boolean read get_CanGrow write set_CanGrow;

Remarks

You can use the CanGrow and CanShrink properties to control the appearance of report sections and fields.

For example, if you set both properties to true, a section or field automatically adjusts vertically to print or preview all the data it contains.

Sections grow and shrink vertically across their entire width.

When a section grows or shrinks, its Height property does not change. To retrieve the actual rendering height, use the RenderHeight property.

You can make fields grow or shrink to match the size of the section by setting their Anchor property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Section.CanShrink Property

Section.CanShrink Property

Gets or sets whether the Section height should be reduced when one or more fields shrink.

[Visual Basic]

Public Property CanShrink As Boolean

[C#]

public bool CanShrink {get;set;}

[Delphi]

public property CanShrink: Boolean read get_CanShrink write set_CanShrink;

Remarks

You can use the CanGrow and CanShrink properties to control the layout of report sections and fields.

For example, if you set both properties to true, a section or field automatically adjusts vertically to print or preview all the data it contains.

When a section grows or shrinks, its Height property does not change. To retrieve the actual (adjusted) height, use the RenderHeight property.

You can make fields grow or shrink to match the size of the section by setting their Anchor property.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Section.Fields Property

Section.Fields Property

Returns a collection of all fields in this Section.

[Visual Basic]

Public ReadOnly Property Fields As FieldCollection

[C#]

public FieldCollection Fields {get;}

[Delphi]

public property Fields: FieldCollection read get_Fields;

Remarks

The Fields collection contains all Field objects defined in the current section.

When you add a field to a section's Fields collection, the field is automatically assigned to the section that owns the collection. For example, the code below adds a field to the Detail section:

_c1r.Sections.Detail.Fields.Add("new field", "CompanyLogo", rc);

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Section.ForcePageBreak Property

Section.ForcePageBreak Property

Gets or sets whether page breaks should be inserted before and/or after the section is rendered.

[Visual Basic]

Public Property ForcePageBreak As ForcePageBreakEnum

[C#]

public ForcePageBreakEnum ForcePageBreak {get;set;}

[Delphi]

public property ForcePageBreak: ForcePageBreakEnum read get_ForcePageBreak write set_ForcePageBreak;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Section.Height Property

Section.Height Property

Gets or sets the Section height, in twips.

[Visual Basic]

Public Property Height As Double

[C#]

public Double Height {get;set;}

[Delphi]

public property Height: Double read get_Height write set_Height;

Remarks

The height of a section should be large enough to accommodate all fields in the section.

The Report Designer automatically adjusts section heights when fields are added, moved, or resized.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Section.KeepTogether Property

Section.KeepTogether Property

Gets or sets whether the Section should be kept together on a page.

[Visual Basic]

Public Property KeepTogether As Boolean

[C#]

public bool KeepTogether {get;set;}

[Delphi]

public property KeepTogether: Boolean read get_KeepTogether write set_KeepTogether;

Remarks

The Group and Field objects also have KeepTogether properties.

The Group object's KeepTogether property works across sections. It determines whether group headers should be kept together with their first detail section or whether entire groups should be kept together on a page.

The Field object's KeepTogether property determines whether the field should be rendered on a single page or whether it is allowed to be split across page breaks.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Section.Name Property

Section.Name Property

Gets or sets the Section name.

[Visual Basic]

Public Property Name As String

[C#]

public string Name {get;set;}

[Delphi]

public property Name: String read get_Name write set_Name;

Remarks

The section name can be used as an index into the control's Sections collection.

Section names are also used to identify fields in VBScript expressions.

Duplicate and empty section names are allowed, but should be avoided if you plan to use the section names in scripts or as indexers.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Section.OnFormat Property

Section.OnFormat Property

Gets or sets a string containing VBScript code to be executed before the Section is formatted.

[Visual Basic]

Public Property OnFormat As String

[C#]

public string OnFormat {get;set;}

[Delphi]

public property OnFormat: String read get_OnFormat write set_OnFormat;

Remarks

This property contains VBScript instructions to be executed before the fields in the section are calculated. When this script is executed, the recordset already holds the data that will be displayed in the section, but the field values have not been updated yet.

Use this event to assign values to fields before they are calculated, so the new values will be taken into account when the control calculates the field's size and position when the CanGrow or CanShrink properties are set to true.

If you want to set field properties based on the field's current value, use the OnPrint property instead.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Section.OnPrint Property

Section.OnPrint Property

Gets or sets a string containing VBScript code to be executed before the Section is printed (after it is formatted).

[Visual Basic]

Public Property OnPrint As String

[C#]

public string OnPrint {get;set;}

[Delphi]

public property OnPrint: String read get_OnPrint write set_OnPrint;

Remarks

This property contains VBScript instructions that get executed after the fields in the section have been calculated.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Section.ParentReport Property

Section.ParentReport Property

Gets the C1Report object that contains this Section.

[Visual Basic]

Public ReadOnly Property ParentReport As C1Report

[C#]

public C1Report ParentReport {get;}

[Delphi]

public property ParentReport: C1Report read get_ParentReport;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Section.RenderHeight Property

Section.RenderHeight Property

Returns the height of the section after the CanGrow and CanShrink properties have been applied to the section.

[Visual Basic]

Public ReadOnly Property RenderHeight As Double

[C#]

public Double RenderHeight {get;}

[Delphi]

public property RenderHeight: Double read get_RenderHeight;

Remarks

When a section grows or shrinks, its Height property does not change.

If you need to retrieve the actual height that will be used for rendering the section (for example, while handling the OnPrint event), use the RenderHeight property instead.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Section.Repeat Property

Section.Repeat Property

Gets or sets whether the Section should be repeated at the top of every page.

[Visual Basic]

Public Property Repeat As Boolean

[C#]

public bool Repeat {get;set;}

[Delphi]

public property Repeat: Boolean read get_Repeat write set_Repeat;

Remarks

This property only applies to group header sections.

Set this value to true to repeat the group header page at the top of every page, before the detail sections.

If you have multiple groups, all group header sections that have the Repeat property set to true will be rendered at the top of each page.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Section.Tag Property

Section.Tag Property

Gets or sets extra data used by the calling program.

[Visual Basic]

Public Property Tag As Object

[C#]

public object Tag {get;set;}

[Delphi]

public property Tag: Object read get_Tag write set_Tag;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Section.Type Property

Section.Type Property

Returns the Section type (e.g., PageHeader, Detail).

[Visual Basic]

Public ReadOnly Property Type As SectionTypeEnum

[C#]

public SectionTypeEnum Type {get;}

[Delphi]

public property Type: SectionTypeEnum read get_Type;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Section.Visible Property

Section.Visible Property

Gets or sets whether the Section will be rendered in the report.

[Visual Basic]

Public Property Visible As Boolean

[C#]

public bool Visible {get;set;}

[Delphi]

public property Visible: Boolean read get_Visible write set_Visible;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SectionCollection Class

SectionCollection Class

Collection of the Section objects.

For a list of all members of this type, see SectionCollection Members.

System.Object

C1.Win.C1Report.SectionCollection

[Visual Basic]

Public Class SectionCollection

Implements ICollection, IEnumerable

[C#]

public class SectionCollection : ICollection, IEnumerable

[Delphi]

type SectionCollection = class (TObject, ICollection, IEnumerable);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SectionCollection Members

SectionCollection Members

SectionCollection overview

Public Properties

Count | Returns the number of elements in the collection.
Detail | Returns a reference to the detail section of the report.
Footer | Returns a reference to the report footer section.
Header | Returns a reference to the report header section.
Item | Overloaded. Returns a section from a Sections collection.
PageFooter | Returns a reference to the page footer section of the report.
PageHeader | Returns a reference to the page header section of the report.

Public Methods

Contains | Determines whether the collection contains a specific Section.
CopyTo | Copies the elements of the collection to an System.Array, starting at a particular array index.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SectionCollection Properties

SectionCollection Properties

The properties of the SectionCollection class are listed here. For a complete list of SectionCollection class members, see the SectionCollection Members topic.

Public Properties

Count | Returns the number of elements in the collection.
Detail | Returns a reference to the detail section of the report.
Footer | Returns a reference to the report footer section.
Header | Returns a reference to the report header section.
Item | Overloaded. Returns a section from a Sections collection.
PageFooter | Returns a reference to the page footer section of the report.
PageHeader | Returns a reference to the page header section of the report.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SectionCollection.Count Property

SectionCollection.Count Property

Returns the number of elements in the collection.

[Visual Basic]

Overridable Public ReadOnly Property Count As Integer Implements ICollection.Count

[C#]

virtual public int Count {get;}

[Delphi]

public property Count: Int32 read get_Count;

Implements

ICollection.Count

Remarks

The SectionCollection class does not have Add or Remove methods.

That is because the number of sections in a report is determined by then number of groups. To add or remove sections from the report, you need to add or remove groups.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SectionCollection.Detail Property

SectionCollection.Detail Property

Returns a reference to the detail section of the report.

[Visual Basic]

Public ReadOnly Property Detail As Section

[C#]

public Section Detail {get;}

[Delphi]

public property Detail: Section read get_Detail;

Remarks

This property is equivalent to this[SectionTypeEnum.Detail].

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SectionCollection.Footer Property

SectionCollection.Footer Property

Returns a reference to the report footer section.

[Visual Basic]

Public ReadOnly Property Footer As Section

[C#]

public Section Footer {get;}

[Delphi]

public property Footer: Section read get_Footer;

Remarks

This property is equivalent to this[SectionTypeEnum.Footer].

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SectionCollection.Header Property

SectionCollection.Header Property

Returns a reference to the report header section.

[Visual Basic]

Public ReadOnly Property Header As Section

[C#]

public Section Header {get;}

[Delphi]

public property Header: Section read get_Header;

Remarks

This property is equivalent to this[SectionTypeEnum.Header]

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SectionCollection.Item Property

SectionCollection.Item Property

Overload List

Returns a section from a Sections collection.

[Visual Basic] Overloads Public Default ReadOnly Property Item(Integer) As Section

[C#] public Section this[int]{get;}

[Delphi] public property Item[index: Int32]: Section read get_Item;

Returns a section from a Sections collection.

[Visual Basic] Overloads Public Default ReadOnly Property Item(SectionTypeEnum) As Section

[C#] public Section this[SectionTypeEnum]{get;}

[Delphi] public property Item[index: SectionTypeEnum]: Section read get_Item;

Returns a section from a Sections collection.

[Visual Basic] Overloads Public Default ReadOnly Property Item(String) As Section

[C#] public Section this[string]{get;}

[Delphi] public property Item[name: String]: Section read get_Item;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SectionCollection.Item Property (Int32)

SectionCollection.Item Property (Int32)

Returns a section from a Sections collection.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As Section

[C#]

public Section this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: Section read get_Item;

Remarks

The index parameter may be an integer between zero and Count-1.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SectionCollection.Item Property (SectionTypeEnum)

SectionCollection.Item Property (SectionTypeEnum)

Returns a section from a Sections collection.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As SectionTypeEnum _

) As Section

[C#]

public Section this[

SectionTypeEnum index

] {get;}

[Delphi]

public property Item[

index: SectionTypeEnum

]: Section read get_Item;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SectionCollection.Item Property (String)

SectionCollection.Item Property (String)

Returns a section from a Sections collection.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal name As String _

) As Section

[C#]

public Section this[

string name

] {get;}

[Delphi]

public property Item[

name: String

]: Section read get_Item;

Remarks

The name parameter may be a string containing a section name.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SectionCollection.PageFooter Property

SectionCollection.PageFooter Property

Returns a reference to the page footer section of the report.

[Visual Basic]

Public ReadOnly Property PageFooter As Section

[C#]

public Section PageFooter {get;}

[Delphi]

public property PageFooter: Section read get_PageFooter;

Remarks

This property is equivalent to this[SectionTypeEnum.PageFooter].

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SectionCollection.PageHeader Property

SectionCollection.PageHeader Property

Returns a reference to the page header section of the report.

[Visual Basic]

Public ReadOnly Property PageHeader As Section

[C#]

public Section PageHeader {get;}

[Delphi]

public property PageHeader: Section read get_PageHeader;

Remarks

This property is equivalent to this[SectionTypeEnum.PageHeader].

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SectionCollection Methods

SectionCollection Methods

The methods of the SectionCollection class are listed here. For a complete list of SectionCollection class members, see the SectionCollection Members topic.

Public Methods

Contains | Determines whether the collection contains a specific Section.
CopyTo | Copies the elements of the collection to an System.Array, starting at a particular array index.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SectionCollection.Contains Method

SectionCollection.Contains Method

Determines whether the collection contains a specific Section.

[Visual Basic]

Public Function Contains( _

ByVal s As Section _

) As Boolean

[C#]

public bool Contains(

Section s

);

[Delphi]

public function Contains(

s: Section

): Boolean;

Parameters

s

The Section object.

Return Value

True if the collection contains specified section; false otherwise.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SectionCollection.CopyTo Method

SectionCollection.CopyTo Method

Copies the elements of the collection to an System.Array, starting at a particular array index.

[Visual Basic]

Public Sub CopyTo( _

ByVal array As Section(), _

ByVal index As Integer _

)

[C#]

public void CopyTo(

Section[] array,

int index

);

[Delphi]

public procedure CopyTo(

array: array of Section;

index: Int32

);

Parameters

array

The one-dimensional System.Array that is the destination of the elements copied from collection. (The array must have zero-based indexing).

index

The zero-based index in array at which copying begins.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SectionTypeEnum Enumeration

SectionTypeEnum Enumeration

Specifies the section type, which is equivalent to a the index of a Section object in the control's Sections collection.

[Visual Basic]

Public Enum SectionTypeEnum

[C#]

public enum SectionTypeEnum

[Delphi]

type SectionTypeEnum = (Detail, Footer, GroupFooter1, GroupFooter2, GroupFooter3, GroupFooter4, GroupHeader1, GroupHeader2, GroupHeader3, GroupHeader4, Header, PageFooter, PageHeader, Undefined);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

Remarks

Use the members of this enumeration to set the value of the Section and Type properties.

Members

Member name | Description
Detail | Detail section: repeated for every record in the source recordset.
Footer | Report footer section: appears once, in the end of the report.
GroupFooter1 | Group footer section: appears after level-one groups.
GroupFooter2 | Group footer section: appears after level-two groups.
GroupFooter3 | Group footer section: appears after level-three groups.
GroupFooter4 | Group footer section: appears after level-four groups.
GroupHeader1 | Group header section: appears before level-one groups.
GroupHeader2 | Group header section: appears before level-two groups.
GroupHeader3 | Group header section: appears before level-three groups.
GroupHeader4 | Group header section: appears before level-four groups.
Header | Report header section: appears once, in the beginning of the report.
PageFooter | Page footer section: appears at the bottom of every page, subject to the setting of the PageFooter property.
PageHeader | Page header section: appears at the top of every page, subject to the setting of the PageHeader property.
Undefined | Undefined. When fields are created using the Add (String, String, Double, Double, Double, Double) method, they don't belong to any sections and are not rendered with the report.

See Also

C1.Win.C1Report Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SortEnum Enumeration

SortEnum Enumeration

Specifies how groups should be sorted.

[Visual Basic]

Public Enum SortEnum

[C#]

public enum SortEnum

[Delphi]

type SortEnum = (Ascending, Descending, NoSort);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

Remarks

Use the members of this enumeration to set the value of the Sort property in the Group class.

Members

Member name | Description
Ascending | Sort records in ascending order.
Descending | Sort records in descending order.
NoSort | Do not sort records for this group.

See Also

C1.Win.C1Report Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextDirectionEnum Enumeration

TextDirectionEnum Enumeration

Specifies the direction of the text in the field.

[Visual Basic]

Public Enum TextDirectionEnum

[C#]

public enum TextDirectionEnum

[Delphi]

type TextDirectionEnum = (Down, Normal, Up);

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

Remarks

Use the members of this enumeration to set the value of the TextDirection property in the Field class.

Members

Member name | Description
Down | Text direction is down.
Normal | Text direction is normal.
Up | Text direction is up.

See Also

C1.Win.C1Report Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextFilter Class

TextFilter Class

Used with the RenderToFilter method to render reports into plain text streams or files.

For a list of all members of this type, see TextFilter Members.

System.Object

C1.Win.C1Report.ExportFilter

C1.Win.C1Report.TextFilter

[Visual Basic]

Public Class TextFilter

Inherits ExportFilter

Implements IDisposable

[C#]

public class TextFilter : ExportFilter , IDisposable

[Delphi]

type TextFilter = class (ExportFilter, IDisposable);

Remarks

Creating a TextFilter and using it in a call to the RenderToFilter method is similar to using the RenderToFile or RenderToStream (Stream, FileFormatEnum) methods, but offers some extra flexibility because you can set properties on the TextFilter before calling RenderToFilter.

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextFilter Members

TextFilter Members

TextFilter overview

Public Constructors

TextFilter Constructor

Initializes a new instance of the TextFilter class attached to a stream.

Public Methods

Dispose | Overriden. Called when the component finishes rendering a report, or when the rendering process is canceled by the user or interrupted by an error.
EndReport | Overriden. Called when the component finishes rendering a report.
IsPaged | Overriden. Determines whether this filter generates single or multi-page reports.
NewPage | Overriden. Called after each page break on paged reports (see the IsPaged property).
RenderField | Overriden. Called when the component needs to render a report field with specific content at a specific position on the current page.
StartOverlays | Overriden. Called after the component has finished rendering the first pass of the report, and before it starts rendering overlay fields.
StartReport | Overriden. Called when the component starts rendering a report.
UsesImages | Overriden. Returns a value that determines whether the filter uses page images.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextFilter Constructor

TextFilter Constructor

Overload List

Initializes a new instance of the TextFilter class attached to a stream.

[Visual Basic] Public Function New(Stream)

[C#] public TextFilter(Stream);

[Delphi] public constructor Create(Stream); overload;

Initializes a new instance of the TextFilter class attached to a file.

[Visual Basic] Public Function New(String)

[C#] public TextFilter(string);

[Delphi] public constructor Create(String); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextFilter Constructor (Stream)

TextFilter Constructor (Stream)

Initializes a new instance of the TextFilter class attached to a stream.

[Visual Basic]

Public Function New( _

ByVal stream As Stream _

)

[C#]

public TextFilter(

Stream stream

);

[Delphi]

public constructor Create(

stream: Stream

); overload;

Parameters

stream

Output System.IO.Stream where the report will be rendered.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextFilter Constructor (String)

TextFilter Constructor (String)

Initializes a new instance of the TextFilter class attached to a file.

[Visual Basic]

Public Function New( _

ByVal fileName As String _

)

[C#]

public TextFilter(

string fileName

);

[Delphi]

public constructor Create(

fileName: String

); overload;

Parameters

fileName

Full name of the file to be created. If the file already exists, it will be overwritten.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextFilter Methods

TextFilter Methods

The methods of the TextFilter class are listed here. For a complete list of TextFilter class members, see the TextFilter Members topic.

Public Methods

Dispose | Overriden. Called when the component finishes rendering a report, or when the rendering process is canceled by the user or interrupted by an error.
EndReport | Overriden. Called when the component finishes rendering a report.
IsPaged | Overriden. Determines whether this filter generates single or multi-page reports.
NewPage | Overriden. Called after each page break on paged reports (see the IsPaged property).
RenderField | Overriden. Called when the component needs to render a report field with specific content at a specific position on the current page.
StartOverlays | Overriden. Called after the component has finished rendering the first pass of the report, and before it starts rendering overlay fields.
StartReport | Overriden. Called when the component starts rendering a report.
UsesImages | Overriden. Returns a value that determines whether the filter uses page images.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextFilter.Dispose Method

TextFilter.Dispose Method

Called when the component finishes rendering a report, or when the rendering process is canceled by the user or interrupted by an error.

[Visual Basic]

Overrides Public Sub Dispose() Implements IDisposable.Dispose

[C#]

override public void Dispose()

[Delphi]

public procedure Dispose(); override;

Implements

IDisposable.Dispose

Remarks

Use this method to free any disposable objects used by the filter.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextFilter.EndReport Method

TextFilter.EndReport Method

Called when the component finishes rendering a report.

[Visual Basic]

Overrides Public Sub EndReport()

[C#]

override public void EndReport()

[Delphi]

public procedure EndReport(); override;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextFilter.IsPaged Method

TextFilter.IsPaged Method

Determines whether this filter generates single or multi-page reports.

[Visual Basic]

Overrides Public Function IsPaged() As Boolean

[C#]

override public bool IsPaged()

[Delphi]

public function IsPaged(): Boolean; override;

Return Value

Always returns true.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextFilter.NewPage Method

TextFilter.NewPage Method

Called after each page break on paged reports (see the IsPaged property).

[Visual Basic]

Overrides Public Sub NewPage()

[C#]

override public void NewPage()

[Delphi]

public procedure NewPage(); override;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextFilter.RenderField Method

TextFilter.RenderField Method

Called when the component needs to render a report field with specific content at a specific position on the current page.

[Visual Basic]

Overrides Public Sub RenderField( _

ByVal field As Field, _

ByVal rc As Rectangle, _

ByVal text As String, _

ByVal img As Image _

)

[C#]

override public void RenderField(

Field field,

Rectangle rc,

string text,

Image img

);

[Delphi]

public procedure RenderField(

field: Field;

rc: Rectangle;

text: String;

img: Image

); override;

Parameters

field

Field object to render.

rc

Rectangle that determines the field position on the page, in twips.

text

Field text to render.

img

Field image to render.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextFilter.StartOverlays Method

TextFilter.StartOverlays Method

Called after the component has finished rendering the first pass of the report, and before it starts rendering overlay fields.

[Visual Basic]

Overrides Public Sub StartOverlays()

[C#]

override public void StartOverlays()

[Delphi]

public procedure StartOverlays(); override;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextFilter.StartReport Method

TextFilter.StartReport Method

Called when the component starts rendering a report.

[Visual Basic]

Overrides Public Sub StartReport( _

ByVal report As C1Report _

)

[C#]

override public void StartReport(

C1Report report

);

[Delphi]

public procedure StartReport(

report: C1Report

); override;

Parameters

report

Owner report.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextFilter.UsesImages Method

TextFilter.UsesImages Method

Returns a value that determines whether the filter uses page images.

[Visual Basic]

Overrides Public Function UsesImages() As Boolean

[C#]

override public bool UsesImages()

[Delphi]

public function UsesImages(): Boolean; override;

Return Value

Always returns false.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TiffFilter Class

TiffFilter Class

Used with the RenderToFilter method to render reports into TIFF streams or files.

For a list of all members of this type, see TiffFilter Members.

System.Object

C1.Win.C1Report.ExportFilter

C1.Win.C1Report.TiffFilter

[Visual Basic]

Public Class TiffFilter

Inherits ExportFilter

[C#]

public class TiffFilter : ExportFilter

[Delphi]

type TiffFilter = class (ExportFilter);

Remarks

Creating a TiffFilter and using it in a call to the RenderToFilter method is similar to using the RenderToFile or RenderToStream (Stream, FileFormatEnum) methods, but offers some extra flexibility because you can set properties on the TiffFilter before calling RenderToFilter.

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TiffFilter Members

TiffFilter Members

TiffFilter overview

Public Constructors

TiffFilter Constructor

Initializes a new instance of the TiffFilter class attached to a stream.

Public Properties

Resolution

Gets or sets the resolution of the TIFF document, in dots per inch.

Public Methods

Dispose (inherited from ExportFilter) | Releases the resources used by the filter.
EndReport | Overriden. Called when the component finishes rendering a report.
IsPaged (inherited from ExportFilter) | Determines whether this filter generates single or multi-page reports.
NewPage (inherited from ExportFilter) | Called after each page break on paged reports (see the IsPaged property).
StartOverlays (inherited from ExportFilter) | Called after the component has finished rendering the first pass of the report, and before it starts rendering overlay fields.
StartReport | Overriden. Called when the component starts rendering a report.
UsesImages (inherited from ExportFilter) | Returns a value that determines whether the filter requires page images to be generated.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TiffFilter Constructor

TiffFilter Constructor

Overload List

Initializes a new instance of the TiffFilter class attached to a stream.

[Visual Basic] Public Function New(Stream)

[C#] public TiffFilter(Stream);

[Delphi] public constructor Create(Stream); overload;

Initializes a new instance of the TiffFilter class attached to a file.

[Visual Basic] Public Function New(String)

[C#] public TiffFilter(string);

[Delphi] public constructor Create(String); overload;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TiffFilter Constructor (Stream)

TiffFilter Constructor (Stream)

Initializes a new instance of the TiffFilter class attached to a stream.

[Visual Basic]

Public Function New( _

ByVal stream As Stream _

)

[C#]

public TiffFilter(

Stream stream

);

[Delphi]

public constructor Create(

stream: Stream

); overload;

Parameters

stream

Output System.IO.Stream where the report will be rendered.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TiffFilter Constructor (String)

TiffFilter Constructor (String)

Initializes a new instance of the TiffFilter class attached to a file.

[Visual Basic]

Public Function New( _

ByVal fileName As String _

)

[C#]

public TiffFilter(

string fileName

);

[Delphi]

public constructor Create(

fileName: String

); overload;

Parameters

fileName

Full name of the file to be created. If the file already exists, it will be overwritten.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TiffFilter Properties

TiffFilter Properties

The properties of the TiffFilter class are listed here. For a complete list of TiffFilter class members, see the TiffFilter Members topic.

Public Properties

Resolution

Gets or sets the resolution of the TIFF document, in dots per inch.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TiffFilter.Resolution Property

TiffFilter.Resolution Property

Gets or sets the resolution of the TIFF document, in dots per inch.

[Visual Basic]

Public Property Resolution As Single

[C#]

public Single Resolution {get;set;}

[Delphi]

public property Resolution: Single read get_Resolution write set_Resolution;

Remarks

The default value for this property is 150 dpi.

Setting the resolution to higher values result in documents with higher quality but significantly larger size.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TiffFilter Methods

TiffFilter Methods

The methods of the TiffFilter class are listed here. For a complete list of TiffFilter class members, see the TiffFilter Members topic.

Public Methods

Dispose (inherited from ExportFilter) | Releases the resources used by the filter.
EndReport | Overriden. Called when the component finishes rendering a report.
IsPaged (inherited from ExportFilter) | Determines whether this filter generates single or multi-page reports.
NewPage (inherited from ExportFilter) | Called after each page break on paged reports (see the IsPaged property).
StartOverlays (inherited from ExportFilter) | Called after the component has finished rendering the first pass of the report, and before it starts rendering overlay fields.
StartReport | Overriden. Called when the component starts rendering a report.
UsesImages (inherited from ExportFilter) | Returns a value that determines whether the filter requires page images to be generated.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TiffFilter.EndReport Method

TiffFilter.EndReport Method

Called when the component finishes rendering a report.

[Visual Basic]

Overrides Public Sub EndReport()

[C#]

override public void EndReport()

[Delphi]

public procedure EndReport(); override;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TiffFilter.StartReport Method

TiffFilter.StartReport Method

Called when the component starts rendering a report.

[Visual Basic]

Overrides Public Sub StartReport( _

ByVal report As C1Report _

)

[C#]

override public void StartReport(

C1Report report

);

[Delphi]

public procedure StartReport(

report: C1Report

); override;

Parameters

report

Owner report.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


XlsFilter Class

XlsFilter Class

Class used with the RenderToFiltermethod to render reports into Microsoft Excel (XLS) files.

For a list of all members of this type, see XlsFilter Members.

System.Object

C1.Win.C1Report.ExportFilter

C1.Win.C1Report.XlsFilter

[Visual Basic]

Public Class XlsFilter

Inherits ExportFilter

Implements IDisposable

[C#]

public class XlsFilter : ExportFilter , IDisposable

[Delphi]

type XlsFilter = class (ExportFilter, IDisposable);

Remarks

Creating an XlsFilter and using it in a call to the RenderToFilter method is similar to using the RenderToFile method, but offers some extra flexibility because you can set properties on the XlsFilter before calling RenderToFilter.

Namespace: C1.Win.C1Report

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


XlsFilter Members

XlsFilter Members

XlsFilter overview

Public Constructors

XlsFilter Constructor

Initializes a new instance of the XlsFilter class attached to a file.

Public Properties

Shading | Prevents the filter from creating shaded areas on the sheet.
SheetName | Gets or sets the name of the worksheet to be used when saving the report into the Excel workbook file.

Public Methods

Dispose | Overriden. Called when the component finishes rendering a report, or when the rendering process is canceled by the user or interrupted by an error.
EndReport | Overriden. Called when the component finishes rendering a report.
IsPaged | Overriden. Determines whether this filter generates single or multi-page reports.
NewPage (inherited from ExportFilter) | Called after each page break on paged reports (see the IsPaged property).
RenderField | Overriden. Called when the component needs to render a report field with specific content at a specific position on the current page.
StartOverlays (inherited from ExportFilter) | Called after the component has finished rendering the first pass of the report, and before it starts rendering overlay fields.
StartReport | Overriden. Called when the component starts rendering a report.
UsesImages | Overriden. Returns a value that determines whether the filter uses page images.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


XlsFilter Constructor

XlsFilter Constructor

Initializes a new instance of the XlsFilter class attached to a file.

[Visual Basic]

Public Function New( _

ByVal fileName As String _

)

[C#]

public XlsFilter(

string fileName

);

[Delphi]

public constructor Create(

fileName: String

);

Parameters

fileName

Full name of the file to be created.

Remarks

If the file already exists, the filter will open it and will add a new sheet with the report.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


XlsFilter Properties

XlsFilter Properties

The properties of the XlsFilter class are listed here. For a complete list of XlsFilter class members, see the XlsFilter Members topic.

Public Properties

Shading | Prevents the filter from creating shaded areas on the sheet.
SheetName | Gets or sets the name of the worksheet to be used when saving the report into the Excel workbook file.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


XlsFilter.Shading Property

XlsFilter.Shading Property

Prevents the filter from creating shaded areas on the sheet.

[Visual Basic]

Public Property Shading As Boolean

[C#]

public bool Shading {get;set;}

[Delphi]

public property Shading: Boolean read get_Shading write set_Shading;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


XlsFilter.SheetName Property

XlsFilter.SheetName Property

Gets or sets the name of the worksheet to be used when saving the report into the Excel workbook file.

[Visual Basic]

Public Property SheetName As String

[C#]

public string SheetName {get;set;}

[Delphi]

public property SheetName: String read get_SheetName write set_SheetName;

Remarks

You can use this property to save multiple reports into a single Excel workbook file, one on each sheet.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


XlsFilter Methods

XlsFilter Methods

The methods of the XlsFilter class are listed here. For a complete list of XlsFilter class members, see the XlsFilter Members topic.

Public Methods

Dispose | Overriden. Called when the component finishes rendering a report, or when the rendering process is canceled by the user or interrupted by an error.
EndReport | Overriden. Called when the component finishes rendering a report.
IsPaged | Overriden. Determines whether this filter generates single or multi-page reports.
NewPage (inherited from ExportFilter) | Called after each page break on paged reports (see the IsPaged property).
RenderField | Overriden. Called when the component needs to render a report field with specific content at a specific position on the current page.
StartOverlays (inherited from ExportFilter) | Called after the component has finished rendering the first pass of the report, and before it starts rendering overlay fields.
StartReport | Overriden. Called when the component starts rendering a report.
UsesImages | Overriden. Returns a value that determines whether the filter uses page images.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


XlsFilter.Dispose Method

XlsFilter.Dispose Method

Called when the component finishes rendering a report, or when the rendering process is canceled by the user or interrupted by an error.

[Visual Basic]

Overrides Public Sub Dispose() Implements IDisposable.Dispose

[C#]

override public void Dispose()

[Delphi]

public procedure Dispose(); override;

Implements

IDisposable.Dispose

Remarks

Use this method to free any disposable objects used by the filter.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


XlsFilter.EndReport Method

XlsFilter.EndReport Method

Called when the component finishes rendering a report.

[Visual Basic]

Overrides Public Sub EndReport()

[C#]

override public void EndReport()

[Delphi]

public procedure EndReport(); override;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


XlsFilter.IsPaged Method

XlsFilter.IsPaged Method

Determines whether this filter generates single or multi-page reports.

[Visual Basic]

Overrides Public Function IsPaged() As Boolean

[C#]

override public bool IsPaged()

[Delphi]

public function IsPaged(): Boolean; override;

Return Value

Always returns false.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


XlsFilter.RenderField Method

XlsFilter.RenderField Method

Called when the component needs to render a report field with specific content at a specific position on the current page.

[Visual Basic]

Overrides Public Sub RenderField( _

ByVal field As Field, _

ByVal rc As Rectangle, _

ByVal text As String, _

ByVal img As Image _

)

[C#]

override public void RenderField(

Field field,

Rectangle rc,

string text,

Image img

);

[Delphi]

public procedure RenderField(

field: Field;

rc: Rectangle;

text: String;

img: Image

); override;

Parameters

field

Field object to render.

rc

Rectangle that determines the field position on the page, in twips.

text

Field text to render.

img

Field image to render.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


XlsFilter.StartReport Method

XlsFilter.StartReport Method

Called when the component starts rendering a report.

[Visual Basic]

Overrides Public Sub StartReport( _

ByVal report As C1Report _

)

[C#]

override public void StartReport(

C1Report report

);

[Delphi]

public procedure StartReport(

report: C1Report

); override;

Parameters

report

Owner report.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


XlsFilter.UsesImages Method

XlsFilter.UsesImages Method

Returns a value that determines whether the filter uses page images.

[Visual Basic]

Overrides Public Function UsesImages() As Boolean

[C#]

override public bool UsesImages()

[Delphi]

public function UsesImages(): Boolean; override;

Return Value

Always returns false.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1.Win.C1Report.Design Namespace

C1.Win.C1Report.Design Namespace

C1.Win.C1Report.Design Hierarchy

Classes

Class | Description
DataSourceEditor | System.Drawing.Design.UITypeEditor used to edit DataSource properties.
ExpressionEditor | System.Drawing.Design.UITypeEditor used to edit script properties.
FormatConverter | System.ComponentModel.TypeConverter used to edit formatting strings.
LayoutEditor | Shows a page setup dialog where the use can pick the paper size, orientation, and margins.
PageUnitConverter | System.ComponentModel.TypeConverter used to edit measurements.
PictureAlignEditor | System.Drawing.Design.UITypeEditor used to edit image alignment properties (properties of type PictureAlignEnum).
PictureHolderEditor | PictureHolderEditor provides a list of available text image names plus the option to load an image from a file.
SubreportFieldConverter | System.ComponentModel.TypeConverter used to edit properties that represent reports.
TextAlignEditor | System.Drawing.Design.UITypeEditor used to edit text alignment properties (properties of type FieldAlignEnum).
TextFieldEditor | System.Drawing.Design.UITypeEditor that provides a list of available text field names plus the option to type in an expression using a script editor.

See Also

C1.Win.C1Report Assembly

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataSourceEditor Class

DataSourceEditor Class

System.Drawing.Design.UITypeEditor used to edit DataSource properties.

For a list of all members of this type, see DataSourceEditor Members.

System.Object

System.Drawing.Design.UITypeEditor

C1.Win.C1Report.Design.DataSourceEditor

[Visual Basic]

Public Class DataSourceEditor

Inherits UITypeEditor

[C#]

public class DataSourceEditor : UITypeEditor

[Delphi]

type DataSourceEditor = class (UITypeEditor);

Remarks

This editor calls a delegate on the report object. Report designers can provide a delegate and show their custom UI to use for editing the data source.

Namespace: C1.Win.C1Report.Design

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataSourceEditor Members

DataSourceEditor Members

DataSourceEditor overview

Public Methods

EditValue | Overloaded. Overriden. Edits the specified object's value using the editor style indicated by GetEditStyle.
GetEditStyle | Overloaded. Overriden. Gets the editor style used by the EditValue method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataSourceEditor Methods

DataSourceEditor Methods

The methods of the DataSourceEditor class are listed here. For a complete list of DataSourceEditor class members, see the DataSourceEditor Members topic.

Public Methods

EditValue | Overloaded. Overriden. Edits the specified object's value using the editor style indicated by GetEditStyle.
GetEditStyle | Overloaded. Overriden. Gets the editor style used by the EditValue method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataSourceEditor.EditValue Method

DataSourceEditor.EditValue Method

Edits the specified object's value using the editor style indicated by GetEditStyle.

[Visual Basic]

Overrides Public Function EditValue( _

ByVal ctx As ITypeDescriptorContext, _

ByVal provider As IServiceProvider, _

ByVal value As Object _

) As Object

[C#]

override public object EditValue(

ITypeDescriptorContext ctx,

IServiceProvider provider,

object value

);

[Delphi]

public function EditValue(

ctx: ITypeDescriptorContext;

provider: IServiceProvider;

value: Object

): Object; overload; override;

Parameters

ctx

An System.ComponentModel.ITypeDescriptorContext that can be used to gain additional context information.

provider

An System.IServiceProvider that this editor can use to obtain services.

value

The object to edit.

Return Value

The new value of the object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


DataSourceEditor.GetEditStyle Method

DataSourceEditor.GetEditStyle Method

Gets the editor style used by the EditValue method.

[Visual Basic]

Overrides Public Function GetEditStyle( _

ByVal ctx As ITypeDescriptorContext _

) As UITypeEditorEditStyle

[C#]

override public UITypeEditorEditStyle GetEditStyle(

ITypeDescriptorContext ctx

);

[Delphi]

public function GetEditStyle(

ctx: ITypeDescriptorContext

): UITypeEditorEditStyle; overload; override;

Parameters

ctx

An System.ComponentModel.ITypeDescriptorContext that can be used to gain additional context information.

Return Value

A System.Drawing.Design.UITypeEditorEditStyle value that indicates the style of editor used by EditValue.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ExpressionEditor Class

ExpressionEditor Class

System.Drawing.Design.UITypeEditor used to edit script properties.

For a list of all members of this type, see ExpressionEditor Members.

System.Object

System.Drawing.Design.UITypeEditor

C1.Win.C1Report.Design.ExpressionEditor

[Visual Basic]

Public Class ExpressionEditor

Inherits UITypeEditor

[C#]

public class ExpressionEditor : UITypeEditor

[Delphi]

type ExpressionEditor = class (UITypeEditor);

Remarks

ExpressionEditor shows a modal dialog that allows users to enter VBScript expressions or statements.

You can use this System.Drawing.Design.UITypeEditor in classes that derive from Field to provide script editing.

Namespace: C1.Win.C1Report.Design

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ExpressionEditor Members

ExpressionEditor Members

ExpressionEditor overview

Public Methods

EditValue | Overloaded. Overriden. Edits the value of the specified object.
GetEditStyle | Overloaded. Overriden. Gets the editor style used by the EditValue method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ExpressionEditor Methods

ExpressionEditor Methods

The methods of the ExpressionEditor class are listed here. For a complete list of ExpressionEditor class members, see the ExpressionEditor Members topic.

Public Methods

EditValue | Overloaded. Overriden. Edits the value of the specified object.
GetEditStyle | Overloaded. Overriden. Gets the editor style used by the EditValue method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ExpressionEditor.EditValue Method

ExpressionEditor.EditValue Method

Edits the value of the specified object.

[Visual Basic]

Overrides Public Function EditValue( _

ByVal ctx As ITypeDescriptorContext, _

ByVal provider As IServiceProvider, _

ByVal value As Object _

) As Object

[C#]

override public object EditValue(

ITypeDescriptorContext ctx,

IServiceProvider provider,

object value

);

[Delphi]

public function EditValue(

ctx: ITypeDescriptorContext;

provider: IServiceProvider;

value: Object

): Object; overload; override;

Parameters

ctx

An System.ComponentModel.ITypeDescriptorContext that can be used to gain additional context information.

provider

An System.IServiceProvider through which editing services may be obtained.

value

An instance of the value being edited.

Return Value

A string containing the new value of the object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


ExpressionEditor.GetEditStyle Method

ExpressionEditor.GetEditStyle Method

Gets the editor style used by the EditValue method.

[Visual Basic]

Overrides Public Function GetEditStyle( _

ByVal ctx As ITypeDescriptorContext _

) As UITypeEditorEditStyle

[C#]

override public UITypeEditorEditStyle GetEditStyle(

ITypeDescriptorContext ctx

);

[Delphi]

public function GetEditStyle(

ctx: ITypeDescriptorContext

): UITypeEditorEditStyle; overload; override;

Parameters

ctx

An System.ComponentModel.ITypeDescriptorContext that can be used to gain additional context information.

Return Value

Always returns UITypeEditorEditStyle.Modal.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FormatConverter Class

FormatConverter Class

System.ComponentModel.TypeConverter used to edit formatting strings.

For a list of all members of this type, see FormatConverter Members.

System.Object

System.ComponentModel.TypeConverter

System.ComponentModel.StringConverter

C1.Win.C1Report.Design.FormatConverter

[Visual Basic]

Public Class FormatConverter

Inherits StringConverter

[C#]

public class FormatConverter : StringConverter

[Delphi]

type FormatConverter = class (StringConverter);

Remarks

FormatConverter provides a list of commonly used formatting strings. The user can select one or type his own.

You can use this System.ComponentModel.TypeConverter in classes that derive from Field to provide properties that represent formatting strings.

Namespace: C1.Win.C1Report.Design

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FormatConverter Members

FormatConverter Members

FormatConverter overview

Public Methods

GetStandardValues | Overloaded. Overriden. Returns a collection of standard formats.
GetStandardValuesExclusive | Overloaded. Overriden. Returns false to indicate that the collection of standard values returned from GetStandardValues is not an exclusive list (the user can type custom formats that are not on the list).
GetStandardValuesSupported | Overloaded. Overriden. Returns true to indicate that this object supports a standard set of values that can be picked from a list.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FormatConverter Methods

FormatConverter Methods

The methods of the FormatConverter class are listed here. For a complete list of FormatConverter class members, see the FormatConverter Members topic.

Public Methods

GetStandardValues | Overloaded. Overriden. Returns a collection of standard formats.
GetStandardValuesExclusive | Overloaded. Overriden. Returns false to indicate that the collection of standard values returned from GetStandardValues is not an exclusive list (the user can type custom formats that are not on the list).
GetStandardValuesSupported | Overloaded. Overriden. Returns true to indicate that this object supports a standard set of values that can be picked from a list.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FormatConverter.GetStandardValues Method

FormatConverter.GetStandardValues Method

Returns a collection of standard formats.

[Visual Basic]

Overrides Public Function GetStandardValues( _

ByVal ctx As ITypeDescriptorContext _

) As TypeConverter.StandardValuesCollection

[C#]

override public TypeConverter.StandardValuesCollection GetStandardValues(

ITypeDescriptorContext ctx

);

[Delphi]

public function GetStandardValues(

ctx: ITypeDescriptorContext

): StandardValuesCollection; overload; override;

Parameters

ctx

An System.ComponentModel.ITypeDescriptorContext that can be used to gain additional context information.

Return Value

A list containing the most common formatting strings.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FormatConverter.GetStandardValuesExclusive Method

FormatConverter.GetStandardValuesExclusive Method

Returns false to indicate that the collection of standard values returned from GetStandardValues is not an exclusive list (the user can type custom formats that are not on the list).

[Visual Basic]

Overrides Public Function GetStandardValuesExclusive( _

ByVal ctx As ITypeDescriptorContext _

) As Boolean

[C#]

override public bool GetStandardValuesExclusive(

ITypeDescriptorContext ctx

);

[Delphi]

public function GetStandardValuesExclusive(

ctx: ITypeDescriptorContext

): Boolean; overload; override;

Parameters

ctx

An System.ComponentModel.ITypeDescriptorContext that can be used to gain additional context information.

Return Value

Always returns false.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FormatConverter.GetStandardValuesSupported Method

FormatConverter.GetStandardValuesSupported Method

Returns true to indicate that this object supports a standard set of values that can be picked from a list.

[Visual Basic]

Overrides Public Function GetStandardValuesSupported( _

ByVal ctx As ITypeDescriptorContext _

) As Boolean

[C#]

override public bool GetStandardValuesSupported(

ITypeDescriptorContext ctx

);

[Delphi]

public function GetStandardValuesSupported(

ctx: ITypeDescriptorContext

): Boolean; overload; override;

Parameters

ctx

An System.ComponentModel.ITypeDescriptorContext that can be used to gain additional context information.

Return Value

Always returns true.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


LayoutEditor Class

LayoutEditor Class

Shows a page setup dialog where the use can pick the paper size, orientation, and margins.

For a list of all members of this type, see LayoutEditor Members.

System.Object

System.Drawing.Design.UITypeEditor

C1.Win.C1Report.Design.LayoutEditor

[Visual Basic]

Public Class LayoutEditor

Inherits UITypeEditor

[C#]

public class LayoutEditor : UITypeEditor

[Delphi]

type LayoutEditor = class (UITypeEditor);

Namespace: C1.Win.C1Report.Design

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


LayoutEditor Members

LayoutEditor Members

LayoutEditor overview

Public Methods

EditValue | Overloaded. Overriden. Edits the specified object's value using the editor style indicated by GetEditStyle.
GetEditStyle | Overloaded. Overriden. Gets the editor style used by the EditValue method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


LayoutEditor Methods

LayoutEditor Methods

The methods of the LayoutEditor class are listed here. For a complete list of LayoutEditor class members, see the LayoutEditor Members topic.

Public Methods

EditValue | Overloaded. Overriden. Edits the specified object's value using the editor style indicated by GetEditStyle.
GetEditStyle | Overloaded. Overriden. Gets the editor style used by the EditValue method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


LayoutEditor.EditValue Method

LayoutEditor.EditValue Method

Edits the specified object's value using the editor style indicated by GetEditStyle.

[Visual Basic]

Overrides Public Function EditValue( _

ByVal ctx As ITypeDescriptorContext, _

ByVal provider As IServiceProvider, _

ByVal value As Object _

) As Object

[C#]

override public object EditValue(

ITypeDescriptorContext ctx,

IServiceProvider provider,

object value

);

[Delphi]

public function EditValue(

ctx: ITypeDescriptorContext;

provider: IServiceProvider;

value: Object

): Object; overload; override;

Parameters

ctx

An System.ComponentModel.ITypeDescriptorContext that can be used to gain additional context information.

provider

An System.IServiceProvider that this editor can use to obtain services.

value

The object to edit.

Return Value

The new value of the object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


LayoutEditor.GetEditStyle Method

LayoutEditor.GetEditStyle Method

Gets the editor style used by the EditValue method.

[Visual Basic]

Overrides Public Function GetEditStyle( _

ByVal ctx As ITypeDescriptorContext _

) As UITypeEditorEditStyle

[C#]

override public UITypeEditorEditStyle GetEditStyle(

ITypeDescriptorContext ctx

);

[Delphi]

public function GetEditStyle(

ctx: ITypeDescriptorContext

): UITypeEditorEditStyle; overload; override;

Parameters

ctx

An System.ComponentModel.ITypeDescriptorContext that can be used to gain additional context information.

Return Value

A System.Drawing.Design.UITypeEditorEditStyle value that indicates the style of editor used by EditValue.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PageUnitConverter Class

PageUnitConverter Class

System.ComponentModel.TypeConverter used to edit measurements.

For a list of all members of this type, see PageUnitConverter Members.

System.Object

System.ComponentModel.TypeConverter

System.ComponentModel.BaseNumberConverter

System.ComponentModel.DoubleConverter

C1.Win.C1Report.Design.PageUnitConverter

[Visual Basic]

Public Class PageUnitConverter

Inherits DoubleConverter

[C#]

public class PageUnitConverter : DoubleConverter

[Delphi]

type PageUnitConverter = class (DoubleConverter);

Remarks

PageUnitConverter converts units (in, ", pt, pix, cm, mm) into twips. For example, if the user types "2in" into the property grid, the converter will automatically convert that into 2880 twips).

You can use this System.ComponentModel.TypeConverter in classes that derive from Field to provide properties that represent measurements.

Namespace: C1.Win.C1Report.Design

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PageUnitConverter Members

PageUnitConverter Members

PageUnitConverter overview

Public Methods

ConvertFrom

Overloaded. Overriden. Converts the given value to the type of this converter.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PageUnitConverter Methods

PageUnitConverter Methods

The methods of the PageUnitConverter class are listed here. For a complete list of PageUnitConverter class members, see the PageUnitConverter Members topic.

Public Methods

ConvertFrom

Overloaded. Overriden. Converts the given value to the type of this converter.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PageUnitConverter.ConvertFrom Method

PageUnitConverter.ConvertFrom Method

Converts the given value to the type of this converter.

[Visual Basic]

Overrides Public Function ConvertFrom( _

ByVal ctx As ITypeDescriptorContext, _

ByVal ci As CultureInfo, _

ByVal value As Object _

) As Object

[C#]

override public object ConvertFrom(

ITypeDescriptorContext ctx,

CultureInfo ci,

object value

);

[Delphi]

public function ConvertFrom(

ctx: ITypeDescriptorContext;

ci: CultureInfo;

value: Object

): Object; overload; override;

Parameters

ctx

An System.ComponentModel.ITypeDescriptorContext that can be used to gain additional context information.

ci

The System.Globalization.CultureInfo to use as the current culture.

value

The System.Object to convert.

Return Value

A System.Double value that represents the converted value expressed in twips.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PictureAlignEditor Class

PictureAlignEditor Class

System.Drawing.Design.UITypeEditor used to edit image alignment properties (properties of type PictureAlignEnum).

For a list of all members of this type, see PictureAlignEditor Members.

System.Object

System.Drawing.Design.UITypeEditor

C1.Win.C1Report.Design.PictureAlignEditor

[Visual Basic]

Public Class PictureAlignEditor

Inherits UITypeEditor

[C#]

public class PictureAlignEditor : UITypeEditor

[Delphi]

type PictureAlignEditor = class (UITypeEditor);

Remarks

PictureAlignEditor shows a drop-down control that allows users to visually select image alignment options.

You can use this System.Drawing.Design.UITypeEditor in classes that derive from Field to provide image alignment editing.

Namespace: C1.Win.C1Report.Design

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PictureAlignEditor Members

PictureAlignEditor Members

PictureAlignEditor overview

Public Constructors

PictureAlignEditor Constructor

Initializes a new instance of the PictureAlignEditor class.

Public Methods

EditValue | Overloaded. Overriden. Edits the value of the specified object.
GetEditStyle | Overloaded. Overriden. Gets the editor style used by the EditValue method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PictureAlignEditor Constructor

PictureAlignEditor Constructor

Initializes a new instance of the PictureAlignEditor class.

[Visual Basic]

Public Function New()

[C#]

public PictureAlignEditor()

[Delphi]

public constructor Create();

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PictureAlignEditor Methods

PictureAlignEditor Methods

The methods of the PictureAlignEditor class are listed here. For a complete list of PictureAlignEditor class members, see the PictureAlignEditor Members topic.

Public Methods

EditValue | Overloaded. Overriden. Edits the value of the specified object.
GetEditStyle | Overloaded. Overriden. Gets the editor style used by the EditValue method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PictureAlignEditor.EditValue Method

PictureAlignEditor.EditValue Method

Edits the value of the specified object.

[Visual Basic]

Overrides Public Function EditValue( _

ByVal ctx As ITypeDescriptorContext, _

ByVal provider As IServiceProvider, _

ByVal value As Object _

) As Object

[C#]

override public object EditValue(

ITypeDescriptorContext ctx,

IServiceProvider provider,

object value

);

[Delphi]

public function EditValue(

ctx: ITypeDescriptorContext;

provider: IServiceProvider;

value: Object

): Object; overload; override;

Parameters

ctx

An System.ComponentModel.ITypeDescriptorContext that can be used to gain additional context information.

provider

An System.IServiceProvider through which editing services may be obtained.

value

An instance of the value being edited.

Return Value

A PictureAlignEnum value containing the new value of the object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PictureAlignEditor.GetEditStyle Method

PictureAlignEditor.GetEditStyle Method

Gets the editor style used by the EditValue method.

[Visual Basic]

Overrides Public Function GetEditStyle( _

ByVal ctx As ITypeDescriptorContext _

) As UITypeEditorEditStyle

[C#]

override public UITypeEditorEditStyle GetEditStyle(

ITypeDescriptorContext ctx

);

[Delphi]

public function GetEditStyle(

ctx: ITypeDescriptorContext

): UITypeEditorEditStyle; overload; override;

Parameters

ctx

An System.ComponentModel.ITypeDescriptorContext that can be used to gain additional context information.

Return Value

Always returns UITypeEditorEditStyle.DropDown.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PictureHolderEditor Class

PictureHolderEditor Class

PictureHolderEditor provides a list of available text image names plus the option to load an image from a file.

For a list of all members of this type, see PictureHolderEditor Members.

System.Object

System.Drawing.Design.UITypeEditor

C1.Win.C1Report.Design.PictureHolderEditor

[Visual Basic]

Public Class PictureHolderEditor

Inherits UITypeEditor

[C#]

public class PictureHolderEditor : UITypeEditor

[Delphi]

type PictureHolderEditor = class (UITypeEditor);

Namespace: C1.Win.C1Report.Design

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PictureHolderEditor Members

PictureHolderEditor Members

PictureHolderEditor overview

Public Constructors

PictureHolderEditor Constructor

Initializes a new instance of the PictureHolderEditor class.

Public Methods

EditValue | Overloaded. Overriden. Edits the value of the specified object.
GetEditStyle | Overloaded. Overriden. Gets the editor style used by the EditValue method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PictureHolderEditor Constructor

PictureHolderEditor Constructor

Initializes a new instance of the PictureHolderEditor class.

[Visual Basic]

Public Function New()

[C#]

public PictureHolderEditor()

[Delphi]

public constructor Create();

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PictureHolderEditor Methods

PictureHolderEditor Methods

The methods of the PictureHolderEditor class are listed here. For a complete list of PictureHolderEditor class members, see the PictureHolderEditor Members topic.

Public Methods

EditValue | Overloaded. Overriden. Edits the value of the specified object.
GetEditStyle | Overloaded. Overriden. Gets the editor style used by the EditValue method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PictureHolderEditor.EditValue Method

PictureHolderEditor.EditValue Method

Edits the value of the specified object.

[Visual Basic]

Overrides Public Function EditValue( _

ByVal ctx As ITypeDescriptorContext, _

ByVal provider As IServiceProvider, _

ByVal value As Object _

) As Object

[C#]

override public object EditValue(

ITypeDescriptorContext ctx,

IServiceProvider provider,

object value

);

[Delphi]

public function EditValue(

ctx: ITypeDescriptorContext;

provider: IServiceProvider;

value: Object

): Object; overload; override;

Parameters

ctx

An System.ComponentModel.ITypeDescriptorContext that can be used to gain additional context information.

provider

An System.IServiceProvider through which editing services may be obtained.

value

An instance of the value being edited.

Return Value

A string containing the new value of the object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PictureHolderEditor.GetEditStyle Method

PictureHolderEditor.GetEditStyle Method

Gets the editor style used by the EditValue method.

[Visual Basic]

Overrides Public Function GetEditStyle( _

ByVal ctx As ITypeDescriptorContext _

) As UITypeEditorEditStyle

[C#]

override public UITypeEditorEditStyle GetEditStyle(

ITypeDescriptorContext ctx

);

[Delphi]

public function GetEditStyle(

ctx: ITypeDescriptorContext

): UITypeEditorEditStyle; overload; override;

Parameters

ctx

An System.ComponentModel.ITypeDescriptorContext that can be used to gain additional context information.

Return Value

A System.Drawing.Design.UITypeEditorEditStyle value that indicates the style of editor used by EditValue.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SubreportFieldConverter Class

SubreportFieldConverter Class

System.ComponentModel.TypeConverter used to edit properties that represent reports.

For a list of all members of this type, see SubreportFieldConverter Members.

System.Object

System.ComponentModel.TypeConverter

System.ComponentModel.StringConverter

C1.Win.C1Report.Design.SubreportFieldConverter

[Visual Basic]

Public Class SubreportFieldConverter

Inherits StringConverter

[C#]

public class SubreportFieldConverter : StringConverter

[Delphi]

type SubreportFieldConverter = class (StringConverter);

Remarks

SubreportFieldConverter provides a list of available reports.

You can use this System.ComponentModel.TypeConverter in classes that derive from Field to edit properties that represent reports.

Namespace: C1.Win.C1Report.Design

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SubreportFieldConverter Members

SubreportFieldConverter Members

SubreportFieldConverter overview

Public Methods

CanConvertFrom | Overloaded. Overriden. Returns whether this converter can convert an object of one type to the type of this converter.
CanConvertTo | Overloaded. Overriden. Returns whether this converter can convert the object to the specified type.
ConvertFrom | Overloaded. Overriden. Converts the given value to the type of this converter.
ConvertTo | Overloaded. Overriden. Converts the given value object to the specified type.
GetStandardValues | Overloaded. Overriden. Returns a collection of report names.
GetStandardValuesExclusive | Overloaded. Overriden. Returns whether the collection of standard values returned from GetStandardValues is an exclusive list of possible values, using the specified context.
GetStandardValuesSupported | Overloaded. Overriden. Returns whether this object supports properties, using the specified context.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SubreportFieldConverter Methods

SubreportFieldConverter Methods

The methods of the SubreportFieldConverter class are listed here. For a complete list of SubreportFieldConverter class members, see the SubreportFieldConverter Members topic.

Public Methods

CanConvertFrom | Overloaded. Overriden. Returns whether this converter can convert an object of one type to the type of this converter.
CanConvertTo | Overloaded. Overriden. Returns whether this converter can convert the object to the specified type.
ConvertFrom | Overloaded. Overriden. Converts the given value to the type of this converter.
ConvertTo | Overloaded. Overriden. Converts the given value object to the specified type.
GetStandardValues | Overloaded. Overriden. Returns a collection of report names.
GetStandardValuesExclusive | Overloaded. Overriden. Returns whether the collection of standard values returned from GetStandardValues is an exclusive list of possible values, using the specified context.
GetStandardValuesSupported | Overloaded. Overriden. Returns whether this object supports properties, using the specified context.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SubreportFieldConverter.CanConvertFrom Method

SubreportFieldConverter.CanConvertFrom Method

Returns whether this converter can convert an object of one type to the type of this converter.

[Visual Basic]

Overrides Public Function CanConvertFrom( _

ByVal ctx As ITypeDescriptorContext, _

ByVal type As Type _

) As Boolean

[C#]

override public bool CanConvertFrom(

ITypeDescriptorContext ctx,

Type type

);

[Delphi]

public function CanConvertFrom(

ctx: ITypeDescriptorContext;

type: Type

): Boolean; overload; override;

Parameters

ctx

An System.ComponentModel.ITypeDescriptorContext that can be used to gain additional context information.

type

A System.Type that represents the type you want to convert from.

Return Value

True if type is string, false otherwise.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SubreportFieldConverter.CanConvertTo Method

SubreportFieldConverter.CanConvertTo Method

Returns whether this converter can convert the object to the specified type.

[Visual Basic]

Overrides Public Function CanConvertTo( _

ByVal ctx As ITypeDescriptorContext, _

ByVal type As Type _

) As Boolean

[C#]

override public bool CanConvertTo(

ITypeDescriptorContext ctx,

Type type

);

[Delphi]

public function CanConvertTo(

ctx: ITypeDescriptorContext;

type: Type

): Boolean; overload; override;

Parameters

ctx

An System.ComponentModel.ITypeDescriptorContext that can be used to gain additional context information.

type

A System.Type that represents the type you want to convert to.

Return Value

True if type is string, false otherwise.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SubreportFieldConverter.ConvertFrom Method

SubreportFieldConverter.ConvertFrom Method

Converts the given value to the type of this converter.

[Visual Basic]

Overrides Public Function ConvertFrom( _

ByVal ctx As ITypeDescriptorContext, _

ByVal ci As CultureInfo, _

ByVal value As Object _

) As Object

[C#]

override public object ConvertFrom(

ITypeDescriptorContext ctx,

CultureInfo ci,

object value

);

[Delphi]

public function ConvertFrom(

ctx: ITypeDescriptorContext;

ci: CultureInfo;

value: Object

): Object; overload; override;

Parameters

ctx

An System.ComponentModel.ITypeDescriptorContext that can be used to gain additional context information.

ci

The System.Globalization.CultureInfo to use as the current culture.

value

The System.Object to convert.

Return Value

A C1Report object with the specified name, or null if no report by the specified name could be found in the report definition file.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SubreportFieldConverter.ConvertTo Method

SubreportFieldConverter.ConvertTo Method

Converts the given value object to the specified type.

[Visual Basic]

Overrides Public Function ConvertTo( _

ByVal ctx As ITypeDescriptorContext, _

ByVal ci As CultureInfo, _

ByVal value As Object, _

ByVal type As Type _

) As Object

[C#]

override public object ConvertTo(

ITypeDescriptorContext ctx,

CultureInfo ci,

object value,

Type type

);

[Delphi]

public function ConvertTo(

ctx: ITypeDescriptorContext;

ci: CultureInfo;

value: Object;

type: Type

): Object; overload; override;

Parameters

ctx

An System.ComponentModel.ITypeDescriptorContext that can be used to gain additional context information.

ci

The System.Globalization.CultureInfo to use as the current culture.

value

The System.Object to convert.

type

A System.Type that represents the type you want to convert to.

Return Value

The name of the report if type is string, null otherwise.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SubreportFieldConverter.GetStandardValues Method

SubreportFieldConverter.GetStandardValues Method

Returns a collection of report names.

[Visual Basic]

Overrides Public Function GetStandardValues( _

ByVal ctx As ITypeDescriptorContext _

) As TypeConverter.StandardValuesCollection

[C#]

override public TypeConverter.StandardValuesCollection GetStandardValues(

ITypeDescriptorContext ctx

);

[Delphi]

public function GetStandardValues(

ctx: ITypeDescriptorContext

): StandardValuesCollection; overload; override;

Parameters

ctx

An System.ComponentModel.ITypeDescriptorContext that provides a format context that can be used to extract additional information about the environment from which this converter is invoked. This parameter or properties of this parameter can be a null reference (Nothing in Visual Basic).

Return Value

A System.ComponentModel.TypeConverter.StandardValuesCollection that holds a standard set of valid values.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SubreportFieldConverter.GetStandardValuesExclusive Method

SubreportFieldConverter.GetStandardValuesExclusive Method

Returns whether the collection of standard values returned from GetStandardValues is an exclusive list of possible values, using the specified context.

[Visual Basic]

Overrides Public Function GetStandardValuesExclusive( _

ByVal ctx As ITypeDescriptorContext _

) As Boolean

[C#]

override public bool GetStandardValuesExclusive(

ITypeDescriptorContext ctx

);

[Delphi]

public function GetStandardValuesExclusive(

ctx: ITypeDescriptorContext

): Boolean; overload; override;

Parameters

ctx

An System.ComponentModel.ITypeDescriptorContext that provides a format context.

Return Value

True because the System.ComponentModel.TypeConverter.StandardValuesCollection returned from GetStandardValues is an exhaustive list of possible values.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


SubreportFieldConverter.GetStandardValuesSupported Method

SubreportFieldConverter.GetStandardValuesSupported Method

Returns whether this object supports properties, using the specified context.

[Visual Basic]

Overrides Public Function GetStandardValuesSupported( _

ByVal ctx As ITypeDescriptorContext _

) As Boolean

[C#]

override public bool GetStandardValuesSupported(

ITypeDescriptorContext ctx

);

[Delphi]

public function GetStandardValuesSupported(

ctx: ITypeDescriptorContext

): Boolean; overload; override;

Parameters

ctx

An System.ComponentModel.ITypeDescriptorContext that provides a format context.

Return Value

True because GetStandardValues should be called to find the properties of this object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextAlignEditor Class

TextAlignEditor Class

System.Drawing.Design.UITypeEditor used to edit text alignment properties (properties of type FieldAlignEnum).

For a list of all members of this type, see TextAlignEditor Members.

System.Object

System.Drawing.Design.UITypeEditor

C1.Win.C1Report.Design.TextAlignEditor

[Visual Basic]

Public Class TextAlignEditor

Inherits UITypeEditor

[C#]

public class TextAlignEditor : UITypeEditor

[Delphi]

type TextAlignEditor = class (UITypeEditor);

Remarks

This editor shows a drop-down control that allows users to visually select text alignment options.

You can use this System.Drawing.Design.UITypeEditor in classes that derive from Field to provide text alignment editing.

Namespace: C1.Win.C1Report.Design

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextAlignEditor Members

TextAlignEditor Members

TextAlignEditor overview

Public Constructors

TextAlignEditor Constructor

Initializes a new instance of the TextAlignEditor class.

Public Methods

EditValue | Overloaded. Overriden. Edits the value of the specified object.
GetEditStyle | Overloaded. Overriden. Gets the editor style used by the EditValue method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextAlignEditor Constructor

TextAlignEditor Constructor

Initializes a new instance of the TextAlignEditor class.

[Visual Basic]

Public Function New()

[C#]

public TextAlignEditor()

[Delphi]

public constructor Create();

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextAlignEditor Methods

TextAlignEditor Methods

The methods of the TextAlignEditor class are listed here. For a complete list of TextAlignEditor class members, see the TextAlignEditor Members topic.

Public Methods

EditValue | Overloaded. Overriden. Edits the value of the specified object.
GetEditStyle | Overloaded. Overriden. Gets the editor style used by the EditValue method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextAlignEditor.EditValue Method

TextAlignEditor.EditValue Method

Edits the value of the specified object.

[Visual Basic]

Overrides Public Function EditValue( _

ByVal ctx As ITypeDescriptorContext, _

ByVal provider As IServiceProvider, _

ByVal value As Object _

) As Object

[C#]

override public object EditValue(

ITypeDescriptorContext ctx,

IServiceProvider provider,

object value

);

[Delphi]

public function EditValue(

ctx: ITypeDescriptorContext;

provider: IServiceProvider;

value: Object

): Object; overload; override;

Parameters

ctx

An System.ComponentModel.ITypeDescriptorContext that can be used to gain additional context information.

provider

An System.IServiceProvider through which editing services may be obtained.

value

An instance of the value being edited.

Return Value

A FieldAlignEnum value containing the new value of the object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextAlignEditor.GetEditStyle Method

TextAlignEditor.GetEditStyle Method

Gets the editor style used by the EditValue method.

[Visual Basic]

Overrides Public Function GetEditStyle( _

ByVal ctx As ITypeDescriptorContext _

) As UITypeEditorEditStyle

[C#]

override public UITypeEditorEditStyle GetEditStyle(

ITypeDescriptorContext ctx

);

[Delphi]

public function GetEditStyle(

ctx: ITypeDescriptorContext

): UITypeEditorEditStyle; overload; override;

Parameters

ctx

An System.ComponentModel.ITypeDescriptorContext that can be used to gain additional context information.

Return Value

Always returns UITypeEditorEditStyle.DropDown.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextFieldEditor Class

TextFieldEditor Class

System.Drawing.Design.UITypeEditor that provides a list of available text field names plus the option to type in an expression using a script editor.

For a list of all members of this type, see TextFieldEditor Members.

System.Object

System.Drawing.Design.UITypeEditor

C1.Win.C1Report.Design.TextFieldEditor

[Visual Basic]

Public Class TextFieldEditor

Inherits UITypeEditor

[C#]

public class TextFieldEditor : UITypeEditor

[Delphi]

type TextFieldEditor = class (UITypeEditor);

Remarks

TextFieldEditor shows a drop-down list that allows users to select report field names.

The list includes a (Script Editor...) option that shows a dialog where the user can type complex expressions.

You can use this System.Drawing.Design.UITypeEditor in classes that derive from Field to provide properties that should be set to report field names.

Namespace: C1.Win.C1Report.Design

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextFieldEditor Members

TextFieldEditor Members

TextFieldEditor overview

Public Constructors

TextFieldEditor Constructor

Initializes a new instance of the TextFieldEditor class.

Public Methods

EditValue | Overloaded. Overriden. Edits the value of the specified object.
GetEditStyle | Overloaded. Overriden. Gets the editor style used by the EditValue method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextFieldEditor Constructor

TextFieldEditor Constructor

Initializes a new instance of the TextFieldEditor class.

[Visual Basic]

Public Function New()

[C#]

public TextFieldEditor()

[Delphi]

public constructor Create();

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextFieldEditor Methods

TextFieldEditor Methods

The methods of the TextFieldEditor class are listed here. For a complete list of TextFieldEditor class members, see the TextFieldEditor Members topic.

Public Methods

EditValue | Overloaded. Overriden. Edits the value of the specified object.
GetEditStyle | Overloaded. Overriden. Gets the editor style used by the EditValue method.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextFieldEditor.EditValue Method

TextFieldEditor.EditValue Method

Edits the value of the specified object.

[Visual Basic]

Overrides Public Function EditValue( _

ByVal ctx As ITypeDescriptorContext, _

ByVal provider As IServiceProvider, _

ByVal value As Object _

) As Object

[C#]

override public object EditValue(

ITypeDescriptorContext ctx,

IServiceProvider provider,

object value

);

[Delphi]

public function EditValue(

ctx: ITypeDescriptorContext;

provider: IServiceProvider;

value: Object

): Object; overload; override;

Parameters

ctx

An System.ComponentModel.ITypeDescriptorContext that can be used to gain additional context information.

provider

An System.IServiceProvider through which editing services may be obtained.

value

An instance of the value being edited.

Return Value

A string containing the new value of the object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


TextFieldEditor.GetEditStyle Method

TextFieldEditor.GetEditStyle Method

Gets the editor style used by the EditValue method.

[Visual Basic]

Overrides Public Function GetEditStyle( _

ByVal ctx As ITypeDescriptorContext _

) As UITypeEditorEditStyle

[C#]

override public UITypeEditorEditStyle GetEditStyle(

ITypeDescriptorContext ctx

);

[Delphi]

public function GetEditStyle(

ctx: ITypeDescriptorContext

): UITypeEditorEditStyle; overload; override;

Parameters

ctx

An System.ComponentModel.ITypeDescriptorContext that can be used to gain additional context information.

Return Value

Always returns UITypeEditorEditStyle.DropDown.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1.Win.C1Report.Util Namespace

C1.Win.C1Report.Util Namespace

C1.Win.C1Report.Util Hierarchy

Classes

Class | Description
FontHolder | Encapsulates a C1.Win.C1Report.Util.FontHolder.Font object and provides get/set access to the font properties.
PictureHolder | Encapsulates an Image object and provides methods for loading images from image files or from binary database fields.

See Also

C1.Win.C1Report Assembly

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FontHolder Class

FontHolder Class

Encapsulates a C1.Win.C1Report.Util.FontHolder.Font object and provides get/set access to the font properties.

For a list of all members of this type, see FontHolder Members.

System.Object

C1.Win.C1Report.Util.FontHolder

[Visual Basic]

Public Class FontHolder

[C#]

public class FontHolder

[Delphi]

type FontHolder = class;

Namespace: C1.Win.C1Report.Util

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FontHolder Members

FontHolder Members

FontHolder overview

Public Constructors

FontHolder Constructor

Initializes a new instance of the FontHolder class.

Public Properties

Bold | Gets or sets a value that indicates whether the encapsulated C1.Win.C1Report.Util.FontHolder.Font is bold.
Italic | Gets or sets a value that indicates whether the encapsulated C1.Win.C1Report.Util.FontHolder.Font is italic.
Name | Gets or sets the name of the encapsulated C1.Win.C1Report.Util.FontHolder.Font object.
Size | Gets or sets the C1.Win.C1Report.Util.FontHolder.Font of the encapsulated C1.Win.C1Report.Util.FontHolder.Font object.
Strikethrough | Gets or sets a value that indicates whether the encapsulated C1.Win.C1Report.Util.FontHolder.Font has a horizontal line through the text.
Underline | Gets or sets a value that indicates whether the encapsulated C1.Win.C1Report.Util.FontHolder.Font is underlined.

Public Operators and Type Conversions

FontHolder to Font Conversion | Converts a FontHolder object to a C1.Win.C1Report.Util.FontHolder.Font object.
Font to FontHolder Conversion | Converts a C1.Win.C1Report.Util.FontHolder.Font object to a FontHolder object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FontHolder Constructor

FontHolder Constructor

Initializes a new instance of the FontHolder class.

[Visual Basic]

Public Function New( _

ByVal font As Font _

)

[C#]

public FontHolder(

Font font

);

[Delphi]

public constructor Create(

font: Font

);

Parameters

font

The C1.Win.C1Report.Util.FontHolder.Font object used to initialize the FontHolder.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FontHolder Properties

FontHolder Properties

The properties of the FontHolder class are listed here. For a complete list of FontHolder class members, see the FontHolder Members topic.

Public Properties

Bold | Gets or sets a value that indicates whether the encapsulated C1.Win.C1Report.Util.FontHolder.Font is bold.
Italic | Gets or sets a value that indicates whether the encapsulated C1.Win.C1Report.Util.FontHolder.Font is italic.
Name | Gets or sets the name of the encapsulated C1.Win.C1Report.Util.FontHolder.Font object.
Size | Gets or sets the C1.Win.C1Report.Util.FontHolder.Font of the encapsulated C1.Win.C1Report.Util.FontHolder.Font object.
Strikethrough | Gets or sets a value that indicates whether the encapsulated C1.Win.C1Report.Util.FontHolder.Font has a horizontal line through the text.
Underline | Gets or sets a value that indicates whether the encapsulated C1.Win.C1Report.Util.FontHolder.Font is underlined.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FontHolder.Bold Property

FontHolder.Bold Property

Gets or sets a value that indicates whether the encapsulated C1.Win.C1Report.Util.FontHolder.Font is bold.

[Visual Basic]

Public Property Bold As Boolean

[C#]

public bool Bold {get;set;}

[Delphi]

public property Bold: Boolean read get_Bold write set_Bold;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FontHolder.Italic Property

FontHolder.Italic Property

Gets or sets a value that indicates whether the encapsulated C1.Win.C1Report.Util.FontHolder.Font is italic.

[Visual Basic]

Public Property Italic As Boolean

[C#]

public bool Italic {get;set;}

[Delphi]

public property Italic: Boolean read get_Italic write set_Italic;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FontHolder.Name Property

FontHolder.Name Property

Gets or sets the name of the encapsulated C1.Win.C1Report.Util.FontHolder.Font object.

[Visual Basic]

Public Property Name As String

[C#]

public string Name {get;set;}

[Delphi]

public property Name: String read get_Name write set_Name;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FontHolder.Size Property

FontHolder.Size Property

Gets or sets the C1.Win.C1Report.Util.FontHolder.Font of the encapsulated C1.Win.C1Report.Util.FontHolder.Font object.

[Visual Basic]

Public Property Size As Single

[C#]

public Single Size {get;set;}

[Delphi]

public property Size: Single read get_Size write set_Size;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FontHolder.Strikethrough Property

FontHolder.Strikethrough Property

Gets or sets a value that indicates whether the encapsulated C1.Win.C1Report.Util.FontHolder.Font has a horizontal line through the text.

[Visual Basic]

Public Property Strikethrough As Boolean

[C#]

public bool Strikethrough {get;set;}

[Delphi]

public property Strikethrough: Boolean read get_Strikethrough write set_Strikethrough;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FontHolder.Underline Property

FontHolder.Underline Property

Gets or sets a value that indicates whether the encapsulated C1.Win.C1Report.Util.FontHolder.Font is underlined.

[Visual Basic]

Public Property Underline As Boolean

[C#]

public bool Underline {get;set;}

[Delphi]

public property Underline: Boolean read get_Underline write set_Underline;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FontHolder Operators

FontHolder Operators

The operators of the FontHolder class are listed here. For a complete list of FontHolder class members, see the FontHolder Members topic.

Public Operators and Type Conversions

FontHolder to Font Conversion | Converts a FontHolder object to a C1.Win.C1Report.Util.FontHolder.Font object.
Font to FontHolder Conversion | Converts a C1.Win.C1Report.Util.FontHolder.Font object to a FontHolder object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Font to FontHolder Conversion

Font to FontHolder Conversion

Converts a C1.Win.C1Report.Util.FontHolder.Font object to a FontHolder object.

[Visual Basic]

returnValue = op_Implicit(f)

[C#]

public static implicit operator FontHolder(

Font f

);

[Delphi]

public class operator Implicit(

f: Font

): FontHolder;

Parameters

f

The C1.Win.C1Report.Util.FontHolder.Font object.

Return Value

New FontHolder object whose C1.Win.C1Report.Util.FontHolder.Font property is equal to supplied font object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


FontHolder to Font Conversion

FontHolder to Font Conversion

Converts a FontHolder object to a C1.Win.C1Report.Util.FontHolder.Font object.

[Visual Basic]

returnValue = op_Implicit(fontHolder)

[C#]

public static implicit operator Font(

FontHolder fontHolder

);

[Delphi]

public class operator Implicit(

fontHolder: FontHolder

): Font;

Parameters

fontHolder

The FontHolder object.

Return Value

C1.Win.C1Report.Util.FontHolder.Font object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PictureHolder Class

PictureHolder Class

Encapsulates an Image object and provides methods for loading images from image files or from binary database fields.

For a list of all members of this type, see PictureHolder Members.

System.Object

C1.Win.C1Report.Util.PictureHolder

[Visual Basic]

Public Class PictureHolder

[C#]

public class PictureHolder

[Delphi]

type PictureHolder = class;

Remarks

A PictureHolder object may contain an unbound image (from a file or URL), or the name of a database field that contains images.

Namespace: C1.Win.C1Report.Util

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PictureHolder Members

PictureHolder Members

PictureHolder overview

Public Properties

FieldName | Gets the name of the database field from which this PictureHolder will load images.
Image | Gets the Image loaded by this PictureHolder.
IsBound | Gets a value that indicates whether this PictureHolder is bound to a database field that contains images.
IsEmpty | Gets a value that indicates whether this PictureHolder is empty.
IsUrl | Gets a value that indicates whether this PictureHolder contains an image URL.
Url | Gets the URL that contains the Image loaded by this PictureHolder.

Public Operators and Type Conversions

PictureHolder to Image Conversion

Converts a PictureHolder object into an Image object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PictureHolder Properties

PictureHolder Properties

The properties of the PictureHolder class are listed here. For a complete list of PictureHolder class members, see the PictureHolder Members topic.

Public Properties

FieldName | Gets the name of the database field from which this PictureHolder will load images.
Image | Gets the Image loaded by this PictureHolder.
IsBound | Gets a value that indicates whether this PictureHolder is bound to a database field that contains images.
IsEmpty | Gets a value that indicates whether this PictureHolder is empty.
IsUrl | Gets a value that indicates whether this PictureHolder contains an image URL.
Url | Gets the URL that contains the Image loaded by this PictureHolder.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PictureHolder.FieldName Property

PictureHolder.FieldName Property

Gets the name of the database field from which this PictureHolder will load images.

[Visual Basic]

Public ReadOnly Property FieldName As String

[C#]

public string FieldName {get;}

[Delphi]

public property FieldName: String read get_FieldName;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PictureHolder.Image Property

PictureHolder.Image Property

Gets the Image loaded by this PictureHolder.

[Visual Basic]

Public ReadOnly Property Image As Image

[C#]

public Image Image {get;}

[Delphi]

public property Image: Image read get_Image;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PictureHolder.IsBound Property

PictureHolder.IsBound Property

Gets a value that indicates whether this PictureHolder is bound to a database field that contains images.

[Visual Basic]

Public ReadOnly Property IsBound As Boolean

[C#]

public bool IsBound {get;}

[Delphi]

public property IsBound: Boolean read get_IsBound;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PictureHolder.IsEmpty Property

PictureHolder.IsEmpty Property

Gets a value that indicates whether this PictureHolder is empty.

[Visual Basic]

Public ReadOnly Property IsEmpty As Boolean

[C#]

public bool IsEmpty {get;}

[Delphi]

public property IsEmpty: Boolean read get_IsEmpty;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PictureHolder.IsUrl Property

PictureHolder.IsUrl Property

Gets a value that indicates whether this PictureHolder contains an image URL.

[Visual Basic]

Public ReadOnly Property IsUrl As Boolean

[C#]

public bool IsUrl {get;}

[Delphi]

public property IsUrl: Boolean read get_IsUrl;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PictureHolder.Url Property

PictureHolder.Url Property

Gets the URL that contains the Image loaded by this PictureHolder.

[Visual Basic]

Public ReadOnly Property Url As String

[C#]

public string Url {get;}

[Delphi]

public property Url: String read get_Url;

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PictureHolder Operators

PictureHolder Operators

The operators of the PictureHolder class are listed here. For a complete list of PictureHolder class members, see the PictureHolder Members topic.

Public Operators and Type Conversions

PictureHolder to Image Conversion

Converts a PictureHolder object into an Image object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


PictureHolder to Image Conversion

PictureHolder to Image Conversion

Converts a PictureHolder object into an Image object.

[Visual Basic]

returnValue = op_Implicit(picHolder)

[C#]

public static implicit operator Image(

PictureHolder picHolder

);

[Delphi]

public class operator Implicit(

picHolder: PictureHolder

): Image;

Parameters

picHolder

The PictureHolder object.

Return Value

An Image object.

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1.Win.C1Report.Util.Styles Namespace

C1.Win.C1Report.Util.Styles Namespace

C1.Win.C1Report.Util.Styles Hierarchy

Classes

Class | Description
Style | Style contains a collection of arbitrary attributes, represented by a name/object entry, a reference to a parent Style, and a reference to the containing StyleContext.

See Also

C1.Win.C1Report Assembly

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Style Class

Style Class

Style contains a collection of arbitrary attributes, represented by a name/object entry, a reference to a parent Style, and a reference to the containing StyleContext.

For a list of all members of this type, see Style Members.

System.Object

C1.Win.C1Report.Util.Styles.Style

[Visual Basic]

Public Class Style

[C#]

public class Style

[Delphi]

type Style = class;

Namespace: C1.Win.C1Report.Util.Styles

Assembly: C1.Win.C1Report (in c1.win.c1report.dll)

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


Style Members

Style Members

Style overview

See Also

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


AddMethod(FieldCollection)1 - C#

C#

C1Report1.Fields.Add("NewField", "Hello World",

100, 100, 2000, 300);

C1Report1.Fields["NewField"].Section = SectionTypeEnum.Detail;


AddMethod(FieldCollection)1 - Delphi

Delphi

begin

C1Report1.Fields.Add('NewField', 'Hello World', 100, 100, 2000, 300);

C1Report1.Fields['NewField'].Section := SectionTypeEnum.Detail;end;


AddMethod(FieldCollection)1 - Visual Basic

Visual Basic

C1Report1.Fields.Add("NewField", "Hello World", _

100, 100, 2000, 300)

C1Report1.Fields("NewField").Section = SectionTypeEnum.Detail


AddMethod(FieldCollection)2 - C#

C#

Field theField;

theField = C1Report1.Fields.Add("NewField", "Hello World",

100, 100, 2000, 300);

theField.Section = SectionTypeEnum.Detail;


AddMethod(FieldCollection)2 - Delphi

Delphi

var

theField: Field;

begin

theField := C1Report1.Fields.Add('NewField','Hello World', 100, 100, 2000, 300);

theField.Section := SectionTypeEnum.Detail;

end;


AddMethod(FieldCollection)2 - Visual Basic

Visual Basic

Dim theField As Field

theField = C1Report1.Fields.Add("NewField", "Hello World", _

100, 100, 2000, 300)

theField.Section = SectionTypeEnum.Detail


AddMethod(GroupCollection) - C#

C#

Debug.Print vsr.Sections.Count;

7;

C1Report1.Groups.Add("NewGroup", "Left ([ProductName],1)", vsrAscending);

Debug.Print C1Report1.Sections.Count;

9;


AddMethod(GroupCollection) - Delphi

Delphi

C1Report1.Groups.Add('NewGroup','Left ([ProductName],1)', vsrAscending);


AddMethod(GroupCollection) - Visual Basic

Visual Basic

Debug.Print vsr.Sections.Count

7

C1Report1.Groups.Add("NewGroup", "Left ([ProductName],1)", vsrAscending)

Debug.Print C1Report1.Sections.Count

9


ApplicationAliases - C#

C#

private void RenderReport(string strReportName)

{

// load report requested by the user

c1r.Load("c:\Reports\MyReports.xml", strReportName);

// replace connection string alias

string strConn$;

switch (i) { c1r.DataSource.ConnectionString;

case "$$CUSTOMERS";

case "$$EMPLOYEES";

strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" + _

"Data Source=C:\SecureData\People.mdb;" +

"Password=slekrsldksd;";

case "$$SALES";

strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" +

"Data Source=C:\SecureData\Numbers.mdb;" +

"Password=slkkdmssids;";

}

// set connection string, render report

c1r.DataSource.ConnectionString = strConn;

ppv1.Document = c1r.Document;

}


ApplicationAliases - Delphi

Delphi

procedure RenderReport(strReportName: string);

var

strConn: string;

begin

// load report requested by the user

c1r.Load('c:\Reports\MyReports.xml', strReportName)

// replace connection string alias

if (c1r.DataSource.ConnectionString = '$$CUSTOMERS') or

(c1r.DataSource.ConnectionString = '$$EMPLOYEES') then

strConn := 'Provider=Microsoft.Jet.OLEDB.4.0;' +

'Data Source=C:\SecureData\People.mdb;' +

'Password=slekrsldksd;'

else

if c1r.DataSource.ConnectionString = '$$SALES' then

strConn := 'Provider=Microsoft.Jet.OLEDB.4.0;' +

'Data Source=C:\SecureData\Numbers.mdb;' +

'Password=slkkdmssids;'

else

strConn := '';

// set connection string, render report

c1r.DataSource.ConnectionString := strConn;

ppv1.Document := c1r.Document;

end;


ApplicationAliases - Visual Basic

Visual Basic

Private Sub RenderReport(strReportName As String)

' load report requested by the user

c1r.Load("c:\Reports\MyReports.xml", strReportName)

' replace connection string alias

Dim strConn$

Select Case c1r.DataSource.ConnectionString

Case "$$CUSTOMERS"

Case "$$EMPLOYEES"

strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _

"Data Source=C:\SecureData\People.mdb;" & _

"Password=slekrsldksd;"

Case "$$SALES"

strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _

"Data Source=C:\SecureData\Numbers.mdb;" & _

"Password=slkkdmssids;"

End Select

' set connection string, render report

c1r.DataSource.ConnectionString = strConn

ppv1.Document = c1r.Document

End Sub


BoundImages - C#

C#

fEmployeePhoto.Picture = "Photo";


BoundImages - Delphi

Delphi

fEmployeePhoto.Picture :='Photo';


BoundImages - Visual Basic

Visual Basic

fEmployeePhoto.Picture = "Photo"


C1.Win.C1Report.Design Hierarchy

C1.Win.C1Report.Design Hierarchy

System.Object

System.Drawing.Design.UITypeEditor

C1.Win.C1Report.Design.DataSourceEditor

C1.Win.C1Report.Design.ExpressionEditor

C1.Win.C1Report.Design.LayoutEditor

C1.Win.C1Report.Design.PictureAlignEditor

C1.Win.C1Report.Design.PictureHolderEditor

C1.Win.C1Report.Design.TextAlignEditor

C1.Win.C1Report.Design.TextFieldEditor

System.ComponentModel.TypeConverter

System.ComponentModel.BaseNumberConverter

System.ComponentModel.DoubleConverter

C1.Win.C1Report.Design.PageUnitConverter

System.ComponentModel.StringConverter

C1.Win.C1Report.Design.FormatConverter

C1.Win.C1Report.Design.SubreportFieldConverter

See Also

C1.Win.C1Report.Design Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1.Win.C1Report Hierarchy

C1.Win.C1Report Hierarchy

System.Object

System.MarshalByRefObject

System.ComponentModel.Component

C1.Win.C1Report.C1Report ---- System.ComponentModel.ISupportInitialize

System.Exception

System.ApplicationException

C1.Win.C1Report.DataAccessException

C1.Win.C1Report.DataSource

System.EventArgs

C1.Win.C1Report.DialogEventArgs

C1.Win.C1Report.ReportEventArgs

C1.Win.C1Report.ExportFilter ---- System.IDisposable

C1.Win.C1Report.HtmlFilter ---- System.IDisposable

C1.Win.C1Report.PdfFilter

C1.Win.C1Report.RtfFilter ---- System.IDisposable

C1.Win.C1Report.RtfLabelFilter

C1.Win.C1Report.TextFilter ---- System.IDisposable

C1.Win.C1Report.TiffFilter

C1.Win.C1Report.XlsFilter ---- System.IDisposable

C1.Win.C1Report.Field ---- System.ICloneable

C1.Win.C1Report.FieldCollection ---- System.Collections.ICollection, System.Collections.IEnumerable

C1.Win.C1Report.Group

C1.Win.C1Report.GroupCollection ---- System.Collections.ICollection, System.Collections.IEnumerable

C1.Win.C1Report.Layout

C1.Win.C1Report.Section

C1.Win.C1Report.SectionCollection ---- System.Collections.ICollection, System.Collections.IEnumerable

System.ValueType

System.Enum

C1.Win.C1Report.AnchorEnum

C1.Win.C1Report.BackStyleEnum

C1.Win.C1Report.BarCodeEnum

C1.Win.C1Report.BorderStyleEnum

C1.Win.C1Report.CheckBoxEnum

C1.Win.C1Report.ColumnLayoutEnum

C1.Win.C1Report.FieldAlignEnum

C1.Win.C1Report.FileFormatEnum

C1.Win.C1Report.ForcePageBreakEnum

C1.Win.C1Report.GrowShrinkModeEnum

C1.Win.C1Report.HdrFtrEnum

C1.Win.C1Report.KeepTogetherEnum

C1.Win.C1Report.LineSlantEnum

C1.Win.C1Report.OrientationEnum

C1.Win.C1Report.PictureAlignEnum

C1.Win.C1Report.PictureScaleEnum

C1.Win.C1Report.PictureShowEnum

C1.Win.C1Report.RunningSumEnum

C1.Win.C1Report.SectionTypeEnum

C1.Win.C1Report.SortEnum

C1.Win.C1Report.TextDirectionEnum

System.Delegate

System.MulticastDelegate

C1.Win.C1Report.DialogEventHandler

C1.Win.C1Report.ReportEventHandler

See Also

C1.Win.C1Report Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1.Win.C1Report.Util Hierarchy

C1.Win.C1Report.Util Hierarchy

System.Object

C1.Win.C1Report.Util.FontHolder

C1.Win.C1Report.Util.PictureHolder

See Also

C1.Win.C1Report.Util Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


C1.Win.C1Report.Util.Styles Hierarchy

C1.Win.C1Report.Util.Styles Hierarchy

System.Object

C1.Win.C1Report.Util.Styles.Style

See Also

C1.Win.C1Report.Util.Styles Namespace

Untitled Document
Send feedback to ComponentOne
Copyright © 1987-2005 ComponentOne LLC. All rights reserved.


CalculatedProperty(Field) - C#

C#

theField.Text = "Amount * SalesTax";

theField.Calculated = false;

Debug.Print Field.value;

Amount * SalesTax

theField.Text = "Amount * SalesTax";

theField.Calculated = true;

Debug.Print Field.value;

257.34;


CalculatedProperty(Field) - Delphi

Delphi

theField.Text := 'Amount * SalesTax';

theField.Calculated := False;

theField.Text := 'Amount * SalesTax';

theField.Calculated := True;


CalculatedProperty(Field) - Visual Basic

Visual Basic

theField.Text = "Amount * SalesTax"

theField.Calculated = False

Debug.Print Field.Value

Amount * SalesTax

theField.Text = "Amount * SalesTax"

theField.Calculated = True

Debug.Print Field.Value

257.34


Cancel - C#

C#

if ( Page > 100 ) Cancel = true;


Cancel - Delphi

Delphi

begin

if (Page > 100) then

Cancel := True;

end;


CancelProperty1 - C#

C#

private void Cancel_Click()

{

if ( C1Report1.IsBusy ) {

Debug.Write "Cancelling Report";

C1Report1.Cancel = true;

} else {

Debug.Write "No report to cancel";

}

}


CancelProperty1 - Delphi

Delphi

procedure Cancel_Click;

begin

if C1Report1.IsBusy then

begin

Debug.Write('Cancelling Report');

C1Report1.Cancel := True;

end

else

Debug.Write('No report to cancel');

end;


CancelProperty1 - Visual Basic

Visual Basic

Private Sub Cancel_Click()

If C1Report1.IsBusy Then

Debug.Write "Cancelling Report"

C1Report1.Cancel = True

Else

Debug.Write "No report to cancel"

End If

End Sub


CancelProperty2 - C#

C#

private void C1Report1_OnClose()

{

if ( C1Report1.Cancel ) {

Console.Write "** The report was Cancelled.";

}

}


CancelProperty2 - Delphi

Delphi

procedure C1Report1_OnClose;

begin

if C1Report1.Cancel then

begin

Debug.Write('** The report was Cancelled.');

end;

end;


CancelProperty2 - Visual Basic

Visual Basic

Private Sub C1Report1_OnClose()

If C1Report1.Cancel Then

Debug.Write "** The report was Cancelled."

End If

End Sub


Cancel - Visual Basic

Visual Basic

If Page > 100 Then Cancel = True


Compatibility - C#

C#

IIf(SalesAmount > 1000, "Yes", "No")


Compatibility - Delphi

Delphi

if SalesAmount > 1000 then

v := 'Yes'

else

v := 'No';


Compatibility - Visual Basic

Visual Basic

IIf(SalesAmount > 1000, "Yes", "No")


ConnectionString - C#

C#

// build connection string with placeholder for password

string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" +

"Data Source=C:\SecureData\People.mdb;" +

"Password={{THEPASSWORD}};";

// get password from the user

string strPwd = InputBox("Please enter your password:");

if (Len(strPwd) = 0) return

// build new connection string and assign it to the control

strConn = Replace(strConn, "{{THEPASSWORD}}", strPwd);

c1r.DataSource.ConnectionString = strConn;


ConnectionString - Delphi

Delphi

// build connection string with placeholder for password

strConn := 'Provider=Microsoft.Jet.OLEDB.4.0;' +

'Data Source=C:\SecureData\People.mdb;' +

'Password={{THEPASSWORD}};';

// get password from the user

strPwd := InputBox('Please enter your password:');

if strPwd.Length = 0 then exit;

// build new connection string and assign it to the control

strConn := Replace(strConn,'{{THEPASSWORD}}', strPwd);

vsr.DataSource.ConnectionString := strConn;


ConnectionStringProperty - C#

C#

// ODBC connection

// NorthWind is the name of an ODBC data source

strConn = "dsn=NorthWind";

// Access file

strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" +

"Data Source=D:\MyData\NWIND.MDB;";

// SQL Server

strConn = "Provider=SQLOLEDB.1;" +

"Integrated Security=SSPI;" +

"Persist Security Info=false;" +

"User ID=Bill;" +

"Initial Catalog=Northwind;" +

"Data Source=BILLSERVER";


ConnectionStringProperty - Delphi

Delphi

// ODBC connection

// NorthWind is the name of an ODBC data source

strConn := 'dsn=NorthWind';

// Access file

strConn := 'Provider=Microsoft.Jet.OLEDB.4.0;' +

'Data Source=D:\MyData\NWIND.MDB;';

// SQL Server

strConn := 'Provider=SQLOLEDB.1;' +

'Integrated Security=SSPI;' +

'Persist Security Info=False;' +

'User ID=Bill;' +

'Initial Catalog=Northwind;' +

'Data Source=BILLSERVER';


ConnectionStringProperty - Visual Basic

Visual Basic

' ODBC connection

' NorthWind is the name of an ODBC data source

strConn = "dsn=NorthWind"

' Access file

strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _

"Data Source=D:\MyData\NWIND.MDB;"

' SQL Server

strConn = "Provider=SQLOLEDB.1;" & _

"Integrated Security=SSPI;" & _

"Persist Security Info=False;" & _

"User ID=Bill;" & _

"Initial Catalog=Northwind;" & _

"Data Source=BILLSERVER"


ConnectionString - Visual Basic

Visual Basic

' build connection string with placeholder for password

Dim strConn

strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _

"Data Source=C:\SecureData\People.mdb;" & _

"Password={{THEPASSWORD}};"

' get password from the user

Dim strPwd$

strPwd = InputBox("Please enter your password:")

If Len(strPwd) = 0 Then Exit Sub

' build new connection string and assign it to the control

strConn = Replace(strConn, "{{THEPASSWORD}}", strPwd)

vsr.DataSource.ConnectionString = strConn


CustomDataSourceObjects - C#

C#

// get custom data source object

IC1ReportRecordset rs = (IC1ReportRecordset)GetMyCustomDataSource();

// load report definition (before setting the data source)

c1r1.Load(reportFile, reportName);

// use custom data source object in c1r1 component

c1r1.DataSource.Recordset = rs;


CustomDataSourceObjects - Delphi

Delphi

var

reportFile: String; // defined elsewhere

reportName: String; // defined elsewhere

rs: IC1ReportRecordset;

begin

// get custom data source object

rs := GetMyCustomDataSource() as IC1ReportRecordset;

// load report definition (before setting the data source)

c1r1.Load(reportFile, reportName);

// use custom data source object in c1r1 component

c1r1.DataSource.Recordset := rs;

end;


CustomDataSourceObjects - Visual Basic

Visual Basic

' get custom data source object

Dim rs As IC1ReportRecordset = CType(GetMyCustomDataSource(), IC1ReportRecordset)

' load report definition (before setting the data source)

c1r1.Load(reportFile, reportName)

' use custom data source object in c1r1 component

c1r1.DataSource.Recordset = rs


CustomDataSources - C#

C#

private void CreateReport(string strSelect, string strConn)

{

// fill a DataSet object

OleDbDataAdapter da;

da = new OleDbDataAdapter(strSelect, strConn);

DataSet DataSet ds = new DataSet();

da.Fill(ds);

// get the DataTable object

DataTable dt = ds.Tables[0];

// load report

c1r.Load "RepDef.xml", "My Report";

// render report

c1r.DataSource.Recordset = ds.Tables[0];

c1ppv.Document = c1r.Document;

}


CustomDataSources - Delphi

Delphi

procedure Class1.CreateReport(strSelect: string; strConn: string);

var

dt: DataTable;

DataSet: DataSet;

da: OleDbDataAdapter;

begin

// fill a DataSet object

da := OleDbDataAdapter.Create(strSelect, strConn);

ds := DataSet.Create;

da.Fill(ds);

// get the DataTable object

dt := ds.Tables[0];

// load report

c1r.Load(

'RepDef.xml',

'My Report');

// render report

c1r.DataSource.Recordset := ds.Tables[0);

c1ppv.Document := c1r.Document;

end;


CustomDataSources - Visual Basic

Visual Basic

Private Sub CreateReport(strSelect As String, _

strConn As String)

' fill a DataSet object

Dim da As OleDbDataAdapter

da = new OleDbDataAdapter(strSelect, strConn)

Dim ds As DataSet = new DataSet()

da.Fill(ds)

' get the DataTable object

Dim dt As DataTable = ds.Tables(0)

' load report

c1r.Load "RepDef.xml", "My Report"

' render report

c1r.DataSource.Recordset = ds.Tables(0)

c1ppv.Document = c1r.Document

End Sub


CustomPaperSize - C#

C#

c1r1.Layout.PaperSize = PaperKind.Custom;

c1r1.Layout.CustomHeight = 25 * 1440; // in twips

c1r1.Layout.CustomWidth = 11 * 1440;


CustomPaperSize - Delphi

Delphi

c1r1.Layout.PaperSize := PaperKind.Custom;

c1r1.Layout.CustomHeight := 25 * 1440 // in twips

c1r1.Layout.CustomWidth := 11 * 1440;


CustomPaperSize - Visual Basic

Visual Basic

c1r1.Layout.PaperSize = PaperKind.Custom

c1r1.Layout.CustomHeight = 25 * 1440 ' in twips

c1r1.Layout.CustomWidth = 11 * 1440


CustReports1 - C#

C#

using C1.Win.C1Report;

Section detail = c1r.Sections[SectionTypeEnum.Detail];

foreach (Field f in detail.Fields)

f.Font.Name = "Arial Narrow";


CustReports1 - Delphi

Delphi

Imports C1.Win.C1Report;

…;

strDetailFont := 'Arial Narrow';

with c1r.Sections[SectionTypeEnum.Detail].Fields do

begin

for i = 0 to Count – 1 do

begin

Item[i].Font.Name := strDetailFont;

end;

end;

detail := c1r.Sections[SectionTypeEnum.Detail];

for i := 0 to detail.Fields.Count - 1 do

detail.Fields[i].Font.Name := 'Arial Narrow';


CustReports1 - Visual Basic

Visual Basic

Imports C1.Win.C1Report

…

Dim i%, strDetailFont$

strDetailFont = "Arial Narrow"

With c1r.Sections(SectionTypeEnum.Detail).Fields

For i = 0 To .Count – 1

.Item(i).Font.Name = strDetailFont

Next

End With

Dim detail As Section = c1r.Sections(SectionTypeEnum.Detail)

Dim f As Field

For Each f In detail.Fields

f.Font.Name = "Arial Narrow"

Next


CustReports2 - C#

C#

bool bShowGroup;

bShowGroup = true;

With c1r.Groups(0);

if ( bShowGroup ) {

.SectionHeader.Visible = true;

.SectionFooter.Visible = true;

.Sort = SortEnum.Ascending;

} else {

.SectionHeader.Visible = false;

.SectionFooter.Visible = false;

.Sort = SortEnum.NoSort;

}

} With


CustReports2 - Delphi

Delphi

bShowGroup := True;

with c1r.Groups[0] do

begin

if bShowGroup then

begin

SectionHeader.Visible := True;

SectionFooter.Visible := True;

Sort := SortEnum.Ascending;

end

else

begin

SectionHeader.Visible := False;

SectionFooter.Visible := False;

Sort := SortEnum.NoSort;

end;

end;


CustReports2 - Visual Basic

Visual Basic

Dim bShowGroup As Boolean

bShowGroup = True

With c1r.Groups(0)

If bShowGroup Then

.SectionHeader.Visible = True

.SectionFooter.Visible = True

.Sort = SortEnum.Ascending

Else

.SectionHeader.Visible = False

.SectionFooter.Visible = False

.Sort = SortEnum.NoSort

End If

End With


DataTableAsDataSource - C#

C#

// load DataTable from cache or from a secure/custom provider

DataTable dt = GetMyDataTable();

// load report definition (before setting the data source)

c1r1.Load(reportFile, reportName);

// use DataTable as the data source for the c1r1 component

c1r1.DataSource.Recordset = dt;


DataTableAsDataSource - Delphi

Delphi

var

reportFile: String; // defined elsewhere

reportName: String; // defined elsewhere

dt: DataTable;

begin

// load DataTable from cache or from a secure/custom provider;

dt := GetMyDataTable();

// load report definition (before setting the data source);

c1r1.Load(reportFile, reportName);

// use DataTable as the data source for the c1r1 component;

c1r1.DataSource.Recordset := dt;

end;


DataTableAsDataSource - Visual Basic

Visual Basic

' load DataTable from cache or from a secure/custom provider

Dim dt As DataTable = GetMyDataTable()

' load report definition (before setting the data source)

c1r1.Load(reportFile, reportName)

' use DataTable as the data source for the c1r1 component

c1r1.DataSource.Recordset = dt


DesignTime - C#

C#

private void btnProductsReport_Click()

{

ppv.Document = rptProducts.Document;

}


DesignTime - Delphi

Delphi

procedure Class1.btnProductsReport_Click;

begin

ppv.Document := rptProducts.Document;

end;


DesignTime - Visual Basic

Visual Basic

Private Sub btnProductsReport_Click()

ppv.Document = rptProducts.Document

End Sub


DocumentProperty - C#

C#

// print the report currently loaded

c1r.Document.Print();

// and show it in the preview control

c1ppv.Document = c1r.Document;


DocumentProperty - Delphi

Delphi

// print the report currently loaded

c1r.Document.Print;

// and show it in the preview control

c1ppv.Document := c1r.Document;


DocumentProperty - Visual Basic

Visual Basic

' print the report currently loaded

c1r.Document.Print()

' and show it in the preview control

c1ppv.Document = c1r.Document


DoEventsProperty - C#

C#

private void Render_Click()

{

if ( c1r.IsBusy ) {

Console.WriteLine("Can't render now, object is busy");

} else {

ppv.Document = c1r.Document;

}

}

private void Cancel_Click() {

if ( c1r.IsBusy ) {

Console.WriteLine("Cancelling Report");

c1r.Cancel = true;

} else {

Console.WriteLine("No report to cancel");

}

}


DoEventsProperty - Delphi

Delphi

procedure Render_Click;

begin

if c1r.IsBusy then

Console.WriteLine('Can't render now, object is busy')

else

ppv.Document := c1r.Document;

end;

procedure Cancel_Click;

begin

if c1r.IsBusy then

begin

Console.WriteLine('Cancelling Report');

c1r.Cancel := True;

end

else

Console.WriteLine('No report to cancel');

end;


DoEventsProperty - Visual Basic

Visual Basic

Private Sub Render_Click()

If c1r.IsBusy Then

Console.WriteLine("Can't render now, object is busy")

Else

ppv.Document = c1r.Document

End If

End Sub

Private Sub Cancel_Click()

If c1r.IsBusy Then

Console.WriteLine("Cancelling Report")

c1r.Cancel = True

Else

Console.WriteLine("No report to cancel")

End If

End Sub


DynamicWebReports1 - C#

C#

// handle user clicks

private void _btnHTML_Click(object sender, System.EventArgs e)

{

RenderReport(FileFormatEnum.HTMLDrillDown);

}

private void _btnPDF_Click(object sender, System.EventArgs e)

{

RenderReport(FileFormatEnum.PDF);

}


DynamicWebReports1 - Delphi

Delphi

// handle user clicks

procedure Class1._btnHTML_Click(sender: System.Object; e: System.EventArgs);

begin

RenderReport(FileFormatEnum.HTMLDrillDown);

end;

procedure Class1._btnPDF_Click(sender: System.Object; e: System.EventArgs);

begin

RenderReport(FileFormatEnum.PDF);

end;


DynamicWebReports1 - Visual Basic

Visual Basic

' handle user clicks

Private Sub _btnHTML_Click(ByVal sender As Object, ByVal e As System.EventArgs)

RenderReport(FileFormatEnum.HTMLDrillDown)

End Sub

Private Sub _btnPDF_Click(ByVal sender As Object, ByVal e As System.EventArgs)

RenderReport(FileFormatEnum.PDF)

End Sub


DynamicWebReports2 - C#

C#

// render the report

private void RenderReport(FileFormatEnum fmt)

{

// build file names

string rpt = "Employee Sales by Country";

string fileIn = GetDataPath() + "NWind.xml";

string ext = (fmt == FileFormatEnum.PDF)? ".pdf": ".htm";

string fileOut = GetOutputPath() + rpt + ext;

try

{

// create C1Report component

C1Report c1r = new C1Report();

// load the report

c1r.Load(fileIn, rpt);

// get user parameters

string year = _lstYear.SelectedItem.Text;

string goal = _txtGoal.Text;

// customize the report data source

string sSQL = "SELECT DISTINCTROW " +

"Employees.Country, Employees.LastName, " +

"Employees.FirstName, Orders.ShippedDate, Orders.OrderID, " +

" [Order Subtotals].Subtotal AS SaleAmount " +

"FROM Employees INNER JOIN (Orders INNER JOIN " +

" [Order Subtotals] ON Orders.OrderID = " +

" [Order Subtotals].OrderID) " +

" ON Employees.EmployeeID = Orders.EmployeeID " +

"WHERE Year(Orders.ShippedDate) = " + year + ";";

c1r.DataSource.RecordSource = sSQL;

// customize the report's event handlers

string sScript =

"If SalespersonTotal > " + goal + " Then \n" +

" ExceededGoalLabel.Visible = True\n" +

" SalespersonLine.Visible = True\n" +

"Else\n" +

" ExceededGoalLabel.Visible = False\n" +

" SalespersonLine.Visible = False\n" +

"End If";

c1r.Sections[SectionTypeEnum.GroupHeader2].OnPrint = sScript;

// render the report into a temporary file

c1r.RenderToFile(fileOut, fmt);

// redirect user to report file

Response.Redirect("Temp/" + rpt + ext);

}

catch (Exception x)

{

_lblStatus.Text = "*** " + x.Message;

}

}


DynamicWebReports2 - Delphi

Delphi

procedure RenderReport(fmt: FileFormatEnum);

var

rpt: String;

fileIn: String;

ext: String;

fileOut: String;

c1r: C1Report;

year: String;

goal: String;

sSQL: String;

sScript: String;

begin

c1r := C1Report.Create;

// build file names

rpt := 'Employee Sales by Country';

fileIn := GetDataPath +'NWind.xml';

if fmt = FileFormatEnum.PDF then

ext := '.pdf'

else

ext := '.htm';

fileOut := GetOutputPath + rpt + ext;

try

// create C1Report component

// load the report

c1r.Load(fileIn, rpt);

// get user parameters

year := _lstYear.SelectedItem.Text;

goal := _txtGoal.Text;

// customize the report data source

c1r.DataSource.RecordSource := sSQL;

// customize the report' s event handlers

sScript := 'If SalespersonTotal > '+ goal +' Then'#13#10'

ExceededGoalLabel.Visible = True'#13#10' SalespersonLine.Visible =

True'#13#10'Else'#13#10

+' ExceededGoalLabel.Visible = False'#13#10' SalespersonLine.Visible =

False'#13#10'End If';

c1r.Sections(SectionTypeEnum.GroupHeader2).OnPrint := sScript;

// render the report into a temporary file

c1r.RenderToFile(fileOut, fmt);

// redirect user to report file

Response.Redirect('Temp/'+ rpt + ext);

except

on x: Exception do

_lblStatus.Text := '*** '+ x.Message;

end;

end;


DynamicWebReports2 - Visual Basic

Visual Basic

Private Sub RenderReport(ByVal fmt As FileFormatEnum)

' build file names

Dim rpt As String = "Employee Sales by Country"

Dim fileIn As String = GetDataPath() & "NWind.xml"

Dim ext As String = IIf(fmt = FileFormatEnum.PDF, ".pdf", ".htm")

Dim fileOut As String = GetOutputPath() & rpt & ext

Try

' create C1Report component

Dim c1r As New C1Report()

' load the report

c1r.Load(fileIn, rpt)

' get user parameters

Dim year As String = _lstYear.SelectedItem.Text

Dim goal As String = _txtGoal.Text

' customize the report data source

Dim sSQL As String = "SELECT DISTINCTROW " & _

"Employees.Country, Employees.LastName, " & _

"Employees.FirstName, Orders.ShippedDate, Orders.OrderID, " & _

" [Order Subtotals].Subtotal AS SaleAmount " & _

"FROM Employees INNER JOIN (Orders INNER JOIN " & _

" [Order Subtotals] ON Orders.OrderID = " & _

" [Order Subtotals].OrderID) " & _

" ON Employees.EmployeeID = Orders.EmployeeID " & _

"WHERE Year(Orders.ShippedDate) = " & year & ";"

c1r.DataSource.RecordSource = sSQL

' customize the report's event handlers

Dim sScript As String = _

"If SalespersonTotal > " & goal & " Then" & vbCrLf & _

" ExceededGoalLabel.Visible = True" & vbCrLf & _

" SalespersonLine.Visible = True" & vbCrLf & _

"Else" & vbCrLf & _

" ExceededGoalLabel.Visible = False" & vbCrLf & _

" SalespersonLine.Visible = False" & vbCrLf & _

"End If"

c1r.Sections(SectionTypeEnum.GroupHeader2).OnPrint = sScript

' render the report into a temporary file

c1r.RenderToFile(fileOut, fmt)

' redirect user to report file

Response.Redirect("Temp/" + rpt + ext)

Catch x As Exception

_lblStatus.Text = "*** " & x.Message

End Try

End Sub


DynamicWebReports3 - C#

C#

// get directories to use for loading and saving files

private string GetDataPath()

{

return Request.PhysicalApplicationPath + @"Data\";

}

private string GetOutputPath()

{

return Request.PhysicalApplicationPath + @"Temp\";

}


DynamicWebReports3 - Delphi

Delphi

// get directories to use for loading and saving files

function Class1.GetDataPath: string;

begin

Result := (Request.PhysicalApplicationPath + 'Data\');

end;

function Class1.GetOutputPath: string;

begin

Result := (Request.PhysicalApplicationPath + 'Temp\');

end;


DynamicWebReports3 - Visual Basic

Visual Basic

' get directories to use for loading and saving files

Private Function GetDataPath() As String

Return Request.PhysicalApplicationPath + "Data\"

End Function

Private Function GetOutputPath() As String

Return Request.PhysicalApplicationPath + "Temp\"

End Function


EmployeeSalesByCountry - C#

C#

if ( SalespersonTotal > 5000 ) {

ExceededGoalLabel.Visible = true;

SalespersonLine.Visible = true;

} else {

ExceededGoalLabel.Visible = false;

SalespersonLine.Visible = false;

}


EmployeeSalesByCountry - Delphi

Delphi

begin

if (SalespersonTotal > 5000) then

begin

ExceededGoalLabel.Visible := True;

SalespersonLine.Visible := True;

end

else

begin

ExceededGoalLabel.Visible := False;

SalespersonLine.Visible := False;

end;

end;


EmployeeSalesByCountry - Visual Basic

Visual Basic

If SalespersonTotal > 5000 Then

ExceededGoalLabel.Visible = True

SalespersonLine.Visible = True

Else

ExceededGoalLabel.Visible = False

SalespersonLine.Visible = False

End If


ExecuteMethod - C#

C#

c1r.Execute("Line106.Left = Line106.Left + 1440");


ExecuteMethod - Delphi

Delphi

begin

c1r.Execute('Line106.Left = Line106.Left + 1440');

end;


ExecuteMethod - Visual Basic

Visual Basic

c1r.Execute("Line106.Left = Line106.Left + 1440")


ExportReport - C#

C#

// load report definition

c1r1.Load(reportFile, reportName);

// export to Pdf

c1r1.RenderToFile(outFile + ".pdf", FileFormatEnum.PDF);

c1r1.RenderToFile(outFile + ".xls", FileFormatEnum.Excel);


ExportReport - Delphi

Delphi

// load report definition

c1r1.Load(reportFile, reportName);

// export to Pdf

c1r1.RenderToFile(outFile +'.pdf', FileFormatEnum.PDF);

c1r1.RenderToFile(outFile +'.xls', FileFormatEnum.Excel);


ExportReport - Visual Basic

Visual Basic

' load report definition

c1r1.Load(reportFile, reportName)

' export to Pdf

c1r1.RenderToFile(outFile + ".pdf", FileFormatEnum.PDF)

c1r1.RenderToFile(outFile + ".xls", FileFormatEnum.Excel)


FieldDimensions1 - C#

C#

SaleAmountMaxFld.Text = "Max([SaleAmount])";


FieldDimensions1 - Delphi

Delphi

begin

SaleAmountMaxFld.Text := 'Max([SaleAmount])';

end;


FieldDimensions1 - Visual Basic

Visual Basic

SaleAmountMaxFld.Text = "Max([SaleAmount])"


FieldDimensions2 - C#

C#

c1r.Sections("Detail").OnPrint = +

"BarFld.Width = SaleAmountMaxFld.Width * " +

"(SaleAmountFld / SaleAmountMaxFld)";


FieldDimensions2 - Delphi

Delphi

c1r.Sections['Detail'].OnPrint := 'BarFld.Width = SaleAmountMaxFld.Width * (SaleAmountFld / SaleAmountMaxFld)';


FieldDimensions2 - Visual Basic

Visual Basic

c1r.Sections("Detail").OnPrint = & _

"BarFld.Width = SaleAmountMaxFld.Width * " & _

"(SaleAmountFld / SaleAmountMaxFld)"


FieldsProperty(C1Report) - C#

C#

c1r.Fields.Add("new Field", "Hello", 0, 0, 1000, 300);

c1r.Fields("new Field").Section = Detail;


FieldsProperty(C1Report) - Delphi

Delphi

c1r.Fields.Add('new Field', 'Hello', 0, 0, 1000, 300);

c1r.Fields['new Field'].Section := Detail;


FieldsProperty(C1Report) - Visual Basic

Visual Basic

c1r.Fields.Add("New Field", "Hello", 0, 0, 1000, 300)

c1r.Fields("New Field").Section = Detail


FieldsProperty(Section) - C#

C#

FieldCollection flds;

flds = c1r.Sections(SectionTypeEnum.Detail).Fields;

flds.Add("LblFirstName", "Contact", 3500, 100, 1900, 300);


FieldsProperty(Section) - Delphi

Delphi

var

flds: FieldCollection;

begin

flds := c1r.Sections[SectionTypeEnum.Detail].Fields;

flds.Add('LblFirstName', 'Contact', 3500, 100, 1900, 300);

end;


FieldsProperty(Section) - Visual Basic

Visual Basic

Dim flds As FieldCollection

flds = c1r.Sections(SectionTypeEnum.Detail).Fields

flds.Add("LblFirstName", "Contact", 3500, 100, 1900, 300)


FilterProperty1 - C#

C#

c1r.Load(strReportFile, "Sales Report");

c1r.DataSource.Filter = "ShippedDate >= #1/1/1995# " +

"AND " +

"ShippedDate <= #1/1/1996#";

ppv1.Document = c1r.Document;


FilterProperty1 - Delphi

Delphi

c1r.Load(strReportFile, 'Sales Report');

c1r.DataSource.Filter := 'ShippedDate >= #1/1/1995# ' +

'AND ' +

'ShippedDate <= #1/1/1996#';

ppv1.Document := c1r.Document;


FilterProperty1 - Visual Basic

Visual Basic

c1r.Load(strReportFile, "Sales Report")

c1r.DataSource.Filter = "ShippedDate >= #1/1/1995# " & _

"AND " & _

"ShippedDate <= #1/1/1996#"

ppv1.Document = c1r.Document


FilterProperty2 - C#

C#

c1r.DataSource.Filter =

"PARAMETERS [Country Filter] string 'USA';"+

"Country = [Country Filter]";

c1r.DataSource.Recordset = myTable;


FilterProperty2 - Delphi

Delphi

c1r.DataSource.Filter :='PARAMETERS [Country Filter] string 'USA';' +;

'Country = [Country Filter]';

c1r.DataSource.Recordset := myTable;


FilterProperty2 - Visual Basic

Visual Basic

c1r.DataSource.Filter = "PARAMETERS [Country Filter] string 'USA';" +

"Country = [Country Filter]"

c1r.DataSource.Recordset = myTable


FilterProperty3 - C#

C#

c1r.DataSource.Filter =

"PARAMETERS [Country Filter] string 'USA' 'UK|USA';" +

"Country = [Country Filter]";


FilterProperty3 - Delphi

Delphi

c1r.DataSource.Filter :='PARAMETERS [Country Filter] string 'USA' 'UK|USA';' + 'Country := [Country Filter]';


FilterProperty3 - Visual Basic

Visual Basic

c1r.DataSource.Filter = "PARAMETERS [Country Filter] string 'USA' 'UK|USA';" + "Country = [Country Filter]"


FontProperty(C1Report)1 - C#

C#

c1r.Font.Name = "Arial";

c1r.Font.Size = 9;

c1r.Fields.Add("New1", "Hello", 0, 0, 1000, 300);

c1r.Fields.Add("New2", "World", 1000, 0, 1000, 300);

c1r.Font.Name = "Tahoma";

c1r.Font.Size = 12;

c1r.Fields.Add("New3", "Hello", 0, 3000, 1000, 300);

c1r.Fields.Add("New4", "World", 1000, 3000, 1000, 300);


FontProperty(C1Report)1 - Delphi

Delphi

begin

c1r.Font.Name := 'Arial';

c1r.Font.Size := 9;

c1r.Fields.Add('New1', 'Hello', 0, 0, 1000, 300);

c1r.Fields.Add('New2', 'World', 1000, 0, 1000, 300);

c1r.Font.Name := 'Tahoma';

c1r.Font.Size := 12;

c1r.Fields.Add('New3', 'Hello', 0, 3000, 1000, 300);

c1r.Fields.Add('New4', 'World', 1000, 3000, 1000, 300);

end;


FontProperty(C1Report)1 - Visual Basic

Visual Basic

c1r.Font.Name = "Arial"

c1r.Font.Size = 9

c1r.Fields.Add("New1", "Hello", 0, 0, 1000, 300)

c1r.Fields.Add("New2", "World", 1000, 0, 1000, 300)

c1r.Font.Name = "Tahoma"

c1r.Font.Size = 12

c1r.Fields.Add("New3", "Hello", 0, 3000, 1000, 300)

c1r.Fields.Add("New4", "World", 1000, 3000, 1000, 300)


FontProperty(C1Report)2 - Visual Basic

Visual Basic

c1r.Fields ("New1").Font.Size = 24


ForeColorProperty - C#

C#

strOnPrint$;

strOnPrint = _

"if ( UnitsInStock < ReorderLevel ) { \r\n" +

" UnitsInStock.ForeColor = vbRed \r\n" +

"} else {\r\n" +

" UnitsInStock.ForeColor = vbBlack\r\n" +

"}";

c1r.Sections(SectionTypeEnum.Detail).OnPrint = strOnPrint;


ForeColorProperty - Delphi

Delphi

var

strOnPrint: string;

begin

strOnPrint := 'If UnitsInStock < ReorderLevel Then '#13#10 +

' UnitsInStock.ForeColor = vbRed '#13#10 +

'Else'#13#10 +

' UnitsInStock.ForeColor = vbBlack'#13#10 +

'End If';

c1r.Sections[SectionTypeEnum.Detail].OnPrint := strOnPrint;

end;


ForeColorProperty - Visual Basic

Visual Basic

Dim strOnPrint$

strOnPrint = _

"If UnitsInStock < ReorderLevel Then " & vbCrLf & _

" UnitsInStock.ForeColor = vbRed " & vbCrLf & _

"Else" & vbCrLf & _

" UnitsInStock.ForeColor = vbBlack" & vbCrLf _

"End If"

c1r.Sections(SectionTypeEnum.Detail).OnPrint = strOnPrint


FormatField1 - C#

C#

string script =

"if ( UnitsInStock < ReorderLevel ) {\r\n" +

" ProductNameCtl.ForeColor = RGB(255,0,0)\r\n" +

" ProductNameCtl.Font.Bold = true\r\n" +

"} else {\r\n" +

" ProductNameCtl.ForeColor = RGB(0,0,0)\r\n" +

" ProductNameCtl.Font.Bold = false\r\n" +

"}";

c1r.Sections("Detail").OnPrint = script;


FormatField1 - Delphi

Delphi

script := 'If UnitsInStock < ReorderLevel Then'#13#10' ProductNameCtl.ForeColor = RGB(255,0,0)'#13#10' ProductNameCtl.Font.Bold = True'#13#10'Else'#13#10+

' ProductNameCtl.ForeColor = RGB(0,0,0)'#13#10' ProductNameCtl.Font.Bold = False'#13#10'End If';

c1r.Sections['Detail'].OnPrint := script;


FormatField1 - Visual Basic

Visual Basic

Dim script As String = _

"If UnitsInStock < ReorderLevel Then" & vbCrLf & _

" ProductNameCtl.ForeColor = RGB(255,0,0)" & vbCrLf & _

" ProductNameCtl.Font.Bold = True" & vbCrLf & _

"Else" & vbCrLf & _

" ProductNameCtl.ForeColor = RGB(0,0,0)" & vbCrLf & _

" ProductNameCtl.Font.Bold = False" & vbCrLf & _

"End If"

c1r.Sections("Detail").OnPrint = script


FormatField2 - C#

C#

string script =

"if ( UnitsInStock < ReorderLevel ) {\r\n" +

" ProductNameCtl.ForeColor = RGB(255,0,0)\r\n" +

" ProductNameCtl.Font.Bold = true\r\n" +

" BoxCtl.Visible = false\r\n" +

"} else {\r\n" +

" ProductNameCtl.ForeColor = RGB(0,0,0)\r\n" +

" ProductNameCtl.Font.Bold = false\r\n" +

" BoxCtl.Visible = true\r\n" +

"}";

c1r.Sections("Detail").OnPrint = script;


FormatField2 - Delphi

Delphi

script := 'If UnitsInStock < ReorderLevel Then'#13#10 +

' ProductNameCtl.ForeColor = RGB(255,0,0)'#13#10 +

' ProductNameCtl.Font.Bold = True'#13#10 +

' BoxCtl.Visible = False'#13#10 +

'Else'#13#10' ProductNameCtl.ForeColor = RGB(0,0,0)'#13#10 +

' ProductNameCtl.Font.Bold = False'#13#10' BoxCtl.Visible = True'#13#10'End If';

c1r.Sections['Detail'].OnPrint := script;


FormatField2 - Visual Basic

Visual Basic

Dim script As String = _

"If UnitsInStock < ReorderLevel Then" & vbCrLf & _

" ProductNameCtl.ForeColor = RGB(255,0,0)" & vbCrLf & _

" ProductNameCtl.Font.Bold = True" & vbCrLf & _

" BoxCtl.Visible = False" & vbCrLf & _

"Else" & vbCrLf & _

" ProductNameCtl.ForeColor = RGB(0,0,0)" & vbCrLf & _

" ProductNameCtl.Font.Bold = False" & vbCrLf & _

" BoxCtl.Visible = True" & vbCrLf & _

"End If"

c1r.Sections("Detail").OnPrint = script


FormatProperty - C#

C#

theField.Text = "DatePart(HiredDate, ""q"")";

theField.Calculated = true;


FormatProperty - Delphi

Delphi

theField.Text := 'DatePart(HiredDate, "q")';

theField.Calculated := True;


FormatProperty - Visual Basic

Visual Basic

theField.Text = "DatePart(HiredDate, ""q"")"

theField.Calculated = True


GetReportInfoMethod - C#

C#

// get application path

string path = Application.StartupPath;

int i = path.IndexOf("\bin");

if ( i > -1 ) { path = path.Substring(0, i)

path = path + "@\";

// get names of reports in the report definition file

m_File = appPath + DataFileName;

string[] reports = c1r.GetReportInfo(m_File);

// populate list box

cmbReport.Items.Clear();

foreach (string report In reports

cmbReport.Items.Add(report);

}


GetReportInfoMethod - Delphi

Delphi

var

reports: array of string;

path: string;

i: Integer;

begin

// get application path

path := Application.StartupPath;

i := path.IndexOf('\bin');

if i > -1 Then path = path.Substring(0, i);

path := path +'\';

// get names of reports in the report definition file

m_File := appPath + DataFileName;

reports := c1r.GetReportInfo(m_File);

// populate list box

cmbReport.Items.Clear;

for i := 0 to High(reports) do

cmbReport.Items.Add(reports[i]);

end;


GetReportInfoMethod - Visual Basic

Visual Basic

' get application path

Dim path As String = Application.StartupPath

Dim i As Integer = path.IndexOf("\bin")

If i > -1 Then path = path.Substring(0, i)

path = path & "\"

' get names of reports in the report definition file

m_File = appPath & DataFileName

Dim reports As String() = c1r.GetReportInfo(m_File)

' populate list box

cmbReport.Items.Clear()

Dim report As String

For Each report In reports

cmbReport.Items.Add(report)

Next


GroupByProperty1 - C#

C#

c1r.Groups[0].GroupBy = "CategoryName";

c1r.Groups[0].Sort = SortEnum.Ascending;

c1r.Groups[1].GroupBy = "ProductName";

c1r.Groups[1].Sort = SortEnum.Ascending;


GroupByProperty1 - Delphi

Delphi

begin

c1r.Groups[0].GroupBy := 'CategoryName';

c1r.Groups[0].Sort := SortEnum.Ascending;

c1r.Groups[1].GroupBy := 'ProductName';

c1r.Groups[1].Sort := SortEnum.Ascending;

end;


GroupByProperty1 - Visual Basic

Visual Basic

c1r.Groups(0).GroupBy = "CategoryName"

c1r.Groups(0).Sort = SortEnum.Ascending

c1r.Groups(1).GroupBy = "ProductName"

c1r.Groups(1).Sort = SortEnum.Ascending


GroupByProperty2 - C#

C#

c1r.Groups[0].GroupBy = "Left ([ProductName],1)";

c1r.Groups[1].GroupBy = "DatePart([ShippedDate],//q//)";


GroupByProperty2 - Delphi

Delphi

begin

c1r.Groups[0].GroupBy := 'Left ([ProductName],1)';

c1r.Groups[1].GroupBy := 'DatePart([ShippedDate],"q")';

end;


GroupByProperty2 - Visual Basic

Visual Basic

c1r.Groups(0).GroupBy = "Left ([ProductName],1)"

c1r.Groups(1).GroupBy = "DatePart([ShippedDate],'q')"


GroupSortUsingCode1 - C#

C#

if ( chkGroup.Checked )

{

// group employees by country, in ascending order

Group grp;

grp = c1r.Groups.Add("GrpCountry", "Country", SortEnum.Ascending);

// format the header section for the new group

With grp.SectionHeader;

.Height = 500;

.Visible = true;

f = .Fields.Add("CtlCountry", "Country", 0, 0, c1r.Layout.Width, 500);

f.Calculated = true;

f.Align = FieldAlignEnum.LeftMiddle;

f.Font.Bold = true;

f.Font.Size = 12;

f.BorderStyle = BorderStyleEnum.Solid;

f.BorderColor = Color.FromArgb(0, 0, 150);

f.BackStyle = BackStyleEnum.Opaque;

f.BackColor = Color.FromArgb(150, 150, 220);

f.MarginLeft = 100;

} With

// sort employees by first name within each country

c1r.Groups.Add("GrpName", "FirstName", SortEnum.Ascending);

}


GroupSortUsingCode1 - Delphi

Delphi

var

grp: Group;

begin

if chkGroup.Checked then

begin

// group employees by country, in ascending order

grp := c1r.Groups.Add('GrpCountry','Country', SortEnum.Ascending);

// format the header section for the new group

with grp.SectionHeader do

begin

Height := 500;

Visible := True;

f := Fields.Add('CtlCountry','Country', 0, 0, c1r.Layout.Width, 500);

f.Calculated := True;

f.Align := FieldAlignEnum.LeftMiddle;

f.Font.Bold := True;

f.Font.Size := 12;

f.BorderStyle := BorderStyleEnum.Solid;

f.BorderColor := Color.FromArgb(0, 0, 150);

f.BackStyle := BackStyleEnum.Opaque;

f.BackColor := Color.FromArgb(150, 150, 220);

f.MarginLeft := 100;

end;

end;

// sort employees by first name within each country

c1r.Groups.Add('GrpName','FirstName', SortEnum.Ascending);

end;


GroupSortUsingCode1 - Visual Basic

Visual Basic

If chkGroup.Checked Then

' group employees by country, in ascending order

Dim grp As Group

grp = c1r.Groups.Add("GrpCountry", "Country", SortEnum.Ascending)

' format the header section for the new group

With grp.SectionHeader

.Height = 500

.Visible = True

f = .Fields.Add("CtlCountry", "Country", 0, 0, c1r.Layout.Width, 500)

f.Calculated = True

f.Align = FieldAlignEnum.LeftMiddle

f.Font.Bold = True

f.Font.Size = 12

f.BorderStyle = BorderStyleEnum.Solid

f.BorderColor = Color.FromArgb(0, 0, 150)

f.BackStyle = BackStyleEnum.Opaque

f.BackColor = Color.FromArgb(150, 150, 220)

f.MarginLeft = 100

End With

' sort employees by first name within each country

c1r.Groups.Add("GrpName", "FirstName", SortEnum.Ascending)

End If


GroupSortUsingCode2- C#

C#

// render the report into the PrintPreviewControl

ppv.Document = c1r.Document;


GroupSortUsingCode2- Delphi

Delphi

// render the report into the PrintPreviewControl

ppv.Document := c1r.Document;


GroupSortUsingCode2 Visual Basic

Visual Basic

' render the report into the PrintPreviewControl

ppv.Document = c1r.Document


HeightProperty(Section) - C#

C#

// get section object

Section s = c1.Sections[vsrDetail];

// scan all its fields

Field f;

foreach (f In s.Fields)

// get field bottom

double h = f.Top + f.Height;

// make sure section is tall enough for the field

if (h > s.Height)

s.Height = h + 200;

}


HeightProperty(Section) - Delphi

Delphi

var

s: Section;

f: Field;

i: Integer;

h: Double;

begin

// get section object

s := c1.Sections(vsrDetail);

// scan all its fields

for i := 0 to s.Fields.Count - 1 do

begin

f := s.Fields[i];

// get field bottom

h := f.Top + f.Height;

// make sure section is tall enough for the field

if h > s.Height then

s.Height := h + 200;

end;

end;


HeightProperty(Section) - Visual Basic

Visual Basic

' get section object

Dim s As Section = c1.Sections(vsrDetail)

' scan all its fields

Dim f As Field

For Each f In s.Fields

' get field bottom

Dim h As Double = f.Top + f.Height

' make sure section is tall enough for the field

If h > s.Height Then

s.Height = h + 200

End If

Next


IsBusyProperty - C#

C#

// prevent reentrant calls

if ( c1r.IsBusy ) return;


IsBusyProperty - Delphi

Delphi

// prevent reentrant calls

begin

if c1r.IsBusy then

begin

Beep;

Exit;

end;

end;


IsBusyProperty - Visual Basic

Visual Basic

' prevent reentrant calls

If c1r.IsBusy Then Beep() : Exit Sub


LinkTargetProperty - C#

C#

// set up a static link

Field f = c1r.Fields["companyInfoLink"];

f.Calculated = false;

f.Text = "click here for more info on our company";

f.LinkTarget = "http://myrealty.com";

// set up a databound link

Field f = c1r.Fields["propertyInfoLink"];

f.Calculated = false;

f.Text = "click here for more info on this property";

f.LinkTarget = "\"http://myrealty.com/moreinfo?id=\" & propertyID";


LinkTargetProperty - Delphi

Delphi

var

f: Field;

begin

// set up a static link

f := c1r.Fields['companyInfoLink'];

f.Calculated := False;

f.Text := 'click here for more info on our company';

f.LinkTarget := 'http://myrealty.com';

// set up a databound link

f := c1r.Fields['propertyInfoLink'];

f.Calculated := False;

f.Text := 'click here for more info on this property';

f.LinkTarget := '"http:; // myrealty.com/moreinfo?id=" & propertyID';

end;


LinkTargetProperty - Visual Basic

Visual Basic

' set up a static link

Dim f As Field = c1r.Fields("companyInfoLink")

f.Calculated = False

f.Text = "click here for more info on our company"

f.LinkTarget = "http://myrealty.com"

' set up a databound link

Dim f As Field = c1r.Fields("propertyInfoLink")

f.Calculated = False

f.Text = "click here for more info on this property"

f.LinkTarget = "\"http:'myrealty.com/moreinfo?id=\" & propertyID"


LoadMethod1 - C#

C#

// get a list of the reports available

// in the report definition file

string s = DataFileName;

string[]sList = c1r.GetReportInfo(s);

// populate list box

cmbReport.Clear;

foreach (string report in sList)

cmbReport.Itemst.Add(report);


LoadMethod1 - Delphi

Delphi

var

sList: array of string;

begin

// get a list of the reports available

// in the report definition file

sList := c1r.GetReportInfo(DataFileName);

// populate list box

cmbReport.Clear;

for i := 0 to High(sList) do

cmbReport.Itemst.Add(sList[i]);

end;


LoadMethod1 - Visual Basic

Visual Basic

' get a list of the reports available

' in the report definition file

Dim s As String = DataFileName

Dim sList As String() = c1r.GetReportInfo(s)

' populate list box

cmbReport.Clear

Dim report As String

For Each report in sList

cmbReport.Itemst.Add(report)

Next


LoadMethod2 - C#

C#

private void cmbReport_SelectedIndexChanged(_

System.object sender, System.EventArgs e)

cmbReport.SelectedIndexChanged;

{

try {

Cursor = Cursors.WaitCursor;

// load report

status.Text = "Loading " + cmbReport.Text;

c1r.Load(m_ReportDefinitionFile, cmbReport.Text);

// render into print preview control

status.Text = "Rendering " + cmbReport.Text;

ppv.Document = c1r.Document;

// give focus to print preview control

ppv.StartPage = 0;

ppv.Focus();

} finally {

Cursor = Cursors.Default;

}

}


LoadMethod2 - Delphi

Delphi

Include(Self.cmbReport.SelectedIndexChanged, Self.cmbReport_SelectedIndexChanged);

procedure cmbReport_SelectedIndexChanged(sender: System.Object; e: System.EventArgs);

begin

Cursor := Cursors.WaitCursor;

try

// load report

status.Text := 'Loading '+ cmbReport.Text;

c1r.Load(m_ReportDefinitionFile, cmbReport.Text);

// render into print preview control

status.Text := 'Rendering '+ cmbReport.Text;

ppv.Document := c1r.Document;

// give focus to print preview control

ppv.StartPage := 0;

ppv.Focus;

finally;

Cursor := Cursors.Default;

end;

end;


LoadMethod2 - Visual Basic

Visual Basic

Private Sub cmbReport_SelectedIndexChanged(_

ByVal sender As System.Object, ByVal e As System.EventArgs) _

Handles cmbReport.SelectedIndexChanged

Try

Cursor = Cursors.WaitCursor

' load report

status.Text = "Loading " & cmbReport.Text

c1r.Load(m_ReportDefinitionFile, cmbReport.Text)

' render into print preview control

status.Text = "Rendering " & cmbReport.Text

ppv.Document = c1r.Document

' give focus to print preview control

ppv.StartPage = 0

ppv.Focus()

Finally

Cursor = Cursors.Default

End Try

End Sub


LoadReportDefFromFile - C#

C#

// get list of reports in a report definition file

string[] reports = c1r1.GetReportInfo(reportFile);

// load first report into c1r1 component

c1r1.Load(reportFile, reports[0]);


LoadReportDefFromFile - Delphi

Delphi

var

reportFile: String; // defined elsewhere

reports: array of String;

begin

// get list of reports in a report definition file;

reports := c1r1.GetReportInfo(reportFile);

// load first report into c1r1 component;

c1r1.Load(reportFile, reports[0]);

end;


LoadReportDefFromFile - Visual Basic

Visual Basic

' get list of reports in a report definition file

Dim reports As String() = c1r1.GetReportInfo(reportFile)

' load first report into c1r1 component

c1r1.Load(reportFile, reports(0))


LoadReportDefFromString - C#

C#

// load report definition into c1r1 component

c1r1.Load(reportFile, reportName);

// copy report definition to the clipboard

string repDef = c1r1.ReportDefinition;

Clipboard.SetDataObject(repDef);

// copy report definition to c1r2 component

c1r2.ReportDefinition = repDef


LoadReportDefFromString - Delphi

Delphi

var

reportFile: String; // defined elsewhere

reportName: String; // defined elsewhere

repDef: String;

begin

// load report definition into c1r1 component;

c1r1.Load(reportFile, reportName);

// copy report definition to the clipboard;

repDef := c1r1.ReportDefinition;

Clipboard.SetDataObject(repDef);

// copy report definition to c1r2 component;

c1r2.ReportDefinition := repDef;

end;


LoadReportDefFromString - Visual Basic

Visual Basic

' load report definition into c1r1 component

c1r1.Load(reportFile, reportName)

' copy report definition to the clipboard

Dim repDef As String = c1r1.ReportDefinition

Clipboard.SetDataObject(repDef)

' copy report definition to c1r2 component

c1r2.ReportDefinition = repDef


NameProperty(Field)1 - C#

C#

c1r.Fields["FirstNameField"].Height = 1440;


NameProperty(Field)1 - Delphi

Delphi

c1r.Fields['FirstNameField'].Height := 1440;


NameProperty(Field)1 - Visual Basic

Visual Basic

c1r.Fields("FirstNameField").Height = 1440


NameProperty(Field)2 - C#

C#

c1r.Sections[SectionTypeEnum.Detail].OnPrint =

"FirstNameField.Height = 1440";


NameProperty(Field)2 - Delphi

Delphi

begin

c1r.Sections[SectionTypeEnum.Detail].OnPrint := 'FirstNameField.Height = 1440';

end;


NameProperty(Field)2 - Visual Basic

Visual Basic

c1r.Sections(SectionTypeEnum.Detail).OnPrint = _

"FirstNameField.Height = 1440"


NameProperty(Group) - C#

C#

c1r.Groups["Initial"].GroupBy = "Left([ProductName],1)";


NameProperty(Group) - Delphi

Delphi

begin

c1r.Groups['Initial'].GroupBy := 'Left([ProductName],1)';

end;


NameProperty(Group) - Visual Basic

Visual Basic

c1r.Groups ("Initial").GroupBy = "Left([ProductName],1)"


NameProperty(Section) - Delphi

Delphi

c1r.Sections['Detail'].Height := 1440;


NameProperty(Section) - Visual Basic

Visual Basic

c1r.Sections("Detail").Height = 1440


Namespaces1 - C#

C#

C1.Win.C1Report.C1Report c1rpt;


Namespaces1 - Delphi

Delphi

c1rpt: C1.Win.C1Report.C1Report;


Namespaces1 - Visual Basic

Visual Basic

Dim c1rpt As C1.Win.C1Report.C1Report


Namespaces2 - C#

C#

// Define a new Field object (custom Field class)

Field MyField;

// Define a new C1Report.Field object.

C1.Win.C1Report.Field ReportField;


Namespaces2 - Delphi

Delphi

// Define a new Field object (custom Field class)

MyField: Field;

// Define a new C1Report.Field object.

ReportField: C1.Win.C1Report.Field;


Namespaces2 - Visual Basic

Visual Basic

' Define a new Field object (custom Field class)

Dim MyField as Field

' Define a new C1Report.Field object.

Dim ReportField as C1.Win.C1Report.Field


Namespaces3 - C#

C#

using C1.Win.C1Report.Field C1Field;

using MyProject.Field MyField;

C1Field f1;

MyField f2;


Namespaces3 - Delphi

Delphi

uses C1.Win.C1Report.Field,

MyProject.Field;

var

f2: MyField;

f1: C1Field;


Namespaces3 - Visual Basic

Visual Basic

Imports C1Field = C1.Win.C1Report.Field

Imports MyField = MyProject.Field

Dim f1 As C1Field

Dim f2 As MyField


NoDataEvent - C#

C#

private void c1r_NoData( object sender, System.EventArgs e)

c1r.NoData

{

c1r.Cancel = true;

}


NoDataEvent - Delphi

Delphi

Include(Self.c1r.NoData, Self.c1r_NoData);

procedure c1r_NoData(sender: Object; e: System.EventArgs);

begin

c1r.Cancel := True;

end;


NoDataEvent - Visual Basic

Visual Basic

Private Sub c1r_NoData(ByVal sender As Object, _

ByVal e As System.EventArgs) Handles c1r.NoData

c1r.Cancel = True

End Sub


OnPrintProperty - C#

C#

string script;

script = "BarFld.Width = SaleAmountMaxFld.Width * " +

"(SaleAmountFld / SaleAmountMaxFld)";

c1r.Sections("Detail").OnPrint = script;


OnPrintProperty - Delphi

Delphi

script := 'BarFld.Width = SaleAmountMaxFld.Width * (SaleAmountFld / SaleAmountMaxFld)';

c1r.Sections['Detail'].OnPrint := script;


OnPrintProperty - Visual Basic

Visual Basic

Dim script As String

script = "BarFld.Width = SaleAmountMaxFld.Width * " & _

"(SaleAmountFld / SaleAmountMaxFld)"

c1r.Sections("Detail").OnPrint = script


PageProperty1 - C#

C#

With c1r.Sections(SectionTypeEnum.Footer);

f = .Fields.Add("FldFtrRight",

"""Page "" + Page + "" of "" + Pages", 4000, 0, 4000, 300);

f.Calculated = true;

} With


PageProperty1 - Delphi

Delphi

var

f: Field;

begin

with c1r.Sections[SectionTypeEnum.Footer] do

begin

f := Fields.Add('FldFtrRight','"Page " & Page & " of " & Pages', 4000, 0,

4000, 300);

f.Calculated := True;

end;

end;


PageProperty1 - Visual Basic

Visual Basic

With c1r.Sections(SectionTypeEnum.Footer)

f = .Fields.Add("FldFtrRight", _

"""Page "" & Page & "" of "" & Pages", _

4000, 0, 4000, 300)

f.Calculated = True

End With


PageProperty2 - C#

C#

// assign a VBScript handler to the PrintSection event

// of section "Group 0 Header"

c1r.Sections("Group 0 Header").OnPrint = "Page = 1";


PageProperty2 - Delphi

Delphi

// assign a VBScript handler to the PrintSection event

// of section "Group 0 Header"

c1r.Sections['Group 0 Header'].OnPrint := 'Page = 1';


PageProperty2 - Visual Basic

Visual Basic

' assign a VBScript handler to the PrintSection event

' of section "Group 0 Header"

c1r.Sections("Group 0 Header").OnPrint = "Page = 1"


PagesVariable - C#

C#

"Page " + Page + " of " + Pages;


PagesVariable - Delphi

Delphi

var

Pages: System.Object;

begin

'Page ' + Page.ToString + ' of ' + Pages.ToString;

end;


PagesVariable - Visual Basic

Visual Basic

"Page " & Page & " of " & Pages


PageVariable - C#

C#

if ( Country != LastCountry ) { Page = 1

LastCountry = Country;


PageVariable - Delphi

Delphi

var

LastCountry: System.Object;

begin

if (Country <> LastCountry) then

LastCountry := Country;

end;


PageVariable - Visual Basic

Visual Basic

If Country <> LastCountry Then Page = 1

LastCountry = Country


PictureProperty(Field)1 - C#

C#

theField.Picture = PictureBoxLogo.Image;

theField.Picture = "c:\mycorp\pictures\logo.gif";


PictureProperty(Field)1 - Delphi

Delphi

begin

theField.Picture := PictureBoxLogo.Image;

theField.Picture := 'c:\mycorp\pictures\logo.gif';

end;


PictureProperty(Field)1 - Visual Basic

Visual Basic

theField.Picture = PictureBoxLogo.Image

theField.Picture = "c:\mycorp\pictures\logo.gif"


PictureProperty(Field)2- C#

C#

c1r.DataSource.ConnectionString = "dsn=NorthWind";

c1r.DataSource.RecordSource = "Employees";

theField.Picture = "Photo";


PictureProperty(Field)2 - Delphi

Delphi

begin

c1r.DataSource.ConnectionString := 'dsn=NorthWind';

c1r.DataSource.RecordSource := 'Employees';

theField.Picture := 'Photo';

end;


PictureProperty(Field)2 - Visual Basic

Visual Basic

c1r.DataSource.ConnectionString = "dsn=NorthWind"

c1r.DataSource.RecordSource = "Employees"

theField.Picture = "Photo"


PreviewReports - C#

C#

// load report definition

c1r1.Load(reportFile, reportName);

// preview the document

c1preview1.Document = c1r1.Document;


PreviewReports - Delphi

Delphi

// load report definition

c1r1.Load(reportFile, reportName);

// preview the document

c1preview1.Document := c1r1.Document;


PreviewReports - Visual Basic

Visual Basic

' load report definition

c1r1.Load(reportFile, reportName)

' preview the document

c1preview1.Document = c1r1.Document


PrintReports - C#

C#

// load report definition

c1r1.Load(reportFile, reportName);

// get PrintDocument object

PrintDocument doc = c1r1.Document;

// show a PrintDialog so user can customize the printing

PrintDialog pd = new PrintDialog();

// use PrinterSettings in report document

pd.PrinterSettings = doc.PrinterSettings;

// show the dialog and print the report

if (pd.ShowDialog() == DialogResult.OK)

doc.Print();

// cleanup and release PrintDialog resources

pd.Dispose();


PrintReports - Delphi

Delphi

var

reportFile: String; // defined elsewhere

reportName: String; // defined elsewhere

doc: PrintDocument;

pd: PrintDialog;

begin

// load the report definition

c1r1.Load(reportFile, reportName);

// get PrintDocument object

doc := c1r1.Document;

// show a PrintDialog so user can customize the printing

pd := PrintDialog.Create();

// user PrinterSettings in report document

pd.PrinterSettings := doc.PrinterSettings;

// show the dialog and print the report

if (pd.ShowDialog() = DialogResult.OK) then

doc.Print();

// cleanup and release PrintDialog resources

pd.Dispose();

end;


PrintReports - Visual Basic

Visual Basic

' load report definition

c1r1.Load(reportFile, reportName);

' get PrintDocument object

PrintDocument doc = c1r1.Document;

' show a PrintDialog so user can customize the printing

Dim pd As PrintDialog = New PrintDialog()

' use PrinterSettings in report document

pd.PrinterSettings = doc.PrinterSettings;

' show the dialog and print the report

If pd.ShowDialog() = DialogResult.OK Then

doc.Print();

End If

' cleanup and release PrintDialog resources

pd.Dispose()


PrintSectionEvent - C#

C#

private void c1r_PrintSection( object sender,_

C1.Win.C1Report.ReportEventArgs e) c1r.PrintSection;

{

// get the field we want to render as a chart

Field f = c1r.Fields("SalesChart");

// make sure this is the section we want

if ( f.Section != e.Section ) return;

// create chart assign it to field

f.Picture = CreateChart();

}


PrintSectionEvent - Delphi

Delphi

Include(Self.c1r.PrintSection, Self.c1r_PrintSection);

procedure c1r_PrintSection(sender: System.Object; e: C1.Win.C1Report.ReportEventArgs);

var

f: Field;

begin

// get the field we want to render as a chart

f := c1r.Fields['SalesChart'];

// make sure this is the section we want

if f.Section <> e.Section then exit;

// create chart assign it to field

f.Picture := CreateChart;

end;


PrintSectionEvent - Visual Basic

Visual Basic

Private Sub c1r_PrintSection(ByVal sender As Object,_

ByVal e As C1.Win.C1Report.ReportEventArgs) _

Handles c1r.PrintSection

' get the field we want to render as a chart

Dim f As Field = c1r.Fields("SalesChart")

' make sure this is the section we want

If f.Section <> e.Section Then Exit Sub

' create chart assign it to field

f.Picture = CreateChart()

End Sub


PromptUsers1 - C#

C#

c1r.DataSource.RecordSource =

"PARAMETERS [Critical Stock Level] short 10;" +

c1r.DataSource.RecordSource;


PromptUsers1 - Delphi

Delphi

begin

c1r.DataSource.RecordSource := 'PARAMETERS [Critical Stock Level] short 10;'

+ c1r.DataSource.RecordSource;

end;


PromptUsers1 - Visual Basic

Visual Basic

c1r.DataSource.RecordSource = _

"PARAMETERS [Critical Stock Level] Short 10;" & _

c1r.DataSource.RecordSource


PromptUsers2 - C#

C#

string script =

"level = [Critical Stock Level]\r\n" +

"if ( UnitsInStock < level ) {\r\n" +

" ProductNameCtl.ForeColor = RGB(255,0,0)\r\n" +

" ProductNameCtl.Font.Bold = true\r\n" +

"} else {\r\n" +

" ProductNameCtl.ForeColor = RGB(0,0,0)\r\n" +

" ProductNameCtl.Font.Bold = false\r\n" +

"}";

c1r.Sections("Detail").OnPrint = script;


PromptUsers2 - Delphi

Delphi

script := 'level = [Critical Stock Level]'#13#10 +

'If UnitsInStock < level Then'#13#10 +

' ProductNameCtl.ForeColor = RGB(255,0,0)'#13#10 +

' ProductNameCtl.Font.Bold = True'#13#10 +

'Else'#13#10 +

' ProductNameCtl.ForeColor = RGB(0,0,0)'#13#10 +

' ProductNameCtl.Font.Bold = False'#13#10 +

'End If';

c1r.Sections['Detail'].OnPrint := script;


PromptUsers2 - Visual Basic

Visual Basic

Dim script As String = _

"level = [Critical Stock Level]" & vbCrLf & _

"If UnitsInStock < level Then" & vbCrLf & _

" ProductNameCtl.ForeColor = RGB(255,0,0)" & vbCrLf & _

" ProductNameCtl.Font.Bold = True" & vbCrLf & _

"Else" & vbCrLf & _

" ProductNameCtl.ForeColor = RGB(0,0,0)" & vbCrLf & _

" ProductNameCtl.Font.Bold = False" & vbCrLf & _

"End If"

c1r.Sections("Detail").OnPrint = script


RecordSetProperty - C#

C#

private void InitReport(string rs, string conn)

{

OleDbDataAdapter da;

da = new OleDbDataAdapter(rs, conn);

DataSet DataSet ds = new DataSet();

da.Fill(ds);

c1r.DataSource.Recordset = ds.Tables[0];

}


RecordSetProperty - Delphi

Delphi

procedure InitReport(rs: String; conn: String);

var

da: OleDbDataAdapter;

ds: DataSet;

begin

da := OleDbDataAdapter.Create(rs, conn);

ds := DataSet.Create;

da.Fill(ds);

c1r.DataSource.Recordset := ds.Tables[0];

end;


RecordSetProperty - Visual Basic

Visual Basic

Private Sub InitReport(rs As String, conn As String)

Dim da As OleDbDataAdapter

da = new OleDbDataAdapter(rs, conn)

Dim ds As DataSet = new DataSet()

da.Fill(ds)

c1r.DataSource.Recordset = ds.Tables(0)

End Sub


RecordSourceProperty - C#

C#

C1Report1.DataSource.ConnectionString = "DSN=NorthWind";

C1Report1.DataSource.RecordSource = "Employees";


RecordSourceProperty - Delphi

Delphi

begin

C1Report1.DataSource.ConnectionString := 'DSN=NorthWind';

C1Report1.DataSource.RecordSource := 'Employees';

end;


RecordSourceProperty - Visual Basic

Visual Basic

C1Report1.DataSource.ConnectionString = "DSN=NorthWind"

C1Report1.DataSource.RecordSource = "Employees"


RenderReport - C#

C#

c1printPreview1.Document = c1report1.Document;


RenderReport - Delphi

Delphi

c1printPreview1.Document := c1report1.Document;


RenderReport - Visual Basic

Visual Basic

c1printPreview1.Document = c1report1.Document


ReportDefUsingCode1 - C#

C#

// initialize control

With c1r;

.Clear() // clear any existing fields

.Font.Name = "Tahoma"; // set default font for all controls

.Font.Size = 8;

} With


ReportDefUsingCode1 - Delphi

Delphi

// initialize control

With c1r do

begin

Clear; // clear any existing fields

Font.Name := 'Tahoma'; // set default font for all controls

Font.Size := 8;

end;


ReportDefUsingCode1 - Visual Basic

Visual Basic

' initialize control

With c1r

.Clear() ' clear any existing fields

.Font.Name = "Tahoma" ' set default font for all controls

.Font.Size = 8

End With


ReportDefUsingCode2 - C#

C#

// initialize DataSource

With c1r.DataSource;

.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=C:\…\VB98\Nwind.mdb;" + "Persist Security Info=false";

.RecordSource = "Employees";

} With


ReportDefUsingCode2 - Delphi

Delphi

// initialize DataSource

with c1r.DataSource do

begin

ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;'+'Data

Source=C:\…\VB98\Nwind.mdb;'+'Persist Security Info=False';

RecordSource := 'Employees';

end;


ReportDefUsingCode2 - Visual Basic

Visual Basic

' initialize DataSource

With c1r.DataSource

.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _

"Data Source=C:\…\VB98\Nwind.mdb;" & _

"Persist Security Info=False"

.RecordSource = "Employees"

End With


ReportDefUsingCode3 - C#

C#

// initialize Layout

With c1r.Layout;

.Orientation = OrientationEnum.Portrait;

.Width = 6.5 * 1440; // 8.5 – margins, in twips

} With


ReportDefUsingCode3 - Delphi

Delphi

// initialize Layout

with c1r.Layout do

begin

Orientation := OrientationEnum.Portrait;

Width := 6.5 * 1440; // 8.5 – margins, in twips

end;


ReportDefUsingCode3 - Visual Basic

Visual Basic

' initialize Layout

With c1r.Layout

.Orientation = OrientationEnum.Portrait

.Width = 6.5 * 1440 ' 8.5 – margins, in twips

End With


ReportDefUsingCode4 - C#

C#

// variable used to create and format report fields

Field f;

// create a report header

With c1r.Sections(SectionTypeEnum.Header);

.Height = 1440;

.Visible = true;

.BackColor = Color.FromArgb(200, 200, 200);

f = .Fields.Add("FldTitle", "Employees Report", 0, 0, 8000, 1440);

f.Font.Size = 24;

f.Font.Bold = true;

f.ForeColor = Color.FromArgb(0, 0, 100);

} With


ReportDefUsingCode4 - Delphi

Delphi

// variable used to create and format report fields

// create a report header

with c1r.Sections[SectionTypeEnum.Header] do

begin

Height := 1440;

Visible := True;

BackColor := Color.FromArgb(200, 200, 200);

f := Fields.Add('FldTitle','Employees Report', 0, 0, 8000, 1440);

f.Font.Size := 24;

f.Font.Bold := True;

f.ForeColor := Color.FromArgb(0, 0, 100);

end;


ReportDefUsingCode4 - Visual Basic

Visual Basic

' variable used to create and format report fields

Dim f As Field

' create a report header

With c1r.Sections(SectionTypeEnum.Header)

.Height = 1440

.Visible = True

.BackColor = Color.FromArgb(200, 200, 200)

f = .Fields.Add("FldTitle", "Employees Report", 0, 0, 8000, 1440)

f.Font.Size = 24

f.Font.Bold = True

f.ForeColor = Color.FromArgb(0, 0, 100)

End With


ReportDefUsingCode5 - C#

C#

// create a page footer

With c1r.Sections(SectionTypeEnum.PageFooter);

.Height = 500;

.Visible = true;

f = .Fields.Add("FldFtrLeft", """Employees: Printed on "" + Now",_

0, 0, 4000, 300);

f.Calculated = true;

f = .Fields.Add("FldFtrRight", """Page "" + Page + "" of "" + Pages",_

4000, 0, 4000, 300);

f.Calculated = true;

f.Align = FieldAlignEnum.RightTop;

f.Width = c1r.Layout.Width - f.Left;

f = .Fields.Add("FldLine", "", 0, 0, c1r.Layout.Width, 20);

f.LineSlant = LineSlantEnum.NoSlant;

f.BorderStyle = BorderStyleEnum.Solid;

f.BorderColor = Color.FromArgb(0, 0, 100);

} With


ReportDefUsingCode5 - Delphi

Delphi

// create a page footer

with c1r.Sections[SectionTypeEnum.PageFooter] do

begin

Height := 500;

Visible := True;

f := Fields.Add('FldFtrLeft','"Employees: Printed on " & Now',0, 0, 4000, 300);

f.Calculated := True;

f := Fields.Add('FldFtrRight','"Page " & Page & " of " & Pages',4000, 0, 4000,

300);

f.Calculated := True;

f.Align := FieldAlignEnum.RightTop;

f.Width := c1r.Layout.Width - f.Left;

f := Fields.Add('FldLine','', 0, 0, c1r.Layout.Width, 20);

f.LineSlant := LineSlantEnum.NoSlant;

f.BorderStyle := BorderStyleEnum.Solid;

f.BorderColor := Color.FromArgb(0, 0, 100);

end;


ReportDefUsingCode5 - Visual Basic

Visual Basic

' create a page footer

With c1r.Sections(SectionTypeEnum.PageFooter)

.Height = 500

.Visible = True

f = .Fields.Add("FldFtrLeft", """Employees: Printed on "" & Now",_

0, 0, 4000, 300)

f.Calculated = True

f = .Fields.Add("FldFtrRight", """Page "" & Page & "" of "" & Pages",_

4000, 0, 4000, 300)

f.Calculated = True

f.Align = FieldAlignEnum.RightTop

f.Width = c1r.Layout.Width - f.Left

f = .Fields.Add("FldLine", "", 0, 0, c1r.Layout.Width, 20)

f.LineSlant = LineSlantEnum.NoSlant

f.BorderStyle = BorderStyleEnum.Solid

f.BorderColor = Color.FromArgb(0, 0, 100)

End With


ReportDefUsingCode6- C#

C#

// create a page header with field labels

With c1r.Sections(SectionTypeEnum.PageHeader);

.Height = 500;

.Visible = true;

c1r.Font.Bold = true;

f = .Fields.Add("LblID", "ID", 0, 50, 400, 300);

f.Align = FieldAlignEnum.RightTop;

f = .Fields.Add("LblFirstName", "First", 500, 50, 900, 300);

f = .Fields.Add("LblLastName", "Last", 1500, 50, 900, 300);

f = .Fields.Add("LblTitle", "Title", 2500, 50, 2400, 300);

f = .Fields.Add("LblTitle", "Notes", 5000, 50, 8000, 300);

c1r.Font.Bold = false;

f = .Fields.Add("FldLine", "", 0, 400, c1r.Layout.Width, 20);

f.LineSlant = LineSlantEnum.NoSlant;

f.LineWidth = 50;

f.BorderStyle = BorderStyleEnum.Solid;

f.BorderColor = Color.FromArgb(100, 100, 100);

} With


ReportDefUsingCode6- Delphi

Delphi

// create a page header with field labels

with c1r.Sections(SectionTypeEnum.PageHeader) do

begin

Height := 500;

Visible := True;

c1r.Font.Bold := True;

f := Fields.Add('LblID','ID', 0, 50, 400, 300);

f.Align := FieldAlignEnum.RightTop;

f := Fields.Add('LblFirstName','First', 500, 50, 900, 300);

f := Fields.Add('LblLastName','Last', 1500, 50, 900, 300);

f := Fields.Add('LblTitle','Title', 2500, 50, 2400, 300);

f := Fields.Add('LblTitle','Notes', 5000, 50, 8000, 300);

c1r.Font.Bold := False;

f := Fields.Add('FldLine','', 0, 400, c1r.Layout.Width, 20);

f.LineSlant := LineSlantEnum.NoSlant;

f.LineWidth := 50;

f.BorderStyle := BorderStyleEnum.Solid;

f.BorderColor := Color.FromArgb(100, 100, 100);

end;


ReportDefUsingCode6 - Visual Basic

Visual Basic

' create a page header with field labels

With c1r.Sections(SectionTypeEnum.PageHeader)

.Height = 500

.Visible = True

c1r.Font.Bold = True

f = .Fields.Add("LblID", "ID", 0, 50, 400, 300)

f.Align = FieldAlignEnum.RightTop

f = .Fields.Add("LblFirstName", "First", 500, 50, 900, 300)

f = .Fields.Add("LblLastName", "Last", 1500, 50, 900, 300)

f = .Fields.Add("LblTitle", "Title", 2500, 50, 2400, 300)

f = .Fields.Add("LblTitle", "Notes", 5000, 50, 8000, 300)

c1r.Font.Bold = False

f = .Fields.Add("FldLine", "", 0, 400, c1r.Layout.Width, 20)

f.LineSlant = LineSlantEnum.NoSlant

f.LineWidth = 50

f.BorderStyle = BorderStyleEnum.Solid

f.BorderColor = Color.FromArgb(100, 100, 100)

End With


ReportDefUsingCode7- C#

C#

// create the detail section

With c1r.Sections(SectionTypeEnum.Detail);

.Height = 330;

.Visible = true;

f = .Fields.Add("FldID", "EmployeeID", 0, 0, 400, 300);

f.Calculated = true;

f = .Fields.Add("FldFirstName", "FirstName", 500, 0, 900, 300);

f.Calculated = true;

f = .Fields.Add("FldLastName", "LastName", 1500, 0, 900, 300);

f.Calculated = true;

f = .Fields.Add("FldTitle", "Title", 2500, 0, 2400, 300);

f.Calculated = true;

f = .Fields.Add("FldNotes", "Notes", 5000, 0, 8000, 300);

f.Width = c1r.Layout.Width - f.Left;

f.Calculated = true;

f.CanGrow = true;

f.Font.Size = 6;

f.Align = FieldAlignEnum.JustTop;

f = .Fields.Add("FldLine", "", 0, 310, c1r.Layout.Width, 20);

f.LineSlant = LineSlantEnum.NoSlant;

f.BorderStyle = BorderStyleEnum.Solid;

f.BorderColor = Color.FromArgb(100, 100, 100);

} With


ReportDefUsingCode7- Delphi

Delphi

// create the detail section

with c1r.Sections(SectionTypeEnum.Detail) do

begin

Height := 330;

Visible := True;

f := Fields.Add('FldID','EmployeeID', 0, 0, 400, 300);

f.Calculated := True;

f := Fields.Add('FldFirstName','FirstName', 500, 0, 900, 300);

f.Calculated := True;

f := Fields.Add('FldLastName','LastName', 1500, 0, 900, 300);

f.Calculated := True;

f := Fields.Add('FldTitle','Title', 2500, 0, 2400, 300);

f.Calculated := True;

f := Fields.Add('FldNotes','Notes', 5000, 0, 8000, 300);

f.Width := c1r.Layout.Width - f.Left;

f.Calculated := True;

f.CanGrow := True;

f.Font.Size := 6;

f.Align := FieldAlignEnum.JustTop;

f := Fields.Add('FldLine','', 0, 310, c1r.Layout.Width, 20);

f.LineSlant := LineSlantEnum.NoSlant;

f.BorderStyle := BorderStyleEnum.Solid;

f.BorderColor := Color.FromArgb(100, 100, 100);

end;


ReportDefUsingCode7- Visual Basic

Visual Basic

' create the detail section

With c1r.Sections(SectionTypeEnum.Detail)

.Height = 330

.Visible = True

f = .Fields.Add("FldID", "EmployeeID", 0, 0, 400, 300)

f.Calculated = True

f = .Fields.Add("FldFirstName", "FirstName", 500, 0, 900, 300)

f.Calculated = True

f = .Fields.Add("FldLastName", "LastName", 1500, 0, 900, 300)

f.Calculated = True

f = .Fields.Add("FldTitle", "Title", 2500, 0, 2400, 300)

f.Calculated = True

f = .Fields.Add("FldNotes", "Notes", 5000, 0, 8000, 300)

f.Width = c1r.Layout.Width - f.Left

f.Calculated = True

f.CanGrow = True

f.Font.Size = 6

f.Align = FieldAlignEnum.JustTop

f = .Fields.Add("FldLine", "", 0, 310, c1r.Layout.Width, 20)

f.LineSlant = LineSlantEnum.NoSlant

f.BorderStyle = BorderStyleEnum.Solid

f.BorderColor = Color.FromArgb(100, 100, 100)

End With


ReportDefUsingCode8- C#

C#

// render the report into the PrintPreviewControl

ppv.Document = c1r.Document;


ReportDefUsingCode8- Delphi

Delphi

// render the report into the PrintPreviewControl

ppv.Document := c1r.Document;


ReportDefUsingCode8- Visual Basic

Visual Basic

' render the report into the PrintPreviewControl

ppv.Document = c1r.Document


ReportFieldNames - C#

C#

MyField.BackColor = RGB(200,250,100);

MyField.Font.Size = 14;

MyField * 2; // (same as MyField.value * 2)


ReportFieldNames - Delphi

Delphi

MyField.BackColor := RGB(200, 250, 100);

MyField.Font.Size := 14;

MyField * 2; // (same as MyField.value * 2)


ReportFieldNames - Visual Basic

Visual Basic

MyField.BackColor = RGB(200,250,100)

MyField.Font.Size = 14

MyField * 2 ' (same as MyField.Value * 2)


ReportNameProperty - C#

C#

// load report from XML file

c1r.Load(DataFileName, "Employees");

// show report name

Console.WriteLine(c1r.ReportName);

Employees


ReportNameProperty - Delphi

Delphi

begin

// load report from XML file

c1r.Load(DataFileName, 'Employees');

// show report name

Console.WriteLine(c1r.ReportName);

end;

Employees


ReportNameProperty - Visual Basic

Visual Basic

' load report from XML file

c1r.Load(DataFileName, "Employees")

' show report name

Console.WriteLine(c1r.ReportName)

Employees


ReportObject - C#

C#

"Fields: " + Report.Fields.Count;


ReportObject - Delphi

Delphi

'Fields: ' + Report.Fields.Count;


ReportObject - Visual Basic

Visual Basic

"Fields: " & Report.Fields.Count


ReportSectionNames - C#

C#

if ( Page = 1 ) { [Page Footer].Visible = false;


ReportSectionNames - Delphi

Delphi

if ( Page = 1 ) then [Page Footer].Visible := false;


ReportSectionNames - Visual Basic

Visual Basic

If Page = 1 Then [Page Footer].Visible = False


ResetPageCounter1 - C#

C#

c1r.Fields("PageFooter").Text = "[Country] + "" "" + [Page]";


ResetPageCounter1 - Delphi

Delphi

begin

c1r.Fields['PageFooter'].Text := '[Country] + " " + [Page]';

end;


ResetPageCounter1 - Visual Basic

Visual Basic

c1r.Fields("PageFooter").Text = "[Country] & "" "" & [Page]"


ResetPageCounter2 - C#

C#

c1r.Sections ("CountryGroupHeader").OnPrint = "Page = 1";


ResetPageCounter2 - Delphi

Delphi

begin

c1r.Sections['CountryGroupHeader'].OnPrint := 'Page = 1';

end;


ResetPageCounter2 - Visual Basic

Visual Basic

c1r.Sections ("CountryGroupHeader").OnPrint = "Page = 1"


RTFProperty - C#

C#

myField.RTF = true;

myField.Text = "{This is \b Really \b0\i Really \i0 important}";


RTFProperty - Delphi

Delphi

begin

myField.RTF := True;

myField.Text := '{This is \b Really \b0\i Really \i0 important}';

end;


RTFProperty - Visual Basic

Visual Basic

myField.RTF = True

myField.Text = "{This is \b Really \b0\i Really \i0 important}"


RunTime1 - C#

C#

using C1.Win.C1Report;

using System.IO;


RunTime1 - Delphi

Delphi

uses C1.Win.C1Report,

System.IO;


RunTime1 - Visual Basic

Visual Basic

Imports C1.Win.C1Report

Imports System.IO


RunTime2 - C#

C#

// get application path

string appPath;

appPath = Path.GetDirectoryName(Application.ExecutablePath).ToLower();

int i = appPath.IndexOf("/bin");

if ((i < 0) ) { i = appPath.IndexOf("\bin")

if ((i > 0) ) { appPath = appPath.Remove(i, appPath.Length - i)

// get names of reports in the report definition file

m_ReportDefinitionFile = appPath + "\Data\Nwind.xml";

string ( reports) = c1r.GetReportInfo(m_ReportDefinitionFile);

// populate combo box

cmbReport.Items.Clear();

string report;

foreach ( report In reports

cmbReport.Items.Add(report);

}


RunTime2 - Delphi

Delphi

var

appPath: string;

i: Integer;

reports: array of string;

begin

// get application path

appPath := Path.GetDirectoryName(Application.ExecutablePath).ToLower;

i := appPath.IndexOf('/bin');

if (i < 0) then

i := appPath.IndexOf('\bin');

if (i > 0) then

appPath := appPath.Remove(i, appPath.Length - i);

// get names of reports in the report definition file

m_ReportDefinitionFile := appPath + '\Data\Nwind.xml';

reports := c1r.GetReportInfo(m_ReportDefinitionFile);

// populate combo box

cmbReport.Items.Clear;

for i := 0 to High(reports) do

cmbReport.Items.Add(reports[i]);

end


RunTime2 - Visual Basic

Visual Basic

' get application path

Dim appPath As String

appPath = Path.GetDirectoryName(Application.ExecutablePath).ToLower()

Dim i As Integer = appPath.IndexOf("/bin")

If (i < 0) Then i = appPath.IndexOf("\bin")

If (i > 0) Then appPath = appPath.Remove(i, appPath.Length - i)

' get names of reports in the report definition file

m_ReportDefinitionFile = appPath & "\Data\Nwind.xml"

Dim reports As String() = c1r.GetReportInfo(m_ReportDefinitionFile)

' populate combo box

cmbReport.Items.Clear()

Dim report As String

For Each report In reports

cmbReport.Items.Add(report)

Next


RunTime3 - C#

C#

private void cmbReport_SelectedIndexChanged( object sender,_

EventArgs e) cmbReport.SelectedIndexChanged;

{

try {

Cursor = Cursors.WaitCursor;

// load report

status.Text = "Loading " + cmbReport.Text;

c1r.Load(m_ReportDefinitionFile, cmbReport.Text);

// render into print preview control

status.Text = "Rendering " + cmbReport.Text;

ppv.Document = c1r.Document;

// give focus to print preview control

ppv.StartPage = 0;

ppv.Focus();

} finally {

Cursor = Cursors.Default;

}

}


RunTime3 - Delphi

Delphi

Include(Self.cmbReport.SelectedIndexChanged, Self.cmbReport_SelectedIndexChanged);

procedure cmbReport_SelectedIndexChanged(sender: System.Object; e: System.EventArgs);

begin

Cursor := Cursors.WaitCursor;

try

// load report

status.Text := 'Loading '+ cmbReport.Text;

c1r.Load(m_ReportDefinitionFile, cmbReport.Text);

// render into print preview control

status.Text := 'Rendering '+ cmbReport.Text;

ppv.Document := c1r.Document;

// give focus to print preview control

ppv.StartPage := 0;

ppv.Focus;

finally;

Cursor := Cursors.Default;

end;

end;


RunTime3 - Visual Basic

Visual Basic

Private Sub cmbReport_SelectedIndexChanged(ByVal sender As Object,_

ByVal e As EventArgs) Handles cmbReport.SelectedIndexChanged

Try

Cursor = Cursors.WaitCursor

' load report

status.Text = "Loading " & cmbReport.Text

c1r.Load(m_ReportDefinitionFile, cmbReport.Text)

' render into print preview control

status.Text = "Rendering " & cmbReport.Text

ppv.Document = c1r.Document

' give focus to print preview control

ppv.StartPage = 0

ppv.Focus()

Finally

Cursor = Cursors.Default

End Try

End Sub


SalesByYear1 - C#

C#

PARAMETERS [Beginning Date] DateTime 1/1/1994,

[Ending Date] DateTime 1/1/2001,

[Show Details] Boolean False; ...


SalesByYear1 - Delphi

Delphi

PARAMETERS [Beginning Date] DateTime 1/1/1994,

[Ending Date] DateTime 1/1/2001,

[Show Details] Boolean False; ...


SalesByYear1 - Visual Basic

Visual Basic

PARAMETERS (Beginning Date) DateTime 1/1/1994,

(Ending Date) DateTime 1/1/2001,

(Show Details) Boolean False; ...


SalesByYear2 - C#

C#

Report.OnOpen = "b = [Show Details]" +

" Detail.Visible = b\r\n" +

" [Group 0 Footer].Visible = b\r\n" +

" DetailsLabel.Visible = b\r\n" +

" LineNumberLabel2.Visible = b\r\n" +

" Line15.Visible = b\r\n" +

" SalesLabel2.Visible = b\r\n" +

" OrdersShippedLabel2.Visible = b\r\n" +

" ShippedDateLabel2.Visible = b\r\n" +

" Line10.Visible = b";


SalesByYear2 - Delphi

Delphi

Report.OnOpen := 'b = [Show Details]'#13#10 +

' Detail.Visible = b'#13#10 +

' [Group 0 Footer].Visible = b'#13#10 +

' DetailsLabel.Visible = b'#13#10 +

' LineNumberLabel2.Visible = b'#13#10 +

' Line15.Visible = b'#13#10 +

' SalesLabel2.Visible = b'#13#10 +

' OrdersShippedLabel2.Visible = b'#13#10 +

' ShippedDateLabel2.Visible = b'#13#10 +

' Line10.Visible = b';


SalesByYear2 - Visual Basic

Visual Basic

Report.OnOpen = "b = [Show Details]" & vbCrLf & _

" Detail.Visible = b" & vbCrLf & _

" [Group 0 Footer].Visible = b" & vbCrLf & _

" DetailsLabel.Visible = b" & vbCrLf & _

" LineNumberLabel2.Visible = b" & vbCrLf & _

" Line15.Visible = b" & vbCrLf & _

" SalesLabel2.Visible = b" & vbCrLf & _

" OrdersShippedLabel2.Visible = b" & vbCrLf & _

" ShippedDateLabel2.Visible = b" & vbCrLf & _

" Line10.Visible = b"


SalesByYear3 - C#

C#

Sections ("Detail").OnPrint =

"PageHeader.Visible = true";

Sections("Group 0 Footer).OnPrint =

"PageHeader.Visible = false";


SalesByYear3 - Delphi

Delphi

begin

Sections['Detail'].OnPrint := 'PageHeader.Visible = True';

Sections['Group 0 Footer'].OnPrint := 'PageHeader.Visible = False';

end;


SalesByYear3 - Visual Basic

Visual Basic

Sections ("Detail").OnPrint = _

"PageHeader.Visible = True"

Sections("Group 0 Footer).OnPrint = _

"PageHeader.Visible = False"


SalesTotalByAmount1 - C#

C#

PageTotal = 0;


SalesTotalByAmount1 - Delphi

Delphi

PageTotal := 0;


SalesTotalByAmount1 - Visual Basic

Visual Basic

PageTotal = 0


SalesTotalByAmount2 - C#

C#

PageTotal = PageTotal + SaleAmount;

HiddenPageBreak.Visible = (Counter = 10);


SalesTotalByAmount2 - Delphi

Delphi

PageTotal := PageTotal + SaleAmount;

HiddenPageBreak.Visible := Counter = 10;


SalesTotalByAmount2 - Visual Basic

Visual Basic

PageTotal = PageTotal + SaleAmount

HiddenPageBreak.Visible = (Counter = 10)


SaveMethod1 - Delphi

Delphi

c1r.Save(path + 'MySingleReport.xml');


SaveMethod1 - Visual Basic

Visual Basic

c1r.Save(path & "MySingleReport.xml")


SaveMethod2 - C#

C#

private void btnSave_Click( System.object sender, System.EventArgs e) btnSave.Click

{

// open xml file

string fileName =

Path.GetDirectoryName(Application.ExecutablePath) + "\MyReports.xml";

XmlTextWriter writer = new XmlTextWriter(fileName,

system.Text.Encoding.Default);

// initialize xml file

writer.Formatting = Formatting.Indented;

writer.Indentation = 2;

writer.WriteStartDocument();

writer.WriteStartElement("Reports");

// save Customers report

RenderCustomers();

c1r.ReportName = "Customers";

c1r.Save(writer);

// save Employees report

RenderEmployees();

c1r.ReportName = "Employees";

c1r.Save(writer);

// close xml file

writer.WriteEndElement();

writer.Close();

}


SaveMethod2 - Delphi

Delphi

Include(Self.btnSave.Click, Self.btnSave_Click);

procedure btnSave_Click(sender: System.Object; e: System.EventArgs);

var

fileName: string;

writer: XmlTextWriter;

begin

// open xml file

fileName := Path.GetDirectoryName(Application.ExecutablePath) + '\MyReports.xml';

writer := XmlTextWriter.Create(fileName, System.Text.Encoding.Default);

// initialize xml file

writer.Formatting := Formatting.Indented;

writer.Indentation := 2;

writer.WriteStartDocument;

writer.WriteStartElement('Reports');

// save Customers report

RenderCustomers;

c1r.ReportName := 'Customers';

c1r.Save(writer);

// save Employees report

RenderEmployees;

c1r.ReportName := 'Employees';

c1r.Save(writer);

// close xml file

writer.WriteEndElement;

writer.Close;

end;


SaveMethod2 - Visual Basic

Visual Basic

Private Sub btnSave_Click(ByVal sender As System.Object, _

ByVal e As System.EventArgs) _

Handles btnSave.Click

' open xml file

Dim fileName As String = _

Path.GetDirectoryName(Application.ExecutablePath) + _

"\MyReports.xml"

Dim writer As XmlTextWriter = _

New XmlTextWriter(fileName, System.Text.Encoding.Default)

' initialize xml file

writer.Formatting = Formatting.Indented

writer.Indentation = 2

writer.WriteStartDocument()

writer.WriteStartElement("Reports")

' save Customers report

RenderCustomers()

c1r.ReportName = "Customers"

c1r.Save(writer)

' save Employees report

RenderEmployees()

c1r.ReportName = "Employees"

c1r.Save(writer)

' close xml file

writer.WriteEndElement()

writer.Close()

End Sub


SectionProperty - C#

C#

for (int i = 0; i <= c1r.Fields.Count – 1; i++)

{

if ( c1r.Fields[i].Section = SectionTypeEnum.PageHeader )

{

c1r.Fields[i].Section = SectionTypeEnum.PageFooter;

}

}


SectionProperty - Delphi

Delphi

var

i: Integer;

begin

for i := 0 to c1r.Fields.Count – 1 do

if c1r.Fields[i].Section = SectionTypeEnum.PageHeader then

c1r.Fields[i].Section := SectionTypeEnum.PageFooter;

end;


SectionProperty - Visual Basic

Visual Basic

Dim i As Integer

For i = 0 To c1r.Fields.Count – 1

If c1r.Fields(i).Section = SectionTypeEnum.PageHeader Then

c1r.Fields(i).Section = SectionTypeEnum.PageFooter

End If

Next


StaticWebReports - C#

C#

// ** this runs every 6 hours:

// get a list of all reports in the definition file

sFile = "c:\inetpub\wwwroot\Reports\MyReports.xml";

sList = c1r.GetReportInfo(sFile);

// refresh the reports on the server

for ( i = 0; i <= sList.Length – 1

c1r.Load(sFile, sList(i));

sFile = "Reports\Auto\" + sList(i) + ".htm";

c1r.RenderToFile(sFile, FileFormatEnum.HTMLPaged);

}


StaticWebReports - Delphi

Delphi

// ** this runs every 6 hours:

// get a list of all reports in the definition file

sFile := 'c:\inetpub\wwwroot\Reports\MyReports.xml';

sList := c1r.GetReportInfo(sFile);

// refresh the reports on the server

for i := 0 to High(sList) do

begin

c1r.Load(sFile, sList[i]);

sFile := 'Reports\Auto\'+ sList(i) +'.htm';

c1r.RenderToFile(sFile, FileFormatEnum.HTMLPaged);

end;


StaticWebReports - Visual Basic

Visual Basic

' ** this runs every 6 hours:

' get a list of all reports in the definition file

sFile = "c:\inetpub\wwwroot\Reports\MyReports.xml"

sList = c1r.GetReportInfo(sFile)

' refresh the reports on the server

For i = 0 To sList.Length – 1

c1r.Load(sFile, sList(i))

sFile = "Reports\Auto\" & sList(i) & ".htm"

c1r.RenderToFile(sFile, FileFormatEnum.HTMLPaged)

Next


SubReportHasDataProperty1 - C#

C#

Detail.OnPrint = "Detail.Visible = fSubreport.SubreportHasData";


SubReportHasDataProperty1 - Delphi

Delphi

Detail.OnPrint :='Detail.Visible = fSubreport.SubreportHasData';


SubReportHasDataProperty1 - Visual Basic

Visual Basic

Detail.OnPrint = "Detail.Visible = fSubreport.SubreportHasData"


SubReportHasDataProperty2 - C#

C#

if (fSubreport.SubreportHasData)

{

fNoData.Visible = false;

fSubreport.Visible = true;

}

else

{

fNoData.Visible = true;

fSubreport.Visible = false;

}


SubReportHasDataProperty2 - Delphi

Delphi

if fSubReport.SubreportHasData then

begin

fNoData.Visible := false;

fSubreport.Visible := true;

end;

else

begin

fNoData.Visible := true;

fSubreport.Visible := false;

end;


SubReportHasDataProperty2 - Visual Basic

Visual Basic

if fSubreport.SubreportHasData Then

fNoData.Visible = false

fSubreport.Visible = true

else

fNoData.Visible = true

fSubreport.Visible = false

end if


SubreportProperty1 - C#

C#

string sSub = "Sales By Category Subreport"; {

c1SubReport.Load("NWIND.XML", sSub);

c1rMainReport.Fields[sSub].Subreport = c1SubReport;


SubreportProperty1 - Delphi

Delphi

var

ssub: string;

begin

ssub := 'Sales By Category Subreport';

c1SubReport.Load('NWIND.XML', sSub);

c1rMainReport.Fields[sSub].Subreport := c1SubReport;

end;


SubreportProperty1 - Visual Basic

Visual Basic

Dim sSub As String = "Sales By Category Subreport"

c1SubReport.Load("NWIND.XML", sSub)

c1rMainReport.Fields(sSub).Subreport = c1SubReport


SubreportProperty2 - C#

C#

c1rMainReport.Fields[sSub].Calculated = true;

c1rMainReport.Fields[sSub].Text =

" ""CategoryName = //"" + [CategoryName] + ""//"" ";


SubreportProperty2 - Delphi

Delphi

c1rMainReport.Fields[sSub].Calculated := True;

c1rMainReport.Fields[sSub].Text := ' "CategoryName = ''" & [CategoryName]

& "''" ';


SubreportProperty2 - Visual Basic

Visual Basic

c1rMainReport.Fields (sSub).Calculated = True

c1rMainReport.Fields(sSub).Text = _

" ""CategoryName = '"" & [CategoryName] & ""'"" "


SubreportProperty3 - C#

C#

c1rMainReport.Fields[sSub].Calculated = true;

string link = "#CategoryName = //# + [CategoryName] + #//#";

c1rMainReport.Fields(sSub).Text = link.Replace("#", """");


SubreportProperty3 - Delphi

Delphi

var

link: string;

begin

c1rMainReport.Fields[sSub].Calculated := True;

link := '#CategoryName = ''# & [CategoryName] & #''#';

c1rMainReport.Fields[sSub].Text := link.Replace('#','"');end;


SubreportProperty3 - Visual Basic

Visual Basic

c1rMainReport.Fields (sSub).Calculated = True

Dim link As String = "#CategoryName = '# & [CategoryName] & #'#"

c1rMainReport.Fields(sSub).Text = link.Replace("#", """")


TextProperty - C#

C#

theField.Text = "Amount * SalesTax";

theField.Calculated = false;

Debug.Print Field.value;

Amount * SalesTax;

theField.Text = "Amount * SalesTax";

theField.Calculated = true;

Debug.Print Field.value;

257.34;


TextProperty - Delphi

Delphi

theField.Text := 'Amount * SalesTax';

theField.Calculated := False;

theField.Text := 'Amount * SalesTax';

theField.Calculated := True;


TextProperty - Visual Basic

Visual Basic

theField.Text = "Amount * SalesTax"

theField.Calculated = False

Debug.Print Field.Value

Amount * SalesTax

theField.Text = "Amount * SalesTax"

theField.Calculated = True

Debug.Print Field.Value

257.34


UnboundReports - C#

C#

private void MakeReport()

{

// find report definition file

string path = Application.StartupPath;

int i = path.IndexOf("\bin");

if ( i > -1 ) { path = path.Substring(0, i)

path = path + "\";

// load unbound report

c1r.Load(path + "Newsletter.xml", "NewsLetter");

// set field values

c1r.Fields["FldHeadline1"].Text = "C1Report Launched";

c1r.Fields["FldBody1"].Text = "ComponentOne unveils…";

c1r.Fields["FldHeadline2"].Text = "Competitive Upgrades";

c1r.Fields["FldBody2"].Text = "get { ahead …";

c1r.Fields["FldHeadline3"].Text = "C1Report Designer";

c1r.Fields["FldBody3"].Text = "The C1Report Designer…";

// done, show the report

c1ppv.Document = c1r.Document;

// and/or save it to an HTML document so your subscribers

// can get to it over the Web

c1r.RenderToFile(path + "Newsletter.htm", FileFormatEnum.HTML);

}


UnboundReports - Delphi

Delphi

procedure MakeReport;

var

path: String;

i: Integer;

begin

// find report definition file

path := Application.StartupPath;

i := path.IndexOf('\bin');

if i > -1 then path = path.Substring(0, i);

path := path +'\';

// load unbound report

c1r.Load(path +'Newsletter.xml','NewsLetter');

// set field values

c1r.Fields['FldHeadline1'].Text := 'C1Report Launched';

c1r.Fields['FldBody1'].Text := 'ComponentOne unveils…';

c1r.Fields['FldHeadline2'].Text := 'Competitive Upgrades';

c1r.Fields['FldBody2'].Text := 'Get ahead …';

c1r.Fields['FldHeadline3'].Text := 'C1Report Designer';

c1r.Fields['FldBody3'].Text := 'The C1Report Designer…';

// done, show the report

c1ppv.Document := c1r.Document;

// and/or save it to an HTML document so your subscribers

// can get to it over the Web

c1r.RenderToFile(path + 'Newsletter.htm', FileFormatEnum.HTML);

end;


UnboundReports - Visual Basic

Visual Basic

Private Sub MakeReport()

' find report definition file

Dim path As String = Application.StartupPath

Dim i As Integer = path.IndexOf("\bin")

If i > -1 Then path = path.Substring(0, i)

path = path & "\"

' load unbound report

c1r.Load(path & "Newsletter.xml", "NewsLetter")

' set field values

c1r.Fields("FldHeadline1").Text = "C1Report Launched"

c1r.Fields("FldBody1").Text = "ComponentOne unveils…"

c1r.Fields("FldHeadline2").Text = "Competitive Upgrades"

c1r.Fields("FldBody2").Text = "Get ahead …"

c1r.Fields("FldHeadline3").Text = "C1Report Designer"

c1r.Fields("FldBody3").Text = "The C1Report Designer…"

' done, show the report

c1ppv.Document = c1r.Document

' and/or save it to an HTML document so your subscribers

' can get to it over the Web

c1r.RenderToFile(path & "Newsletter.htm", FileFormatEnum.HTML)

End Sub


Upgrading1 - C#

C#

vsreport1.Render(vsprinter1);


Upgrading1 - Delphi

Delphi

vsreport1.Render(vsprinter1);


Upgrading1 - Visual Basic

Visual Basic

vsreport1.Render(vsprinter1)


Upgrading2 - C#

C#

c1printPreview1.Document = c1report1.Document;


Upgrading2 - Delphi

Delphi

c1printPreview1.Document := c1report1.Document;


Upgrading2 - Visual Basic

Visual Basic

c1printPreview1.Document = c1report1.Document


ValueProperty1 - C#

C#

string sScript =

"If MyField > 100 Then MyField.ForeColor = RGB(255,0,0) ";


ValueProperty1 - Delphi

Delphi

sScript := 'if MyField > 100 then MyField.ForeColor = RGB(255,0,0)';


ValueProperty1 - Visual Basic

Visual Basic

Dim sScript As String = _

"If MyField > 100 Then " & _

"MyField.ForeColor = RGB(255,0,0)"


ValueProperty2 - C#

C#

string sScript =

"If MyField > 100 Then MyField.ForeColor = RGB(255,0,0) ";


ValueProperty2 - Delphi

Delphi

var

sScript: string;

begin

sScript := 'If MyField.Value > 100 Then MyField.ForeColor = RGB(255,0,0)';

end;


ValueProperty2 - Visual Basic

Visual Basic

Dim sScript As String = _

"If MyField.Value > 100 Then " & _

"MyField.ForeColor = RGB(255,0,0)"


Untitled Document


Untitled Document

 E-mail sent to documentation@componentone.com is for documentation feedback only. We welcome any suggestions to help improve our documentation.