Welcome to ComponentOne XLS for .NET

Untitled Document ComponentOne XLS 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 XLS for .NET

Welcome to ComponentOne XLS™ for .NET. XLS for .NET (C1XLS) allows you to read and write Microsoft Excel files from your applications.

ComponentOne has a user-friendly distribution policy. We want every programmer to obtain a copy of XLS 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 XLS for .NET will display a ComponentOne banner every time they are loaded to remind developers to license the product.

We are confident that you will like XLS 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 for new controls, 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 XLS for .NET

Installing XLS for .NET

END-USER LICENSE AGREEMENT FOR COMPONENTONE SOFTWARE

Licensing FAQs

Redistributable Files

Technical Support

Namespaces

Adding a Reference to the C1Excel Assembly

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


What's New in ComponentOne XLS for .NET

What's New in ComponentOne XLS for .NET

This documentation was last revised on June 2, 2005.


Feature Overview

Feature Overview

XLS for .NET now writes MULRK records, which allows you to save smaller xls files.


Installing XLS for .NET

Installing XLS for .NET

The following sections provide helpful information on installing XLS for .NET.

XLS for .NET Setup Files

System Requirements

Installing Demonstration Versions

Uninstalling XLS for .NET


XLS for .NET Setup Files

XLS for .NET Setup Files

The installation program will create the following directory: C:\Program Files\ComponentOne Studio.NET. This directory 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.
C1Excel | Contains samples and tutorials for the C1Excel component.


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: 4 MB hard disk space for storage of the software

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


Installing Demonstration Versions

Installing Demonstration Versions

If you wish to try XLS 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.


Uninstalling XLS for .NET

Uninstalling XLS for .NET

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


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.


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


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.


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.


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


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.


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).


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:

· 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

{

// ...

}

· 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.


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".


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.


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.


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").


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.


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.


Redistributable Files

Redistributable Files

ComponentOne XLS 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.C1Excel.dll

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


Technical Support

Technical Support

XLS for .NET 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


ComponentOne Web Site

ComponentOne Web Site

The ComponentOne Web site at www.componentone.com provides a wealth of information and software downloads for XLS 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.


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!


Internet e-mail

Internet e-mail

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

support.c1excel.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


Peer-to-Peer newsgroup

Peer-to-Peer newsgroup

ComponentOne also sponsors peer-to-peer newsgroups for 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 our products. 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.


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 our Web site. 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.


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 namespace for the C1Excel component is C1.C1Excel. The following code fragment shows how to declare a C1Excel 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 XLSheet, you can use it inside your project without qualification. However, the C1Excel assembly also implements a class called XLSheet. So, if you want to use the C1Excel 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.


Adding a Reference to the C1Excel Assembly

Adding a Reference to the C1Excel Assembly

When you install XLS for .NET, a new component does not appear in the Visual Studio’s toolbox. Therefore, to use C1XLS, you must reference the C1Excel assembly in your project. To use the C1Excel component:

1. Select the Add Reference option from the Project menu of your project.

2. Select the C1.C1Excel assembly from the list, or browse to find the C1.C1Excel.dll file.

3. Double-click the form caption area to open the code window. At the top of the file, add the following Imports statements (using in C#; uses in Delphi):

Imports System.IO

Imports C1.C1Excel

NOTE: This makes the objects defined in the C1Excel and System.IO assemblies visible to the project and saves a lot of typing.


Overview

Overview

C1Excel is a library that allows you to read and write Microsoft Excel files from your applications.

C1XLS reads and writes Microsoft Excel files using the BIFF8 format used since Excel 8.0 (also known as Excel 97).

The main use for C1XLS is to create XLS files that can be opened with Microsoft Excel. For example, the C1Report component uses C1Excel to export reports to the XLS format, so they can be viewed and edited by anyone with a copy of Microsoft Excel.

C1XLS can load files with multiple worksheets, including all cell content and formatting. However, it does not recognize all elements saved by Microsoft Excel. The main limitations in the current version are (some of these features will probably be added in future versions):

· Cell Borders: C1XLS does not currently expose cell borders.

· Formulas: C1XLS will read the last result of any calculations in the book, but it will not read or save cell formulas.

· Images: C1XLS does not read or write images of any kind, including charts.

· Hyperlinks: C1XLS will read the content and style of cells that contain hyperlinks, but not the hyperlinks themselves.

The main feature in C1XLS is ease of use. You can load a workbook with a single command, manipulate sheets as if they were grid controls (composed of rows, columns, and cells), then save the workbook to an XLS file.


Using C1XLS

Using C1XLS

Creating Documents

Worksheets

Rows and Columns

Cells

Styles


Creating Documents

Creating Documents

To create a new XLS file using C1XLS, three steps are required:

1. Create a C1XLBook object. Each book is composed of one or more sheets (XLSheet objects).

2. Add content to the sheets. Each sheet contains cells (XLCell objects) that have a Value and a Style property.

3. Save the book to a file using the Save method.

For example, the following code creates a new Excel file with a single sheet containing numbers from 1 to 100:

· Visual Basic

· C#

· Delphi

Step 2 is the most interesting one. The code starts by retrieving an XLSheet object that represents the single worksheet in the new Excel workbook. This sheet is created automatically when you create a new C1XLBook. Then the code uses the sheet indexer to reference cells in the sheet and assign them values from 1 to 100.

Note that the indexer in the XLSheet object automatically creates cells, if necessary. This makes it easy to fill worksheets that you create. If you want to find out the sheet dimensions, use the sheet's Rows.Count and Columns.Count properties.

Of course, you are not limited to assigning values to cells. You can also use styles to format the cells. Just create one or more XLStyle objects and assign them to cells much like you did values. This revised version of the code above creates a sheet where even numbers are shown in bold red characters and odd numbers in italic blue:

· Visual Basic

· C#

· Delphi

The code is similar. The main difference is the new step 2, which creates styles for odd and even cells. The new styles are assigned to cells in step 3, along with the cell values.

This is what the file created by the code above looks like when opened in Microsoft Excel:


Worksheets

Worksheets

Worksheets are the individual grids contained in an Excel file. They are represented by XLSheet objects accessible through the Sheets property in the C1XLBook class. Each sheet has a name and contains a collection of rows and columns. Individual cells can be accessed using the XLSheet indexer, which takes row and column indices.

The Rows and Columns collections in the XLSheet object extend automatically when you use their indexers. For example, if you write the following code and the sheet has fewer than 1001 rows, new rows will be automatically added, and a valid row will be returned. The same applies to XLColumn and XLCell indexers. This is different from the behavior of most collection indexers in .NET, but it makes it very easy to create and populate XLSheet objects.

· Visual Basic

· C#

· Delphi


Rows and Columns

Rows and Columns

The XLSheet object contains collections of rows and columns that expose each individual row and column on the sheet. The exposed XLRow and XLColumn objects allow you to assign the size (column width, row height), visibility, and style for each row and column on the sheet. If you don't assign any of these values, the sheet's defaults will be used (see the DefaultRowHeight and DefaultColumnWidth properties).

The default dimensions for XLRow and XLColumn objects are –1, which means 'use the sheet's default values'.


Cells

Cells

The XLSheet object also contains cells that can be accessed using an indexer that takes row and column indices. The cells are represented by XLCell objects that contain the cell value and style.

As with rows and columns, the cell indexer also extends the sheet automatically. For example, write:

· Visual Basic

· C#

· Delphi

If the sheet has fewer than 11 rows and 11 columns, rows and columns will be added and a valid XLCell object will be returned.

Because the sheet expands automatically, this indexer will never return a null reference. If you want to check whether a particular cell exists on the sheet and you don't want to create the cell inadvertently, use the sheet's GetCell method instead of the indexer.

XLCell objects have a Value property that contains the cell contents. This property is of type object and it may contain strings, numeric, Boolean, DateTime, or null objects. Other types of objects cannot be saved into Excel files.

XLCell objects also have a Style property that defines the appearance of the cell. If the Style property is set to null, the cell is displayed using the default style. Otherwise, it should be set to an XLStyle object that defines the appearance of the cell (font, alignment, colors, format, etc).


Styles

Styles

The XLStyle class defines the appearance of a cell, row, or column on a sheet. XLStyle includes properties that specify style elements such as the font, alignment, colors, and format used to display cell values. Not all style elements need to be defined in every XLStyle object. For example, if an XLStyle specifies only a format, then the cell is displayed using the specified format and default settings for the other style elements (font, alignment, etc.).


C1XLS Samples

C1XLS 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.


C# Samples

C# Samples

FlexGrid | Demonstrates how to load and save XLS file. This sample uses the C1FlexGrid control and calls the C1.C1Excel namespace.
HelloWorld | Demonstrates how to create an XLS file and add sheets. This sample calls the C1.C1Excel namespace.


C1.C1Excel Assembly

C1.C1Excel Assembly

Namespaces

C1.C1Excel


C1.C1Excel Namespace

C1.C1Excel Namespace

C1.C1Excel Hierarchy

Classes

Class | Description
C1XLBook | Represents an Excel workbook containing one or more worksheets. Contains methods for loading and saving xls files, and exposes a collection of XLSheet objects that represent the individual worksheets.
XLCell | Represents individual cells in a XLSheet, and provides properties for getting and setting the cell Value, Style, and Hyperlink.
XLCellRange | Represents a range of XLCell objects in a XLSheet.
XLCellRangeCollection | Represents a collection of XLCellRange objects on an XLSheet.
XLColumn | Represents a column in a worksheet, provides properties for setting the column's width, style, and visibility.
XLColumnCollection | Represents a collection of XLColumn objects that represent the individual columns in each XLSheet.
XLPrintSettings | Provides options and settings for printing XLSheet objects.
XLRow | Represents a row in a worksheet, provides properties for setting the row's height, style, and visibility.
XLRowCollection | Represents a collection of XLRow objects that represent the individual rows in each XLSheet.
XLSheet | Represents individual worksheets in an Excel workbook ( C1XLBook).
XLSheetCollection | Collection of XLSheet objects that represent the individual worksheets in a C1XLBook.
XLStyle | Contains style elements used to define the appearance of the cells.

Enumerations

Enumeration | Description
XLAlignHorzEnum | Specifies how to align cell content horizontally within a cell.
XLAlignVertEnum | Specifies how to align cell content vertically within a cell.
XLDiagonalFlags | Specifies the type of diagonal line to draw across the cells.
XLLineStyleEnum | Specifies the line style used for the cell borders.
XLPatternEnum | Specifies the pattern used for To fill the cell background.

See Also

C1.C1Excel Assembly


C1XLBook Class

C1XLBook Class

Represents an Excel workbook containing one or more worksheets.

Contains methods for loading and saving xls files, and exposes a collection of XLSheet objects that represent the individual worksheets.

For a list of all members of this type, see C1XLBook Members.

System.Object

System.MarshalByRefObject

System.ComponentModel.Component

C1.C1Excel.C1XLBook

[Visual Basic]

Public Class C1XLBook

Inherits Component

[C#]

public class C1XLBook : Component

[Delphi]

type C1XLBook = class (Component);

Namespace: C1.C1Excel

Assembly: C1.C1Excel (in c1.c1excel.dll)

See Also


C1XLBook Members

C1XLBook Members

C1XLBook overview

Public Constructors

C1XLBook Constructor

Creates a new instance of the C1XLBook class. The new workbook contains a single empty XLSheet called "Sheet1".

Public Properties

DefaultFont | Gets or sets the default System.Drawing.Font for the C1XLBook.
Sheets | Gets a collection of XLSheet objects that represent the worksheets in the C1XLBook.

Public Methods

Clear | Clears the C1XLBook, restoring the initial state with a single XLSheet called "Sheet1".
PixelsToTwips | Converts a pixel measurement into twips (1/20th of a point).
TwipsToPixels | Converts a twip measurement into screen pixels.
Load | Loads a complete C1XLBook from an xls file.
Save | Saves the C1XLBook to an xls file.

See Also


C1XLBook Constructor

C1XLBook Constructor

Creates a new instance of the C1XLBook class. The new workbook contains a single empty XLSheet called "Sheet1".

[Visual Basic]

Public Function New()

[C#]

public C1XLBook()

[Delphi]

public constructor Create();

See Also


C1XLBook Properties

C1XLBook Properties

The properties of the C1XLBook class are listed here. For a complete list of C1XLBook class members, see the C1XLBook Members topic.

Public Properties

DefaultFont | Gets or sets the default System.Drawing.Font for the C1XLBook.
Sheets | Gets a collection of XLSheet objects that represent the worksheets in the C1XLBook.

See Also


C1XLBook.DefaultFont Property

C1XLBook.DefaultFont Property

Gets or sets the default System.Drawing.Font for the C1XLBook.

[Visual Basic]

Public Property DefaultFont As Font

[C#]

public Font DefaultFont {get;set;}

[Delphi]

public property DefaultFont: Font read get_DefaultFont write set_DefaultFont;

Remarks

You can assign any font to any cell using XLStyle objects. Cells that have no associated custom styles or have styles that do not define a custom font are displayed using the book's default font.

The DefaultFont property is initially set to 10 pt Arial.

See Also


C1XLBook.Sheets Property

C1XLBook.Sheets Property

Gets a collection of XLSheet objects that represent the worksheets in the C1XLBook.

[Visual Basic]

Public ReadOnly Property Sheets As XLSheetCollection

[C#]

public XLSheetCollection Sheets {get;}

[Delphi]

public property Sheets: XLSheetCollection read get_Sheets;

Remarks

The XLSheetCollection returned has methods for counting, enumerating, adding and removing sheets from the C1XLBook.

See Also


C1XLBook Methods

C1XLBook Methods

The methods of the C1XLBook class are listed here. For a complete list of C1XLBook class members, see the C1XLBook Members topic.

Public Methods

Clear | Clears the C1XLBook, restoring the initial state with a single XLSheet called "Sheet1".
PixelsToTwips | Converts a pixel measurement into twips (1/20th of a point).
TwipsToPixels | Converts a twip measurement into screen pixels.
Load | Loads a complete C1XLBook from an xls file.
Save | Saves the C1XLBook to an xls file.

See Also


C1XLBook.Clear Method

C1XLBook.Clear Method

Clears the C1XLBook, restoring the initial state with a single XLSheet called "Sheet1".

[Visual Basic]

Public Sub Clear()

[C#]

public void Clear()

[Delphi]

public procedure Clear();

Remarks

The Clear method restores the C1XLBook object to its initial state, with a single empty sheet called "Sheet1" and the DefaultFont set to 10pt Arial.

See Also


C1XLBook.Load Method

C1XLBook.Load Method

Overload List

Loads a complete C1XLBook from an xls file.

[Visual Basic] Overloads Public Sub Load(String)

[C#] public Load(string);

[Delphi] public procedure Load(String); overload;

Loads a list of the worksheets in an xls file, optionally skipping the data contained in the sheets.

[Visual Basic] Overloads Public Sub Load(String, Boolean)

[C#] public Load(string, bool);

[Delphi] public procedure Load(String; Boolean); overload;

See Also


C1XLBook.Load Method (String)

C1XLBook.Load Method (String)

Loads a complete C1XLBook from an xls file.

[Visual Basic]

Overloads Public Sub Load( _

ByVal fileName As String _

)

[C#]

public void Load(

string fileName

);

[Delphi]

public procedure Load(

fileName: String

); overload;

Parameters

fileName

Name of the xls file to load.

Remarks

If the file doesn't exist, is locked, or is not a valid Excel file, an exception will be thrown.

See Also


C1XLBook.Load Method (String, Boolean)

C1XLBook.Load Method (String, Boolean)

Loads a list of the worksheets in an xls file, optionally skipping the data contained in the sheets.

[Visual Basic]

Overloads Public Sub Load( _

ByVal fileName As String, _

ByVal fillSheets As Boolean _

)

[C#]

public void Load(

string fileName,

bool fillSheets

);

[Delphi]

public procedure Load(

fileName: String;

fillSheets: Boolean

); overload;

Parameters

fileName

Name of the xls file to load.

fillSheets

True to read the sheet data, false to read only the sheet names.

Remarks

Loading the worksheets without their data is much faster than loading the entire workbook. This is useful in situations where you want to examine the contents of the xls file (for example, to ensure that you will not overwrite an existing sheet).

See Also


C1XLBook.PixelsToTwips Method

C1XLBook.PixelsToTwips Method

Converts a pixel measurement into twips (1/20th of a point).

[Visual Basic]

Public Shared Function PixelsToTwips( _

ByVal pix As Double _

) As Integer

[C#]

public static int PixelsToTwips(

Double pix

);

[Delphi]

public class function PixelsToTwips(

pix: Double

): Int32;

Parameters

pix

Measurement in screen pixels.

Return Value

Measurement in twips.

Remarks

Excel stores measurements in twips (1/20th of a point), a resolution-independent unit. .NET controls, on the other hand, usually express measurements in pixels. This method provides an easy way to convert pixel measurements into twips using the current screen resolution.

See Also


C1XLBook.Save Method

C1XLBook.Save Method

Saves the C1XLBook to an xls file.

[Visual Basic]

Public Sub Save( _

ByVal fileName As String _

)

[C#]

public void Save(

string fileName

);

[Delphi]

public procedure Save(

fileName: String

);

Parameters

fileName

Name of the xls file to save.

Remarks

If the file can't be created, an exception will be thrown. This typically indicates that the file is currently open by another application (such as Microsoft Excel).

See Also


C1XLBook.TwipsToPixels Method

C1XLBook.TwipsToPixels Method

Converts a twip measurement into screen pixels.

[Visual Basic]

Public Shared Function TwipsToPixels( _

ByVal twip As Double _

) As Integer

[C#]

public static int TwipsToPixels(

Double twip

);

[Delphi]

public class function TwipsToPixels(

twip: Double

): Int32;

Parameters

twip

Measurement in twips.

Return Value

Measurement in screen pixels.

Remarks

Excel stores measurements in twips (1/20th of a point), a resolution-independent unit. .NET controls, on the other hand, usually express measurements in pixels. This method provides an easy way to convert pixel measurements into twips using the current screen resolution.

See Also


XLAlignHorzEnum Enumeration

XLAlignHorzEnum Enumeration

Specifies how to align cell content horizontally within a cell.

[Visual Basic]

Public Enum XLAlignHorzEnum

[C#]

public enum XLAlignHorzEnum

[Delphi]

type XLAlignHorzEnum = (Center, Fill, General, Justify, Left, Right, Selection, Undefined);

Namespace: C1.C1Excel

Assembly: C1.C1Excel (in c1.c1excel.dll)

Members

Member name | Description
Center | Align to cell center.
Fill | Fill cell, repeating content as necessary.
General | Align strings to the left, numbers to the right.
Justify | Justify content horizontally to span the whole cell width.
Left | Align to cell left.
Right | Align to cell right.
Selection | Align to selection center (may span multiple cells).
Undefined | Not specified (use default).

See Also

C1.C1Excel Namespace


XLAlignVertEnum Enumeration

XLAlignVertEnum Enumeration

Specifies how to align cell content vertically within a cell.

[Visual Basic]

Public Enum XLAlignVertEnum

[C#]

public enum XLAlignVertEnum

[Delphi]

type XLAlignVertEnum = (Bottom, Center, Justify, Top, Undefined);

Namespace: C1.C1Excel

Assembly: C1.C1Excel (in c1.c1excel.dll)

Members

Member name | Description
Bottom | Align to cell bottom.
Center | Align to cell center.
Justify | Justify content vertically to span the whole cell height.
Top | Align to cell top.
Undefined | Not specified (use default).

See Also

C1.C1Excel Namespace


XLCell Class

XLCell Class

Represents individual cells in a XLSheet, and provides properties for getting and setting the cell Value, Style, and Hyperlink.

For a list of all members of this type, see XLCell Members.

System.Object

C1.C1Excel.XLCell

[Visual Basic]

Public Class XLCell

[C#]

public class XLCell

[Delphi]

type XLCell = class;

Remarks

To create cells, use the XLSheet indexer (Item property). If the cell already exists, the reference will be returned as usual. If not, the sheet will create the cell (as well as rows and columns if necessary) and will return a reference to the new cell.

Because it creates cells automatically, the indexer is especially useful when creating and populating sheets.

Example

For example, the code below creates a new C1XLBook, then populates the first sheet with a 10 by 10 multiplication table:

· Visual Basic

· C#

· Delphi

Note how the code simply accesses the cells using the indexer. There's no need to create any rows, columns, or cells. The indexer takes care of all that automatically.

Namespace: C1.C1Excel

Assembly: C1.C1Excel (in c1.c1excel.dll)

See Also


XLCell Members

XLCell Members

XLCell overview

Public Properties

Hyperlink | Gets or sets a string that specifies an action to take when the cell is clicked.
Style | Gets or sets the XLStyle object associated with the cell.
Value | Gets or sets the value stored in the cell .

See Also


XLCell Properties

XLCell Properties

The properties of the XLCell class are listed here. For a complete list of XLCell class members, see the XLCell Members topic.

Public Properties

Hyperlink | Gets or sets a string that specifies an action to take when the cell is clicked.
Style | Gets or sets the XLStyle object associated with the cell.
Value | Gets or sets the value stored in the cell.

See Also


XLCell.Hyperlink Property

XLCell.Hyperlink Property

Gets or sets a string that specifies an action to take when the cell is clicked.

[Visual Basic]

Public Property Hyperlink As String

[C#]

public string Hyperlink {get;set;}

[Delphi]

public property Hyperlink: String read get_Hyperlink write set_Hyperlink;

Remarks

Hyperlinks may contain URLs that when clicked open a browser window and navigate to the specified site (e.g. "http://www.componentone.com"). They may also contain references to files that are launched by the application associated with the file type (e.g. "readme.doc"). Finally, hyperlinks can be used to send e-mails (e.g. "mailto:joe@foo.com").

Each cell may contain a hyperlink and a value. However, if you assign a hyperlink to a cell that has no value (Value == null), then the hyperlink text is automatically assigned to the cell value as well.

See Also


XLCell.Style Property

XLCell.Style Property

Gets or sets the XLStyle object associated with the cell.

[Visual Basic]

Public Property Style As XLStyle

[C#]

public XLStyle Style {get;set;}

[Delphi]

public property Style: XLStyle read get_Style write set_Style;

Remarks

The appearance of each cell is defined by one or more XLStyle objects.

When displaying a cell, Excel combines the row, column, and cell styles and merges the style elements defined in each one in order to determine how the cell should be displayed.

The precedence of the styles is: (1) cell, (2) row, (3) column, (4) default style. For example, if a cell style defines the font and background color, those will be applied regardless of the settings in the row and column styles. If the row style defines an alignment, that will be applied regardless of the column style, and so on.

The cell style may be null, in which case the cell is displayed using the other styles available or the default book style if no others are available.

See Also


XLCell.Value Property

XLCell.Value Property

Gets or sets the value stored in the cell.

[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

The value may contain strings, numeric, boolean, System.DateTime, or null objects. Other types of object cannot be saved into Excel files.

DateTime values are internally converted into doubles, and stored in the sheet as such. The only way to tell the difference between a DateTime value and a double in Excel is by way of the format associated with the cell (Format property).

See Also


XLCellRange Class

XLCellRange Class

Represents a range of XLCell objects in a XLSheet.

For a list of all members of this type, see XLCellRange Members.

System.Object

C1.C1Excel.XLCellRange

[Visual Basic]

Public Class XLCellRange

[C#]

public class XLCellRange

[Delphi]

type XLCellRange = class;

Namespace: C1.C1Excel

Assembly: C1.C1Excel (in c1.c1excel.dll)

See Also


XLCellRange Members

XLCellRange Members

XLCellRange overview

Public Constructors

XLCellRange Constructor

Creates an instance of a XLCellRange object containing an empty range.

Public Properties

ColumnCount | Gets the number of columns in the range.
ColumnFrom | Gets index of the left column in the range.
ColumnTo | Gets or sets the index of the last column in the range.
IsEmpty | Determines whether the range is empty.
RowCount | Gets the number of rows in the range.
RowFrom | Gets the index of the top row in the range.
RowTo | Gets or sets the index of the last row in the range.

Public Methods

Contains | Determines whether the range contains a specific cell.
Intersects | Determines whether the range intersects another range.

See Also


XLCellRange Constructor

XLCellRange Constructor

Overload List

Creates an instance of a XLCellRange object containing an empty range.

[Visual Basic] Public Function New()

[C#] public XLCellRange();

[Delphi] public constructor Create(); overload;

Creates an instance of a XLCellRange object containing a specified range.

[Visual Basic] Public Function New(Integer, Integer, Integer, Integer)

[C#] public XLCellRange(int, int, int, int);

[Delphi] public constructor Create(Int32; Int32; Int32; Int32); overload;

See Also


XLCellRange Constructor ()

XLCellRange Constructor ()

Creates an instance of a XLCellRange object containing an empty range.

[Visual Basic]

Public Function New()

[C#]

public XLCellRange()

[Delphi]

public constructor Create(); overload;

See Also


XLCellRange Constructor (Int32, Int32, Int32, Int32)

XLCellRange Constructor (Int32, Int32, Int32, Int32)

Creates an instance of a XLCellRange object containing a specified range.

[Visual Basic]

Public Function New( _

ByVal rowFrom As Integer, _

ByVal rowTo As Integer, _

ByVal colFrom As Integer, _

ByVal colTo As Integer _

)

[C#]

public XLCellRange(

int rowFrom,

int rowTo,

int colFrom,

int colTo

);

[Delphi]

public constructor Create(

rowFrom: Int32;

rowTo: Int32;

colFrom: Int32;

colTo: Int32

); overload;

Parameters

rowFrom

Top row in the range.

rowTo

Bottom row in the range.

colFrom

Left column in the range.

colTo

Bottom column in the range.

See Also


XLCellRange Properties

XLCellRange Properties

The properties of the XLCellRange class are listed here. For a complete list of XLCellRange class members, see the XLCellRange Members topic.

Public Properties

ColumnCount | Gets the number of columns in the range.
ColumnFrom | Gets index of the left column in the range.
ColumnTo | Gets or sets the index of the last column in the range.
IsEmpty | Determines whether the range is empty.
RowCount | Gets the number of rows in the range.
RowFrom | Gets the index of the top row in the range.
RowTo | Gets or sets the index of the last row in the range.

See Also


XLCellRange.ColumnCount Property

XLCellRange.ColumnCount Property

Gets the number of columns in the range.

[Visual Basic]

Public ReadOnly Property ColumnCount As Integer

[C#]

public int ColumnCount {get;}

[Delphi]

public property ColumnCount: Int32 read get_ColumnCount;

See Also


XLCellRange.ColumnFrom Property

XLCellRange.ColumnFrom Property

Gets index of the left column in the range.

[Visual Basic]

Public ReadOnly Property ColumnFrom As Integer

[C#]

public int ColumnFrom {get;}

[Delphi]

public property ColumnFrom: Int32 read get_ColumnFrom;

See Also


XLCellRange.ColumnTo Property

XLCellRange.ColumnTo Property

Gets or sets the index of the last column in the range.

[Visual Basic]

Public Property ColumnTo As Integer

[C#]

public int ColumnTo {get;set;}

[Delphi]

public property ColumnTo: Int32 read get_ColumnTo write set_ColumnTo;

See Also


XLCellRange.IsEmpty Property

XLCellRange.IsEmpty Property

Determines whether the range 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


XLCellRange.RowCount Property

XLCellRange.RowCount Property

Gets the number of rows in the range.

[Visual Basic]

Public ReadOnly Property RowCount As Integer

[C#]

public int RowCount {get;}

[Delphi]

public property RowCount: Int32 read get_RowCount;

See Also


XLCellRange.RowFrom Property

XLCellRange.RowFrom Property

Gets the index of the top row in the range.

[Visual Basic]

Public ReadOnly Property RowFrom As Integer

[C#]

public int RowFrom {get;}

[Delphi]

public property RowFrom: Int32 read get_RowFrom;

See Also


XLCellRange.RowTo Property

XLCellRange.RowTo Property

Gets or sets the index of the last row in the range.

[Visual Basic]

Public Property RowTo As Integer

[C#]

public int RowTo {get;set;}

[Delphi]

public property RowTo: Int32 read get_RowTo write set_RowTo;

See Also


XLCellRange Methods

XLCellRange Methods

The methods of the XLCellRange class are listed here. For a complete list of XLCellRange class members, see the XLCellRange Members topic.

Public Methods

Contains | Determines whether the range contains a specific cell.
Intersects | Determines whether the range intersects another range.

See Also


XLCellRange.Contains Method

XLCellRange.Contains Method

Determines whether the range contains a specific cell.

[Visual Basic]

Public Function Contains( _

ByVal row As Integer, _

ByVal col As Integer _

) As Boolean

[C#]

public bool Contains(

int row,

int col

);

[Delphi]

public function Contains(

row: Int32;

col: Int32

): Boolean;

See Also


XLCellRange.Intersects Method

XLCellRange.Intersects Method

Determines whether the range intersects another range.

[Visual Basic]

Public Function Intersects( _

ByVal cr As XLCellRange _

) As Boolean

[C#]

public bool Intersects(

XLCellRange cr

);

[Delphi]

public function Intersects(

cr: XLCellRange

): Boolean;

See Also


XLCellRangeCollection Class

XLCellRangeCollection Class

Represents a collection of XLCellRange objects on an XLSheet.

For a list of all members of this type, see XLCellRangeCollection Members.

System.Object

C1.C1Excel.XLCellRangeCollection

[Visual Basic]

Public Class XLCellRangeCollection

Implements ICollection, IEnumerable

[C#]

public class XLCellRangeCollection : ICollection, IEnumerable

[Delphi]

type XLCellRangeCollection = class (TObject, ICollection, IEnumerable);

Namespace: C1.C1Excel

Assembly: C1.C1Excel (in c1.c1excel.dll)

See Also


XLCellRangeCollection Members

XLCellRangeCollection Members

XLCellRangeCollection overview

Public Properties

Count | Gets the number of XLCellRange objects in the collection.
Item | Gets the XLCellRange object at the specified position in the collection.
Sheet | Gets the XLSheet object that owns the collection.

Public Methods

Add | Overloaded. Appends an XLCellRange object to the collection.
Clear | Removes all XLCellRange objects from the collection.
Contains | Checks whether the collection contains a specific XLCellRange object.
IndexOf | Gets the position of an XLCellRange object in the collection.
Insert | Inserts an XLCellRange object at a specific position in the collection.
Remove | Removes an XLCellRange object from the collection.
RemoveAt | Removes an XLCellRange object at a specific position from the collection.

See Also


XLCellRangeCollection Properties

XLCellRangeCollection Properties

The properties of the XLCellRangeCollection class are listed here. For a complete list of XLCellRangeCollection class members, see the XLCellRangeCollection Members topic.

Public Properties

Count | Gets the number of XLCellRange objects in the collection.
Item | Gets the XLCellRange object at the specified position in the collection.
Sheet | Gets the XLSheet object that owns the collection.

See Also


XLCellRangeCollection.Count Property

XLCellRangeCollection.Count Property

Gets the number of XLCellRange objects in the collection.

[Visual Basic]

Public ReadOnly Property Count As Integer

[C#]

public int Count {get;}

[Delphi]

public property Count: Int32 read get_Count;

See Also


XLCellRangeCollection.Item Property

XLCellRangeCollection.Item Property

Gets the XLCellRange object at the specified position in the collection.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As XLCellRange

[C#]

public XLCellRange this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: XLCellRange read get_Item;

See Also


XLCellRangeCollection.Sheet Property

XLCellRangeCollection.Sheet Property

Gets the XLSheet object that owns the collection.

[Visual Basic]

Public ReadOnly Property Sheet As XLSheet

[C#]

public XLSheet Sheet {get;}

[Delphi]

public property Sheet: XLSheet read get_Sheet;

See Also


XLCellRangeCollection Methods

XLCellRangeCollection Methods

The methods of the XLCellRangeCollection class are listed here. For a complete list of XLCellRangeCollection class members, see the XLCellRangeCollection Members topic.

Public Methods

Add | Overloaded. Appends an XLCellRange object to the collection.
Clear | Removes all XLCellRange objects from the collection.
Contains | Checks whether the collection contains a specific XLCellRange object.
IndexOf | Gets the position of an XLCellRange object in the collection.
Insert | Inserts an XLCellRange object at a specific position in the collection.
Remove | Removes an XLCellRange object from the collection.
RemoveAt | Removes an XLCellRange object at a specific position from the collection.

See Also


XLCellRangeCollection.Add Method

XLCellRangeCollection.Add Method

Overload List

Creates an XLCellRange object and appends it to the collection.

[Visual Basic] Overloads Public Function Add(Integer, Integer, Integer, Integer) As XLCellRange

[C#] public XLCellRange Add(int, int, int, int);

[Delphi] public function Add(Int32; Int32; Int32; Int32) : XLCellRange; overload;

Appends an XLCellRange object to the collection.

[Visual Basic] Overloads Public Function Add(XLCellRange) As XLCellRange

[C#] public XLCellRange Add(XLCellRange);

[Delphi] public function Add(XLCellRange) : XLCellRange; overload;

See Also


XLCellRangeCollection.Add Method (Int32, Int32, Int32, Int32)

XLCellRangeCollection.Add Method (Int32, Int32, Int32, Int32)

Creates an XLCellRange object and appends it to the collection.

[Visual Basic]

Overloads Public Function Add( _

ByVal rowIndex As Integer, _

ByVal colIndex As Integer, _

ByVal rowCount As Integer, _

ByVal colCount As Integer _

) As XLCellRange

[C#]

public XLCellRange Add(

int rowIndex,

int colIndex,

int rowCount,

int colCount

);

[Delphi]

public function Add(

rowIndex: Int32;

colIndex: Int32;

rowCount: Int32;

colCount: Int32

): XLCellRange; overload;

Parameters

rowIndex

Index of the top row in the cell range.

colIndex

Index of the left column in the cell range.

rowCount

Number of rows in the cell range.

colCount

Number of columns in the cell range.

Return Value

A reference to the object if it was successfully added to the collection, or null if the object could not be added to the collection (usually because it overlaps another cell range already in the collection).

See Also


XLCellRangeCollection.Add Method (XLCellRange)

XLCellRangeCollection.Add Method (XLCellRange)

Appends an XLCellRange object to the collection.

[Visual Basic]

Overloads Public Function Add( _

ByVal cr As XLCellRange _

) As XLCellRange

[C#]

public XLCellRange Add(

XLCellRange cr

);

[Delphi]

public function Add(

cr: XLCellRange

): XLCellRange; overload;

Parameters

cr

XLCellRange object to add to the collection.

Return Value

A reference to the object if it was successfully added to the collection, or null if the object could not be added to the collection (usually because it overlaps another cell range already in the collection).

See Also


XLCellRangeCollection.Clear Method

XLCellRangeCollection.Clear Method

Removes all XLCellRange objects from the collection.

[Visual Basic]

Public Sub Clear()

[C#]

public void Clear()

[Delphi]

public procedure Clear();

See Also


XLCellRangeCollection.Contains Method

XLCellRangeCollection.Contains Method

Checks whether the collection contains a specific XLCellRange object.

[Visual Basic]

Public Function Contains( _

ByVal cr As XLCellRange _

) As Boolean

[C#]

public bool Contains(

XLCellRange cr

);

[Delphi]

public function Contains(

cr: XLCellRange

): Boolean;

Parameters

cr

XLCellRange object to look for.

Return Value

True if the collection contains the range, False otherwise.

See Also


XLCellRangeCollection.IndexOf Method

XLCellRangeCollection.IndexOf Method

Gets the position of an XLCellRange object in the collection.

[Visual Basic]

Public Function IndexOf( _

ByVal cr As XLCellRange _

) As Integer

[C#]

public int IndexOf(

XLCellRange cr

);

[Delphi]

public function IndexOf(

cr: XLCellRange

): Int32;

Parameters

cr

XLCellRange object to look for.

Return Value

The position of the object in the collection, or -1 if the object is not a member of the collection.

See Also


XLCellRangeCollection.Insert Method

XLCellRangeCollection.Insert Method

Inserts an XLCellRange object at a specific position in the collection.

[Visual Basic]

Public Function Insert( _

ByVal index As Integer, _

ByVal cr As XLCellRange _

) As XLCellRange

[C#]

public XLCellRange Insert(

int index,

XLCellRange cr

);

[Delphi]

public function Insert(

index: Int32;

cr: XLCellRange

): XLCellRange;

Parameters

index

Position where the object will be inserted.

cr

Object to insert in the collection.

Return Value

A reference to the object if it was successfully added to the collection, or null if the object could not be added to the collection (usually because it overlaps another cell range already in the collection).

See Also


XLCellRangeCollection.Remove Method

XLCellRangeCollection.Remove Method

Removes an XLCellRange object from the collection.

[Visual Basic]

Public Sub Remove( _

ByVal cr As XLCellRange _

)

[C#]

public void Remove(

XLCellRange cr

);

[Delphi]

public procedure Remove(

cr: XLCellRange

);

Parameters

cr

XLCellRange object to remove from the collection.

See Also


XLCellRangeCollection.RemoveAt Method

XLCellRangeCollection.RemoveAt Method

Removes an XLCellRange object at a specific position from the collection.

[Visual Basic]

Public Sub RemoveAt( _

ByVal index As Integer _

)

[C#]

public void RemoveAt(

int index

);

[Delphi]

public procedure RemoveAt(

index: Int32

);

Parameters

index

Index of the object to remove from the collection.

See Also


XLColumn Class

XLColumn Class

Represents a column in a worksheet, provides properties for setting the column's width, style, and visibility.

For a list of all members of this type, see XLColumn Members.

System.Object

C1.C1Excel.XLColumn

[Visual Basic]

Public Class XLColumn

[C#]

public class XLColumn

[Delphi]

type XLColumn = class;

Remarks

The XLColumn objects do not contain any data. If you remove a column from the collection, the data will be lost. If you later re-insert that same column back into the collection, the column will be blank.

Namespace: C1.C1Excel

Assembly: C1.C1Excel (in c1.c1excel.dll)

See Also


XLColumn Members

XLColumn Members

XLColumn overview

Public Constructors

XLColumn Constructor

Creates a new instance of the XLColumn class.

Public Properties

Book | Gets a reference to the parent C1XLBook object.
Sheet | Gets a reference to the parent XLSheet object.
Style | Gets or sets the XLStyle object that determines the appearance of the column.
Visible | Gets or sets whether the column is visible.
Width | Gets or sets the width of the column, in twips.

See Also


XLColumn Constructor

XLColumn Constructor

Creates a new instance of the XLColumn class.

[Visual Basic]

Public Function New()

[C#]

public XLColumn()

[Delphi]

public constructor Create();

See Also


XLColumn Properties

XLColumn Properties

The properties of the XLColumn class are listed here. For a complete list of XLColumn class members, see the XLColumn Members topic.

Public Properties

Book | Gets a reference to the parent C1XLBook object.
Sheet | Gets a reference to the parent XLSheet object.
Style | Gets or sets the XLStyle object that determines the appearance of the column.
Visible | Gets or sets whether the column is visible.
Width | Gets or sets the width of the column, in twips.

See Also


XLColumn.Book Property

XLColumn.Book Property

Gets a reference to the parent C1XLBook object.

[Visual Basic]

Public ReadOnly Property Book As C1XLBook

[C#]

public C1XLBook Book {get;}

[Delphi]

public property Book: C1XLBook read get_Book;

See Also


XLColumn.Sheet Property

XLColumn.Sheet Property

Gets a reference to the parent XLSheet object.

[Visual Basic]

Public ReadOnly Property Sheet As XLSheet

[C#]

public XLSheet Sheet {get;}

[Delphi]

public property Sheet: XLSheet read get_Sheet;

See Also


XLColumn.Style Property

XLColumn.Style Property

Gets or sets the XLStyle object that determines the appearance of the column.

[Visual Basic]

Public Property Style As XLStyle

[C#]

public XLStyle Style {get;set;}

[Delphi]

public property Style: XLStyle read get_Style write set_Style;

See Also


XLColumn.Visible Property

XLColumn.Visible Property

Gets or sets whether the column is visible.

[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


XLColumn.Width Property

XLColumn.Width Property

Gets or sets the width of the column, in twips.

[Visual Basic]

Public Property Width As Integer

[C#]

public int Width {get;set;}

[Delphi]

public property Width: Int32 read get_Width write set_Width;

Remarks

A value of -1 indicates that the column should be displayed using the sheet's DefaultColumnWidth.

To convert between pixels and twips, use the TwipsToPixelsand PixelsToTwips methods.

See Also


XLColumnCollection Class

XLColumnCollection Class

Represents a collection of XLColumn objects that represent the individual columns in each XLSheet.

For a list of all members of this type, see XLColumnCollection Members.

System.Object

C1.C1Excel.XLColumnCollection

[Visual Basic]

Public Class XLColumnCollection

Implements ICollection, IEnumerable

[C#]

public class XLColumnCollection : ICollection, IEnumerable

[Delphi]

type XLColumnCollection = class (TObject, ICollection, IEnumerable);

Remarks

The collection has methods for counting, enumerating, adding, and removing columns from the collection.

The XLColumn objects do not contain any data. If you remove a column from the collection, the data will be lost. If you later re-insert that same column back into the collection, the column will be blank.

Example

Note that you can create columns automatically by using the sheet's indexer. For example, the following code retrieves the cell at coordinates (3,3) and in doing so automatically creates four rows and four columns automatically:

· Visual Basic

· C#

· Delphi

Namespace: C1.C1Excel

Assembly: C1.C1Excel (in c1.c1excel.dll)

See Also


XLColumnCollection Members

XLColumnCollection Members

XLColumnCollection overview

Public Properties

Book | Gets a reference to the parent C1XLBook object.
Count | Gets the number of items in the collection.
Item | Returns a reference to the XLColumn object at the specified index.
Sheet | Gets a reference to the parent XLSheet object.

Public Methods

Add | Overloaded. Creates a new XLColumn object and adds it to the collection.
Clear | Removes all items from the collection.
Contains | Determines whether an XLColumn is a member of the collection.
IndexOf | Gets the index of a given XLRow object in the collection.
Insert | Overloaded. Creates a new XLColumn object and inserts it at a specific position in the collection.
Remove | Removes an XLColumn object from the collection.
RemoveAt | Removes the XLColumn object at a given position from the collection.

See Also


XLColumnCollection Properties

XLColumnCollection Properties

The properties of the XLColumnCollection class are listed here. For a complete list of XLColumnCollection class members, see the XLColumnCollection Members topic.

Public Properties

Book | Gets a reference to the parent C1XLBook object.
Count | Gets the number of items in the collection.
Item | Returns a reference to the XLColumn object at the specified index.
Sheet | Gets a reference to the parent XLSheet object.

See Also


XLColumnCollection.Book Property

XLColumnCollection.Book Property

Gets a reference to the parent C1XLBook object.

[Visual Basic]

Public ReadOnly Property Book As C1XLBook

[C#]

public C1XLBook Book {get;}

[Delphi]

public property Book: C1XLBook read get_Book;

See Also


XLColumnCollection.Count Property

XLColumnCollection.Count Property

Gets the number of items in the collection.

[Visual Basic]

Public ReadOnly Property Count As Integer

[C#]

public int Count {get;}

[Delphi]

public property Count: Int32 read get_Count;

See Also


XLColumnCollection.Item Property

XLColumnCollection.Item Property

Returns a reference to the XLColumn object at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As XLColumn

[C#]

public XLColumn this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: XLColumn read get_Item;

Remarks

The indexer will create a new XLColumn object at the specified position if necessary. It never returns null.

See Also


XLColumnCollection.Sheet Property

XLColumnCollection.Sheet Property

Gets a reference to the parent XLSheet object.

[Visual Basic]

Public ReadOnly Property Sheet As XLSheet

[C#]

public XLSheet Sheet {get;}

[Delphi]

public property Sheet: XLSheet read get_Sheet;

See Also


XLColumnCollection Methods

XLColumnCollection Methods

The methods of the XLColumnCollection class are listed here. For a complete list of XLColumnCollection class members, see the XLColumnCollection Members topic.

Public Methods

Add | Overloaded. Creates a new XLColumn object and adds it to the collection.
Clear | Removes all items from the collection.
Contains | Determines whether an XLColumn is a member of the collection.
IndexOf | Gets the index of a given XLRow object in the collection.
Insert | Overloaded. Creates a new XLColumn object and inserts it at a specific position in the collection.
Remove | Removes an XLColumn object from the collection.
RemoveAt | Removes the XLColumn object at a given position from the collection.

See Also


XLColumnCollection.Add Method

XLColumnCollection.Add Method

Overload List

Creates a new XLColumn object and adds it to the collection.

[Visual Basic] Overloads Public Function Add() As XLColumn

[C#] public XLColumn Add();

[Delphi] public function Add() : XLColumn; overload;

Adds an XLColumn object to the collection.

[Visual Basic] Overloads Public Function Add(XLColumn) As XLColumn

[C#] public XLColumn Add(XLColumn);

[Delphi] public function Add(XLColumn) : XLColumn; overload;

See Also


XLColumnCollection.Add Method ()

XLColumnCollection.Add Method ()

Creates a new XLColumn object and adds it to the collection.

[Visual Basic]

Overloads Public Function Add() As XLColumn

[C#]

public XLColumn Add()

[Delphi]

public function Add(): XLColumn; overload;

Return Value

A reference to the new XLColumn object.

See Also


XLColumnCollection.Add Method (XLColumn)

XLColumnCollection.Add Method (XLColumn)

Adds an XLColumn object to the collection.

[Visual Basic]

Overloads Public Function Add( _

ByVal col As XLColumn _

) As XLColumn

[C#]

public XLColumn Add(

XLColumn col

);

[Delphi]

public function Add(

col: XLColumn

): XLColumn; overload;

Parameters

col

The item to add to the collection.

Return Value

A reference to the item that was added to the collection (in this case, always the col parameter).

See Also


XLColumnCollection.Clear Method

XLColumnCollection.Clear Method

Removes all items from the collection.

[Visual Basic]

Public Sub Clear()

[C#]

public void Clear()

[Delphi]

public procedure Clear();

See Also


XLColumnCollection.Contains Method

XLColumnCollection.Contains Method

Determines whether an XLColumn is a member of the collection.

[Visual Basic]

Public Function Contains( _

ByVal col As XLColumn _

) As Boolean

[C#]

public bool Contains(

XLColumn col

);

[Delphi]

public function Contains(

col: XLColumn

): Boolean;

Parameters

col

Item to look for.

Return Value

True if the collection contains the item, False otherwise.

See Also


XLColumnCollection.IndexOf Method

XLColumnCollection.IndexOf Method

Gets the index of a given XLRow object in the collection.

[Visual Basic]

Public Function IndexOf( _

ByVal col As XLColumn _

) As Integer

[C#]

public int IndexOf(

XLColumn col

);

[Delphi]

public function IndexOf(

col: XLColumn

): Int32;

Parameters

col

Item to look for.

Return Value

The position of the item in the collection, or -1 if the item is not a member of the collection.

See Also


XLColumnCollection.Insert Method

XLColumnCollection.Insert Method

Overload List

Creates a new XLColumn object and inserts it at a specific position in the collection.

[Visual Basic] Overloads Public Function Insert(Integer) As XLColumn

[C#] public XLColumn Insert(int);

[Delphi] public function Insert(Int32) : XLColumn; overload;

Inserts an XLColumn object at a specific position in the collection.

[Visual Basic] Overloads Public Function Insert(Integer, XLColumn) As XLColumn

[C#] public XLColumn Insert(int, XLColumn);

[Delphi] public function Insert(Int32; XLColumn) : XLColumn; overload;

See Also


XLColumnCollection.Insert Method (Int32)

XLColumnCollection.Insert Method (Int32)

Creates a new XLColumn object and inserts it at a specific position in the collection.

[Visual Basic]

Overloads Public Function Insert( _

ByVal index As Integer _

) As XLColumn

[C#]

public XLColumn Insert(

int index

);

[Delphi]

public function Insert(

index: Int32

): XLColumn; overload;

Parameters

index

Position where the new item will be inserted.

Return Value

A reference to the new item.

See Also


XLColumnCollection.Insert Method (Int32, XLColumn)

XLColumnCollection.Insert Method (Int32, XLColumn)

Inserts an XLColumn object at a specific position in the collection.

[Visual Basic]

Overloads Public Function Insert( _

ByVal index As Integer, _

ByVal col As XLColumn _

) As XLColumn

[C#]

public XLColumn Insert(

int index,

XLColumn col

);

[Delphi]

public function Insert(

index: Int32;

col: XLColumn

): XLColumn; overload;

Parameters

index

Position where the item will be inserted.

col

Item that will be inserted.

Return Value

A reference to the item that was added to the collection.

Remarks

The maximum number of XLColumn objects in a XLSheet is 256. This is a limitation imposed by Excel.

See Also


XLColumnCollection.Remove Method

XLColumnCollection.Remove Method

Removes an XLColumn object from the collection.

[Visual Basic]

Public Function Remove( _

ByVal col As XLColumn _

) As XLColumn

[C#]

public XLColumn Remove(

XLColumn col

);

[Delphi]

public function Remove(

col: XLColumn

): XLColumn;

Parameters

col

Item to be removed from the collection.

Return Value

A reference to the item that was removed.

See Also


XLColumnCollection.RemoveAt Method

XLColumnCollection.RemoveAt Method

Removes the XLColumn object at a given position from the collection.

[Visual Basic]

Public Function RemoveAt( _

ByVal index As Integer _

) As XLColumn

[C#]

public XLColumn RemoveAt(

int index

);

[Delphi]

public function RemoveAt(

index: Int32

): XLColumn;

Parameters

index

Index of the item to remove from the collection.

Return Value

A reference to the item that was removed from the collection.

See Also


XLDiagonalFlags Enumeration

XLDiagonalFlags Enumeration

Specifies the type of diagonal line to draw across the cells.

[Visual Basic]

Public Enum XLDiagonalFlags

[C#]

public enum XLDiagonalFlags

[Delphi]

type XLDiagonalFlags = (Backward, Forward, None);

Namespace: C1.C1Excel

Assembly: C1.C1Excel (in c1.c1excel.dll)

Members

Member name | Description
Backward | Backward diagonal (\).
Forward | Forward diagonal (/).
None | No diagonal.

See Also

C1.C1Excel Namespace


XLLineStyleEnum Enumeration

XLLineStyleEnum Enumeration

Specifies the line style used for the cell borders.

[Visual Basic]

Public Enum XLLineStyleEnum

[C#]

public enum XLLineStyleEnum

[Delphi]

type XLLineStyleEnum = (Dashed, Dotted, Double, Hair, Medium, MediumDashDotDotted, MediumDashDotted, MediumDashed, None, SlantedMediumDashDotted, Thick, Thin, ThinDashDotDotted, ThinDashDotted);

Namespace: C1.C1Excel

Assembly: C1.C1Excel (in c1.c1excel.dll)

Members

Member name | Description
Dashed | Dashed.
Dotted | Dotted.
Double | Double.
Hair | Hair (one pixel).
Medium | Medium.
MediumDashDotDotted | Medium dash-dot-dot.
MediumDashDotted | Medium dash-dot.
MediumDashed | Medium dashed.
None | No line.
SlantedMediumDashDotted | Slanted dash-dot.
Thick | Thick.
Thin | Thin.
ThinDashDotDotted | Thin dash-dot-dot.
ThinDashDotted | Thin dash-dot.

See Also

C1.C1Excel Namespace


XLPatternEnum Enumeration

XLPatternEnum Enumeration

Specifies the pattern used for To fill the cell background.

[Visual Basic]

Public Enum XLPatternEnum

[C#]

public enum XLPatternEnum

[Delphi]

type XLPatternEnum = (DiagonalCrosshatch, DiagonalStripe, Gray06, Gray12, Gray25, Gray50, Gray75, HorizontalStripe, None, ReverseDiagonalStripe, Solid, ThickDiagonalCrosshatch, ThinDiagonalCrosshatch, ThinDiagonalStripe, ThinHorizontalCrosshatch, ThinHorizontalStripe, ThinReverseDiagonalStripe, ThinVerticalStripe, VerticalStripe);

Namespace: C1.C1Excel

Assembly: C1.C1Excel (in c1.c1excel.dll)

Members

Member name | Description
DiagonalCrosshatch | Diagonal crosshatch pattern.
DiagonalStripe | Diagonal stripe pattern (/).
Gray06 | 6% dotted pattern.
Gray12 | 12% dotted pattern.
Gray25 | 25% dotted pattern.
Gray50 | 50% dotted pattern.
Gray75 | 75% dotted pattern.
HorizontalStripe | Horizontal stripe pattern.
None | No pattern (transparent).
ReverseDiagonalStripe | Reverse diagonal stripe pattern (\).
Solid | Solid background.
ThickDiagonalCrosshatch | Thick diagonal crosshatch pattern.
ThinDiagonalCrosshatch | Thin diagonal crosshatch pattern.
ThinDiagonalStripe | Thin diagonal stripe pattern (/).
ThinHorizontalCrosshatch | Thin horizontal crosshatch pattern.
ThinHorizontalStripe | Thin horizontal stripe pattern.
ThinReverseDiagonalStripe | Thin reverse diagonal stripe pattern (\).
ThinVerticalStripe | Thin vertical stripe pattern.
VerticalStripe | Vertical stripe pattern.

See Also

C1.C1Excel Namespace


XLPrintSettings Class

XLPrintSettings Class

Provides options and settings for printing XLSheet objects.

For a list of all members of this type, see XLPrintSettings Members.

System.Object

C1.C1Excel.XLPrintSettings

[Visual Basic]

Public Class XLPrintSettings

[C#]

public class XLPrintSettings

[Delphi]

type XLPrintSettings = class;

Remarks

The settings are applied to each sheet, and are accessible through the sheet's PrintSettings property.

Note that C1XLBook does not provide any printing services. The settings are used when printing the sheet from Excel.

Namespace: C1.C1Excel

Assembly: C1.C1Excel (in c1.c1excel.dll)

See Also


XLPrintSettings Members

XLPrintSettings Members

XLPrintSettings overview

Public Constructors

XLPrintSettings Constructor

Creates a new instance of the XLPrintSettings class.

Public Properties

BlackAndWhite | Gets or sets whether to print the sheet in monochrome mode.
CenterHorizontal | Gets or sets whether the sheet should be centered horizontally on the page when printed.
CenterVertical | Gets or sets whether the sheet should be centered vertically on the page when printed.
Copies | Gets or sets the number of copies to print.
DraftQuality | Gets or sets whether to print the sheet in draft quality mode.
FitPagesAcross | Fit the sheet to this number of pages across (0 means use as many as needed).
FitPagesDown | Fit the sheet to this number of pages down (0 means use as many as needed).
Footer | Gets or sets the string to be displayed as a page header when the sheet is printed.
Header | Gets or sets the string to be displayed as a page header when the sheet is printed.
Landscape | Gets or sets whether to print the sheet in landscape mode.
MarginBottom | Gets or sets the bottom margin, in inches. Set to a negative value to use the default margin.
MarginFooter | Gets or sets the footer margin, in inches. Set to a negative value to use the default margin.
MarginHeader | Gets or sets the header margin, in inches. Set to a negative value to use the default margin.
MarginLeft | Gets or sets the left margin, in inches. Set to a negative value to use the default margin.
MarginRight | Gets or sets the right margin, in inches. Set to a negative value to use the default margin.
MarginTop | Gets or sets the top margin, in inches. Set to a negative value to use the default margin.
PaperKind | Gets or sets the paper size to use when printing the sheet.
PrintGridlines | Gets or sets whether the gridlines will be printed.
PrintHeaders | Gets or sets whether row and column headers (the areas with row numbers and column letters) will be printed.
PrintPagesInRows | Gets or sets whether to print the pages in rows (across first) or in columns (down first).
ScalingFactor | Gets or sets the scaling factor (in percent) to use when printing the sheet.
StartPage | Gets or sets the initial page number to use when printing the sheet.

See Also


XLPrintSettings Constructor

XLPrintSettings Constructor

Creates a new instance of the XLPrintSettings class.

[Visual Basic]

Public Function New()

[C#]

public XLPrintSettings()

[Delphi]

public constructor Create();

See Also


XLPrintSettings Properties

XLPrintSettings Properties

The properties of the XLPrintSettings class are listed here. For a complete list of XLPrintSettings class members, see the XLPrintSettings Members topic.

Public Properties

BlackAndWhite | Gets or sets whether to print the sheet in monochrome mode.
CenterHorizontal | Gets or sets whether the sheet should be centered horizontally on the page when printed.
CenterVertical | Gets or sets whether the sheet should be centered vertically on the page when printed.
Copies | Gets or sets the number of copies to print.
DraftQuality | Gets or sets whether to print the sheet in draft quality mode.
FitPagesAcross | Fit the sheet to this number of pages across (0 means use as many as needed).
FitPagesDown | Fit the sheet to this number of pages down (0 means use as many as needed).
Footer | Gets or sets the string to be displayed as a page header when the sheet is printed.
Header | Gets or sets the string to be displayed as a page header when the sheet is printed.
Landscape | Gets or sets whether to print the sheet in landscape mode.
MarginBottom | Gets or sets the bottom margin, in inches. Set to a negative value to use the default margin.
MarginFooter | Gets or sets the footer margin, in inches. Set to a negative value to use the default margin.
MarginHeader | Gets or sets the header margin, in inches. Set to a negative value to use the default margin.
MarginLeft | Gets or sets the left margin, in inches. Set to a negative value to use the default margin.
MarginRight | Gets or sets the right margin, in inches. Set to a negative value to use the default margin.
MarginTop | Gets or sets the top margin, in inches. Set to a negative value to use the default margin.
PaperKind | Gets or sets the paper size to use when printing the sheet.
PrintGridlines | Gets or sets whether the gridlines will be printed.
PrintHeaders | Gets or sets whether row and column headers (the areas with row numbers and column letters) will be printed.
PrintPagesInRows | Gets or sets whether to print the pages in rows (across first) or in columns (down first).
ScalingFactor | Gets or sets the scaling factor (in percent) to use when printing the sheet.
StartPage | Gets or sets the initial page number to use when printing the sheet.

See Also


XLPrintSettings.BlackAndWhite Property

XLPrintSettings.BlackAndWhite Property

Gets or sets whether to print the sheet in monochrome mode.

[Visual Basic]

Public Property BlackAndWhite As Boolean

[C#]

public bool BlackAndWhite {get;set;}

[Delphi]

public property BlackAndWhite: Boolean read get_BlackAndWhite write set_BlackAndWhite;

See Also


XLPrintSettings.CenterHorizontal Property

XLPrintSettings.CenterHorizontal Property

Gets or sets whether the sheet should be centered horizontally on the page when printed.

[Visual Basic]

Public Property CenterHorizontal As Boolean

[C#]

public bool CenterHorizontal {get;set;}

[Delphi]

public property CenterHorizontal: Boolean read get_CenterHorizontal write set_CenterHorizontal;

See Also


XLPrintSettings.CenterVertical Property

XLPrintSettings.CenterVertical Property

Gets or sets whether the sheet should be centered vertically on the page when printed.

[Visual Basic]

Public Property CenterVertical As Boolean

[C#]

public bool CenterVertical {get;set;}

[Delphi]

public property CenterVertical: Boolean read get_CenterVertical write set_CenterVertical;

See Also


XLPrintSettings.Copies Property

XLPrintSettings.Copies Property

Gets or sets the number of copies to print.

[Visual Basic]

Public Property Copies As Integer

[C#]

public int Copies {get;set;}

[Delphi]

public property Copies: Int32 read get_Copies write set_Copies;

See Also


XLPrintSettings.DraftQuality Property

XLPrintSettings.DraftQuality Property

Gets or sets whether to print the sheet in draft quality mode.

[Visual Basic]

Public Property DraftQuality As Boolean

[C#]

public bool DraftQuality {get;set;}

[Delphi]

public property DraftQuality: Boolean read get_DraftQuality write set_DraftQuality;

See Also


XLPrintSettings.FitPagesAcross Property

XLPrintSettings.FitPagesAcross Property

Fit the sheet to this number of pages across (0 means use as many as needed).

[Visual Basic]

Public Property FitPagesAcross As Integer

[C#]

public int FitPagesAcross {get;set;}

[Delphi]

public property FitPagesAcross: Int32 read get_FitPagesAcross write set_FitPagesAcross;

Remarks

CD2HDcmtr_:Comment_remarksText:P:C1.C1Excel.XLPrintSettings.FitPagesAcross%auses C1Excel to select fit to page print mode, ignoring the value of the ScalingFactor property. Setting the FitPagesAcross or FitPagesDown properties automatically sets the C1.C1Excel.XLPrintSettings.AutoScale property to true, causing C1Excel to calculate the scaling factor based on the given number of pages and to ignore the value of the ScalingFactor property.

See Also


XLPrintSettings.FitPagesDown Property

XLPrintSettings.FitPagesDown Property

Fit the sheet to this number of pages down (0 means use as many as needed).

[Visual Basic]

Public Property FitPagesDown As Integer

[C#]

public int FitPagesDown {get;set;}

[Delphi]

public property FitPagesDown: Int32 read get_FitPagesDown write set_FitPagesDown;

Remarks

Setting the FitPagesAcross or FitPagesDown properties automatically sets the C1.C1Excel.XLPrintSettings.AutoScale property to true, causing C1Excel to calculate the scaling factor based on the given number of pages and to ignore the value of the ScalingFactor property.

See Also


XLPrintSettings.Footer Property

XLPrintSettings.Footer Property

Gets or sets the string to be displayed as a page header when the sheet is printed.

[Visual Basic]

Public Property Footer As String

[C#]

public string Footer {get;set;}

[Delphi]

public property Footer: String read get_Footer write set_Footer;

Remarks

The footer string has the same structure and embedded commands as the header string. See the Header property for details.

See Also


XLPrintSettings.Header Property

XLPrintSettings.Header Property

Gets or sets the string to be displayed as a page header when the sheet is printed.

[Visual Basic]

Public Property Header As String

[C#]

public string Header {get;set;}

[Delphi]

public property Header: String read get_Header write set_Header;

Remarks

The header string may contain special commands, i.e. placeholders for the page number, current date, or text formatting attributes. Most of these fields are represented by single letters with a leading ampersand ("&").

The page header is divided into 3 sections: left, center, and right. Each section is introduced by a special command ("&L", "&C", and "&R"). All text and all commands following are part of the selected section.

The following commands are available:

&L Start of the left section

&C Start of the centered section

&R Start of the right section

&P Current page number

&N Page count

&D Current date

&T Current time

&A Sheet name

&F File name without path

&Z File path without file name

&G Picture (file name)

&B Bold toggle

&I Italic toggle

&U Underline toggle

&E Double underline toggle

&S Strikeout toggle

&X Superscript toggle

&Y Subscript toggle

&"[fontname]" Set new font

&"[fontname,fontstyle]" Set new font with specified style. The style is in most cases "Regular", "Bold", "Italic", or "Bold Italic".

&[fontheight] Set font height in points.

See Also


XLPrintSettings.Landscape Property

XLPrintSettings.Landscape Property

Gets or sets whether to print the sheet in landscape mode.

[Visual Basic]

Public Property Landscape As Boolean

[C#]

public bool Landscape {get;set;}

[Delphi]

public property Landscape: Boolean read get_Landscape write set_Landscape;

See Also


XLPrintSettings.MarginBottom Property

XLPrintSettings.MarginBottom Property

Gets or sets the bottom margin, in inches. Set to a negative value to use the default margin.

[Visual Basic]

Public Property MarginBottom As Double

[C#]

public Double MarginBottom {get;set;}

[Delphi]

public property MarginBottom: Double read get_MarginBottom write set_MarginBottom;

See Also


XLPrintSettings.MarginFooter Property

XLPrintSettings.MarginFooter Property

Gets or sets the footer margin, in inches. Set to a negative value to use the default margin.

[Visual Basic]

Public Property MarginFooter As Double

[C#]

public Double MarginFooter {get;set;}

[Delphi]

public property MarginFooter: Double read get_MarginFooter write set_MarginFooter;

See Also


XLPrintSettings.MarginHeader Property

XLPrintSettings.MarginHeader Property

Gets or sets the header margin, in inches. Set to a negative value to use the default margin.

[Visual Basic]

Public Property MarginHeader As Double

[C#]

public Double MarginHeader {get;set;}

[Delphi]

public property MarginHeader: Double read get_MarginHeader write set_MarginHeader;

See Also


XLPrintSettings.MarginLeft Property

XLPrintSettings.MarginLeft Property

Gets or sets the left margin, in inches. Set to a negative value to use the default margin.

[Visual Basic]

Public Property MarginLeft As Double

[C#]

public Double MarginLeft {get;set;}

[Delphi]

public property MarginLeft: Double read get_MarginLeft write set_MarginLeft;

See Also


XLPrintSettings.MarginRight Property

XLPrintSettings.MarginRight Property

Gets or sets the right margin, in inches. Set to a negative value to use the default margin.

[Visual Basic]

Public Property MarginRight As Double

[C#]

public Double MarginRight {get;set;}

[Delphi]

public property MarginRight: Double read get_MarginRight write set_MarginRight;

See Also


XLPrintSettings.MarginTop Property

XLPrintSettings.MarginTop Property

Gets or sets the top margin, in inches. Set to a negative value to use the default margin.

[Visual Basic]

Public Property MarginTop As Double

[C#]

public Double MarginTop {get;set;}

[Delphi]

public property MarginTop: Double read get_MarginTop write set_MarginTop;

See Also


XLPrintSettings.PaperKind Property

XLPrintSettings.PaperKind Property

Gets or sets the paper size to use when printing the sheet.

[Visual Basic]

Public Property PaperKind As PaperKind

[C#]

public PaperKind PaperKind {get;set;}

[Delphi]

public property PaperKind: PaperKind read get_PaperKind write set_PaperKind;

See Also


XLPrintSettings.PrintGridlines Property

XLPrintSettings.PrintGridlines Property

Gets or sets whether the gridlines will be printed.

[Visual Basic]

Public Property PrintGridlines As Boolean

[C#]

public bool PrintGridlines {get;set;}

[Delphi]

public property PrintGridlines: Boolean read get_PrintGridlines write set_PrintGridlines;

See Also


XLPrintSettings.PrintHeaders Property

XLPrintSettings.PrintHeaders Property

Gets or sets whether row and column headers (the areas with row numbers and column letters) will be printed.

[Visual Basic]

Public Property PrintHeaders As Boolean

[C#]

public bool PrintHeaders {get;set;}

[Delphi]

public property PrintHeaders: Boolean read get_PrintHeaders write set_PrintHeaders;

See Also


XLPrintSettings.PrintPagesInRows Property

XLPrintSettings.PrintPagesInRows Property

Gets or sets whether to print the pages in rows (across first) or in columns (down first).

[Visual Basic]

Public Property PrintPagesInRows As Boolean

[C#]

public bool PrintPagesInRows {get;set;}

[Delphi]

public property PrintPagesInRows: Boolean read get_PrintPagesInRows write set_PrintPagesInRows;

See Also


XLPrintSettings.ScalingFactor Property

XLPrintSettings.ScalingFactor Property

Gets or sets the scaling factor (in percent) to use when printing the sheet.

[Visual Basic]

Public Property ScalingFactor As Integer

[C#]

public int ScalingFactor {get;set;}

[Delphi]

public property ScalingFactor: Int32 read get_ScalingFactor write set_ScalingFactor;

Remarks

Setting the ScalingFactor property automatically sets the C1.C1Excel.XLPrintSettings.AutoScaleproperty to false, causing C1Excel to use the selected scaling factor and to ignore the value of the FitPagesAcross and FitPagesDown properties.

See Also


XLPrintSettings.StartPage Property

XLPrintSettings.StartPage Property

Gets or sets the initial page number to use when printing the sheet.

[Visual Basic]

Public Property StartPage As Integer

[C#]

public int StartPage {get;set;}

[Delphi]

public property StartPage: Int32 read get_StartPage write set_StartPage;

See Also


XLRow Class

XLRow Class

Represents a row in a worksheet, provides properties for setting the row's height, style, and visibility.

For a list of all members of this type, see XLRow Members.

System.Object

C1.C1Excel.XLRow

[Visual Basic]

Public Class XLRow

[C#]

public class XLRow

[Delphi]

type XLRow = class;

Namespace: C1.C1Excel

Assembly: C1.C1Excel (in c1.c1excel.dll)

See Also


XLRow Members

XLRow Members

XLRow overview

Public Constructors

XLRow Constructor

Creates a new instance of the XLRow class.

Public Properties

Book | Gets a reference to the parent C1XLBook object.
Height | Gets or sets the height of the row, in twips.
Sheet | Gets a reference to the parent XLSheet object.
Style | Gets or sets the XLStyle object that determines the appearance of the row.
Visible | Gets or sets whether the row is visible.

See Also


XLRow Constructor

XLRow Constructor

Creates a new instance of the XLRow class.

[Visual Basic]

Public Function New()

[C#]

public XLRow()

[Delphi]

public constructor Create();

See Also


XLRow Properties

XLRow Properties

The properties of the XLRow class are listed here. For a complete list of XLRow class members, see the XLRow Members topic.

Public Properties

Book | Gets a reference to the parent C1XLBook object.
Height | Gets or sets the height of the row, in twips.
Sheet | Gets a reference to the parent XLSheet object.
Style | Gets or sets the XLStyle object that determines the appearance of the row.
Visible | Gets or sets whether the row is visible.

See Also


XLRow.Book Property

XLRow.Book Property

Gets a reference to the parent C1XLBook object.

[Visual Basic]

Public ReadOnly Property Book As C1XLBook

[C#]

public C1XLBook Book {get;}

[Delphi]

public property Book: C1XLBook read get_Book;

See Also


XLRow.Height Property

XLRow.Height Property

Gets or sets the height of the row, in twips.

[Visual Basic]

Public Property Height As Integer

[C#]

public int Height {get;set;}

[Delphi]

public property Height: Int32 read get_Height write set_Height;

Remarks

A value of -1 indicates that the row should be displayed using the sheet's DefaultRowHeight.

To convert between pixels and twips, use the TwipsToPixels and PixelsToTwips methods.

See Also


XLRow.Sheet Property

XLRow.Sheet Property

Gets a reference to the parent XLSheet object.

[Visual Basic]

Public ReadOnly Property Sheet As XLSheet

[C#]

public XLSheet Sheet {get;}

[Delphi]

public property Sheet: XLSheet read get_Sheet;

See Also


XLRow.Style Property

XLRow.Style Property

Gets or sets the XLStyle object that determines the appearance of the row.

[Visual Basic]

Public Property Style As XLStyle

[C#]

public XLStyle Style {get;set;}

[Delphi]

public property Style: XLStyle read get_Style write set_Style;

See Also


XLRow.Visible Property

XLRow.Visible Property

Gets or sets whether the row is visible.

[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


XLRowCollection Class

XLRowCollection Class

Represents a collection of XLRow objects that represent the individual rows in each XLSheet.

For a list of all members of this type, see XLRowCollection Members.

System.Object

C1.C1Excel.XLRowCollection

[Visual Basic]

Public Class XLRowCollection

Implements ICollection, IEnumerable

[C#]

public class XLRowCollection : ICollection, IEnumerable

[Delphi]

type XLRowCollection = class (TObject, ICollection, IEnumerable);

Remarks

The collection has methods for counting, enumerating, adding, and removing rows from the collection.

Example

Note that you can create rows automatically by using the sheet's indexer. For example, the following code retrieves the cell at coordinates (3,3) and in doing so automatically creates four rows and four columns automatically:

· Visual Basic

· C#

· Delphi

Namespace: C1.C1Excel

Assembly: C1.C1Excel (in c1.c1excel.dll)

See Also


XLRowCollection Members

XLRowCollection Members

XLRowCollection overview

Public Properties

Book | Gets a reference to the parent C1XLBook object.
Count | Gets the number of items in the collection.
Item | Returns a reference to the XLRow object at the specified index.
Sheet | Gets a reference to the parent XLSheet object.

Public Methods

Add | Overloaded. Creates a new XLRow object and adds it to the collection.
Clear | Removes all items from the collection.
Contains | Determines whether an XLRow is a member of the collection.
IndexOf | Gets the index of a given XLRow object in the collection.
Insert | Overloaded. Creates a new XLRow object and inserts it at a specific position in the collection.
Remove | Removes an XLRow object from the collection.
RemoveAt | Removes the XLRow object at a given position from the collection.

See Also


XLRowCollection Properties

XLRowCollection Properties

The properties of the XLRowCollection class are listed here. For a complete list of XLRowCollection class members, see the XLRowCollection Members topic.

Public Properties

Book | Gets a reference to the parent C1XLBook object.
Count | Gets the number of items in the collection.
Item | Returns a reference to the XLRow object at the specified index.
Sheet | Gets a reference to the parent XLSheet object.

See Also


XLRowCollection.Book Property

XLRowCollection.Book Property

Gets a reference to the parent C1XLBook object.

[Visual Basic]

Public ReadOnly Property Book As C1XLBook

[C#]

public C1XLBook Book {get;}

[Delphi]

public property Book: C1XLBook read get_Book;

See Also


XLRowCollection.Count Property

XLRowCollection.Count Property

Gets the number of items in the collection.

[Visual Basic]

Public ReadOnly Property Count As Integer

[C#]

public int Count {get;}

[Delphi]

public property Count: Int32 read get_Count;

See Also


XLRowCollection.Item Property

XLRowCollection.Item Property

Returns a reference to the XLRow object at the specified index.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As XLRow

[C#]

public XLRow this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: XLRow read get_Item;

Remarks

The indexer will create a new XLRow object at the specified position if necessary. It never returns null.

See Also


XLRowCollection.Sheet Property

XLRowCollection.Sheet Property

Gets a reference to the parent XLSheet object.

[Visual Basic]

Public ReadOnly Property Sheet As XLSheet

[C#]

public XLSheet Sheet {get;}

[Delphi]

public property Sheet: XLSheet read get_Sheet;

See Also


XLRowCollection Methods

XLRowCollection Methods

The methods of the XLRowCollection class are listed here. For a complete list of XLRowCollection class members, see the XLRowCollection Members topic.

Public Methods

Add | Overloaded. Creates a new XLRow object and adds it to the collection.
Clear | Removes all items from the collection.
Contains | Determines whether an XLRow is a member of the collection.
IndexOf | Gets the index of a given XLRow object in the collection.
Insert | Overloaded. Creates a new XLRow object and inserts it at a specific position in the collection.
Remove | Removes an XLRow object from the collection.
RemoveAt | Removes the XLRow object at a given position from the collection.

See Also


XLRowCollection.Add Method

XLRowCollection.Add Method

Overload List

Creates a new XLRow object and adds it to the collection.

[Visual Basic] Overloads Public Function Add() As XLRow

[C#] public XLRow Add();

[Delphi] public function Add() : XLRow; overload;

Adds an XLRow object to the collection.

[Visual Basic] Overloads Public Function Add(XLRow) As XLRow

[C#] public XLRow Add(XLRow);

[Delphi] public function Add(XLRow) : XLRow; overload;

See Also


XLRowCollection.Add Method ()

XLRowCollection.Add Method ()

Creates a new XLRow object and adds it to the collection.

[Visual Basic]

Overloads Public Function Add() As XLRow

[C#]

public XLRow Add()

[Delphi]

public function Add(): XLRow; overload;

Return Value

A reference to the new XLRow object.

See Also


XLRowCollection.Add Method (XLRow)

XLRowCollection.Add Method (XLRow)

Adds an XLRow object to the collection.

[Visual Basic]

Overloads Public Function Add( _

ByVal row As XLRow _

) As XLRow

[C#]

public XLRow Add(

XLRow row

);

[Delphi]

public function Add(

row: XLRow

): XLRow; overload;

Parameters

row

The item to add to the collection.

Return Value

A reference to the item that was added to the collection (in this case, always the row parameter).

See Also


XLRowCollection.Clear Method

XLRowCollection.Clear Method

Removes all items from the collection.

[Visual Basic]

Public Sub Clear()

[C#]

public void Clear()

[Delphi]

public procedure Clear();

See Also


XLRowCollection.Contains Method

XLRowCollection.Contains Method

Determines whether an XLRow is a member of the collection.

[Visual Basic]

Public Function Contains( _

ByVal row As XLRow _

) As Boolean

[C#]

public bool Contains(

XLRow row

);

[Delphi]

public function Contains(

row: XLRow

): Boolean;

Parameters

row

Item to look for.

Return Value

True if the collection contains the item, False otherwise.

See Also


XLRowCollection.IndexOf Method

XLRowCollection.IndexOf Method

Gets the index of a given XLRow object in the collection.

[Visual Basic]

Public Function IndexOf( _

ByVal row As XLRow _

) As Integer

[C#]

public int IndexOf(

XLRow row

);

[Delphi]

public function IndexOf(

row: XLRow

): Int32;

Parameters

row

Item to look for.

Return Value

The position of the item in the collection, or -1 if the item is not a member of the collection.

See Also


XLRowCollection.Insert Method

XLRowCollection.Insert Method

Overload List

Creates a new XLRow object and inserts it at a specific position in the collection.

[Visual Basic] Overloads Public Function Insert(Integer) As XLRow

[C#] public XLRow Insert(int);

[Delphi] public function Insert(Int32) : XLRow; overload;

Inserts an XLRow object at a specific position in the collection.

[Visual Basic] Overloads Public Function Insert(Integer, XLRow) As XLRow

[C#] public XLRow Insert(int, XLRow);

[Delphi] public function Insert(Int32; XLRow) : XLRow; overload;

See Also


XLRowCollection.Insert Method (Int32)

XLRowCollection.Insert Method (Int32)

Creates a new XLRow object and inserts it at a specific position in the collection.

[Visual Basic]

Overloads Public Function Insert( _

ByVal index As Integer _

) As XLRow

[C#]

public XLRow Insert(

int index

);

[Delphi]

public function Insert(

index: Int32

): XLRow; overload;

Parameters

index

Position where the new item will be inserted.

Return Value

A reference to the new item.

See Also


XLRowCollection.Insert Method (Int32, XLRow)

XLRowCollection.Insert Method (Int32, XLRow)

Inserts an XLRow object at a specific position in the collection.

[Visual Basic]

Overloads Public Function Insert( _

ByVal index As Integer, _

ByVal row As XLRow _

) As XLRow

[C#]

public XLRow Insert(

int index,

XLRow row

);

[Delphi]

public function Insert(

index: Int32;

row: XLRow

): XLRow; overload;

Parameters

index

Position where the item will be inserted.

row

Item that will be inserted.

Return Value

A reference to the item that was added to the collection.

Remarks

The maximum number of XLRow objects in a XLSheet is 65,536. This is a limitation imposed by Excel.

See Also


XLRowCollection.Remove Method

XLRowCollection.Remove Method

Removes an XLRow object from the collection.

[Visual Basic]

Public Function Remove( _

ByVal row As XLRow _

) As XLRow

[C#]

public XLRow Remove(

XLRow row

);

[Delphi]

public function Remove(

row: XLRow

): XLRow;

Parameters

row

Item to be removed from the collection.

Return Value

A reference to the item that was removed.

See Also


XLRowCollection.RemoveAt Method

XLRowCollection.RemoveAt Method

Removes the XLRow object at a given position from the collection.

[Visual Basic]

Public Function RemoveAt( _

ByVal index As Integer _

) As XLRow

[C#]

public XLRow RemoveAt(

int index

);

[Delphi]

public function RemoveAt(

index: Int32

): XLRow;

Parameters

index

Index of the item to remove from the collection.

Return Value

A reference to the item that was removed from the collection.

See Also


XLSheet Class

XLSheet Class

Represents individual worksheets in an Excel workbook (C1XLBook).

For a list of all members of this type, see XLSheet Members.

System.Object

C1.C1Excel.XLSheet

[Visual Basic]

Public Class XLSheet

[C#]

public class XLSheet

[Delphi]

type XLSheet = class;

Remarks

Provides indexers to get or set the value of individual cells (XLCell) and to access the Rows and Columns on the sheet.

Example

Use the C1XLBook Sheets indexer to get an individual sheet. For example, the code below gets a reference to the first sheet on the book, then prints the number of rows and columns on the sheet:

· Visual Basic

· C#

· Delphi

Namespace: C1.C1Excel

Assembly: C1.C1Excel (in c1.c1excel.dll)

See Also


XLSheet Members

XLSheet Members

XLSheet overview

Public Properties

Book | Gets a reference to the C1XLBook that owns the sheet.
Columns | Gets a reference to sheet's column collection.
DefaultColumnWidth | Gets or sets the default row height for the sheet (in twips).
DefaultRowHeight | Gets or sets the default row height for the sheet (in twips).
Locked | Gets or sets a value that determines if the sheet is locked for editing.
MergedCells | Gets a XLCellRangeCollection that contains the collection of cells that are merged on the sheet.
Name | Gets or sets the name of the XLSheet.
PrintSettings | Gets or sets an XLPrintSettings object that controls how the sheet is printed.
Rows | Gets a reference to sheet's row collection.
ShowGridLines | Gets or sets whether Excel should show the grid lines when displaying the sheet.
Visible | Gets or sets the sheet's visibility.

Public Methods

GetCell

Gets a reference to a cell at the specified coordinates, returns null of the cell doesn't exist.

See Also


XLSheet Properties

XLSheet Properties

The properties of the XLSheet class are listed here. For a complete list of XLSheet class members, see the XLSheet Members topic.

Public Properties

Book | Gets a reference to the C1XLBook that owns the sheet.
Columns | Gets a reference to sheet's column collection.
DefaultColumnWidth | Gets or sets the default row height for the sheet (in twips).
DefaultRowHeight | Gets or sets the default row height for the sheet (in twips).
Locked | Gets or sets a value that determines if the sheet is locked for editing.
MergedCells | Gets a XLCellRangeCollection that contains the collection of cells that are merged on the sheet.
Name | Gets or sets the name of the XLSheet.
PrintSettings | Gets or sets an XLPrintSettings object that controls how the sheet is printed.
Rows | Gets a reference to sheet's row collection.
ShowGridLines | Gets or sets whether Excel should show the grid lines when displaying the sheet.
Visible | Gets or sets the sheet's visibility.

See Also


XLSheet.Book Property

XLSheet.Book Property

Gets a reference to the C1XLBook that owns the sheet.

[Visual Basic]

Public ReadOnly Property Book As C1XLBook

[C#]

public C1XLBook Book {get;}

[Delphi]

public property Book: C1XLBook read get_Book;

See Also


XLSheet.Columns Property

XLSheet.Columns Property

Gets a reference to sheet's column collection.

[Visual Basic]

Public ReadOnly Property Columns As XLColumnCollection

[C#]

public XLColumnCollection Columns {get;}

[Delphi]

public property Columns: XLColumnCollection read get_Columns;

See Also


XLSheet.DefaultColumnWidth Property

XLSheet.DefaultColumnWidth Property

Gets or sets the default row height for the sheet (in twips).

[Visual Basic]

Public Property DefaultColumnWidth As Integer

[C#]

public int DefaultColumnWidth {get;set;}

[Delphi]

public property DefaultColumnWidth: Int32 read get_DefaultColumnWidth write set_DefaultColumnWidth;

Remarks

You can set the width of individual rows using the XLColumn class. Any columns that do not have a custom width assigned to them will be displayed using the sheet's DefaultColumnWidth.

The DefaultColumnWidth property is expressed in twips (1/20th of a point), rather than pixels. This allows sheets to maintain their aspect regardless of the resolution of the display.

To convert twips into pixels, use the TwipsToPixelsmethod in C1XLBook. To convert pixels into twips, use the PixelsToTwips method.

See Also


XLSheet.DefaultRowHeight Property

XLSheet.DefaultRowHeight Property

Gets or sets the default row height for the sheet (in twips).

[Visual Basic]

Public Property DefaultRowHeight As Integer

[C#]

public int DefaultRowHeight {get;set;}

[Delphi]

public property DefaultRowHeight: Int32 read get_DefaultRowHeight write set_DefaultRowHeight;

Remarks

You can set the height of individual rows using the XLRow class. Any rows that do not have a custom height assigned to them will be displayed using the sheet's DefaultRowHeight.

The DefaultRowHeight property is expressed in twips (1/20th of a point), rather than pixels. This allows sheets to maintain their aspect regardless of the resolution of the display.

To convert twips into pixels, use the TwipsToPixelsmethod in C1XLBook. To convert pixels into twips, use the PixelsToTwips method.

See Also


XLSheet.Locked Property

XLSheet.Locked Property

Gets or sets a value that determines if the sheet is locked for editing.

[Visual Basic]

Public Property Locked As Boolean

[C#]

public bool Locked {get;set;}

[Delphi]

public property Locked: Boolean read get_Locked write set_Locked;

Remarks

Sheets and styles can be locked. By default, sheets are unlocked and styles are locked. This combination allows users to edit the cells in Excel.

To protect a cell against editing in Excel, both the sheet and the cell style must have the Locked property set to true.

To lock most cells on a sheet and allow editing of only a few cells, lock the sheet, then create an unlocked style and assign it to the cells that should be editable.

Example

The code below creates a data entry sheet. Most cells are locked, except for the ones where the user is supposed to enter data.

· Visual Basic

· C#

· Delphi

See Also


XLSheet.MergedCells Property

XLSheet.MergedCells Property

Gets a XLCellRangeCollection that contains the collection of cells that are merged on the sheet.

[Visual Basic]

Public ReadOnly Property MergedCells As XLCellRangeCollection

[C#]

public XLCellRangeCollection MergedCells {get;}

[Delphi]

public property MergedCells: XLCellRangeCollection read get_MergedCells;

Remarks

The collection has methods for inspecting, adding, or clearing merged ranges in a sheet. Each merged range is represented by a XLCellRange object.

See Also


XLSheet.Name Property

XLSheet.Name Property

Gets or sets the name of the XLSheet.

[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

When you open a workbook in Excel, the sheet names appear in the tabs below the work area.

Sheet names can be used as indexers, so they should be unique.

See Also


XLSheet.PrintSettings Property

XLSheet.PrintSettings Property

Gets or sets an XLPrintSettings object that controls how the sheet is printed.

[Visual Basic]

Public Property PrintSettings As XLPrintSettings

[C#]

public XLPrintSettings PrintSettings {get;set;}

[Delphi]

public property PrintSettings: XLPrintSettings read get_PrintSettings write set_PrintSettings;

Example

The code below creates a header for the sheet and sets the orientation to landscape:

· Visual Basic

· C#

· Delphi

See Also


XLSheet.Rows Property

XLSheet.Rows Property

Gets a reference to sheet's row collection.

[Visual Basic]

Public ReadOnly Property Rows As XLRowCollection

[C#]

public XLRowCollection Rows {get;}

[Delphi]

public property Rows: XLRowCollection read get_Rows;

See Also


XLSheet.ShowGridLines Property

XLSheet.ShowGridLines Property

Gets or sets whether Excel should show the grid lines when displaying the sheet.

[Visual Basic]

Public Property ShowGridLines As Boolean

[C#]

public bool ShowGridLines {get;set;}

[Delphi]

public property ShowGridLines: Boolean read get_ShowGridLines write set_ShowGridLines;

See Also


XLSheet.Visible Property

XLSheet.Visible Property

Gets or sets the sheet's visibility.

[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


XLSheet Methods

XLSheet Methods

The methods of the XLSheet class are listed here. For a complete list of XLSheet class members, see the XLSheet Members topic.

Public Methods

GetCell

Gets a reference to a cell at the specified coordinates, returns null of the cell doesn't exist.

See Also


XLSheet.GetCell Method

XLSheet.GetCell Method

Gets a reference to a cell at the specified coordinates, returns null of the cell doesn't exist.

[Visual Basic]

Public Function GetCell( _

ByVal rowIndex As Integer, _

ByVal colIndex As Integer _

) As XLCell

[C#]

public XLCell GetCell(

int rowIndex,

int colIndex

);

[Delphi]

public function GetCell(

rowIndex: Int32;

colIndex: Int32

): XLCell;

Parameters

rowIndex

Index of the row.

colIndex

Index of the column.

Return Value

A reference to the XLCell object at the specified coordinates, null if the is no cell at that position.

Remarks

To populate new sheets, use the Sheets indexer instead. The indexer will automatically create new rows, columns, and cells as needed, and will never return null.

See Also


XLSheetCollection Class

XLSheetCollection Class

Collection of XLSheet objects that represent the individual worksheets in a C1XLBook.

For a list of all members of this type, see XLSheetCollection Members.

System.Object

C1.C1Excel.XLSheetCollection

[Visual Basic]

Public Class XLSheetCollection

Implements ICollection, IEnumerable

[C#]

public class XLSheetCollection : ICollection, IEnumerable

[Delphi]

type XLSheetCollection = class (TObject, ICollection, IEnumerable);

Remarks

Provides methods and properties for counting, enumerating, adding, and removing sheets from the workbook.

Example

Use the C1XLBook Sheets property to get the book's sheet collection. For example, the code below gets a reference to the first sheet on the book, then prints the sheet's name:

· Visual Basic

· C#

· Delphi

Namespace: C1.C1Excel

Assembly: C1.C1Excel (in c1.c1excel.dll)

See Also


XLSheetCollection Members

XLSheetCollection Members

XLSheetCollection overview

Public Properties

Book | Gets a reference to the C1XLBook that owns the collection.
Count | Gets the number of XLSheet objects in the collection.
Item | Overloaded. Gets the XLSheet at a given position in the collection.
SelectedIndex | Gets or sets the index of the sheet that is selected when the C1XLBook file is loaded into Excel.

Public Methods

Add | Overloaded. Creates a new XLSheet and appends it to the collection.
Clear | Removes all items from the collection.
Contains | Overloaded. Determines whether the collection contains a specific XLSheet object.
IndexOf | Overloaded. Gets the index of a given XLSheet in the collection.
Insert | Overloaded. Creates a new XLSheet and inserts it at a specific position in the collection.
Remove | Overloaded. Removes an XLSheet from the collection.
RemoveAt | Removes the XLSheet at a specific index from the collection.

See Also


XLSheetCollection Properties

XLSheetCollection Properties

The properties of the XLSheetCollection class are listed here. For a complete list of XLSheetCollection class members, see the XLSheetCollection Members topic.

Public Properties

Book | Gets a reference to the C1XLBook that owns the collection.
Count | Gets the number of XLSheet objects in the collection.
Item | Overloaded. Gets the XLSheet at a given position in the collection.
SelectedIndex | Gets or sets the index of the sheet that is selected when the C1XLBook file is loaded into Excel.

See Also


XLSheetCollection.Book Property

XLSheetCollection.Book Property

Gets a reference to the C1XLBook that owns the collection.

[Visual Basic]

Public ReadOnly Property Book As C1XLBook

[C#]

public C1XLBook Book {get;}

[Delphi]

public property Book: C1XLBook read get_Book;

See Also


XLSheetCollection.Count Property

XLSheetCollection.Count Property

Gets the number of XLSheet objects in the collection.

[Visual Basic]

Public ReadOnly Property Count As Integer

[C#]

public int Count {get;}

[Delphi]

public property Count: Int32 read get_Count;

See Also


XLSheetCollection.Item Property

XLSheetCollection.Item Property

Overload List

Gets the XLSheet at a given position in the collection.

[Visual Basic] Overloads Public Default ReadOnly Property Item(Integer) As XLSheet

[C#] public XLSheet this[int]{get;}

[Delphi] public property Item[index: Int32]: XLSheet read get_Item;

Gets the XLSheet with the given name (case-insensitive).

[Visual Basic] Overloads Public Default ReadOnly Property Item(String) As XLSheet

[C#] public XLSheet this[string]{get;}

[Delphi] public property Item[name: String]: XLSheet read get_Item;

See Also


XLSheetCollection.Item Property (Int32)

XLSheetCollection.Item Property (Int32)

Gets the XLSheet at a given position in the collection.

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal index As Integer _

) As XLSheet

[C#]

public XLSheet this[

int index

] {get;}

[Delphi]

public property Item[

index: Int32

]: XLSheet read get_Item;

See Also


XLSheetCollection.Item Property (String)

XLSheetCollection.Item Property (String)

Gets the XLSheet with the given name (case-insensitive).

[Visual Basic]

Public Default ReadOnly Property Item( _

ByVal name As String _

) As XLSheet

[C#]

public XLSheet this[

string name

] {get;}

[Delphi]

public property Item[

name: String

]: XLSheet read get_Item;

See Also


XLSheetCollection.SelectedIndex Property

XLSheetCollection.SelectedIndex Property

Gets or sets the index of the sheet that is selected when the C1XLBook file is loaded into Excel.

[Visual Basic]

Public Property SelectedIndex As Integer

[C#]

public int SelectedIndex {get;set;}

[Delphi]

public property SelectedIndex: Int32 read get_SelectedIndex write set_SelectedIndex;

See Also


XLSheetCollection Methods

XLSheetCollection Methods

The methods of the XLSheetCollection class are listed here. For a complete list of XLSheetCollection class members, see the XLSheetCollection Members topic.

Public Methods

Add | Overloaded. Creates a new XLSheet and appends it to the collection.
Clear | Removes all items from the collection.
Contains | Overloaded. Determines whether the collection contains a specific XLSheet object.
IndexOf | Overloaded. Gets the index of a given XLSheet in the collection.
Insert | Overloaded. Creates a new XLSheet and inserts it at a specific position in the collection.
Remove | Overloaded. Removes an XLSheet from the collection.
RemoveAt | Removes the XLSheet at a specific index from the collection.

See Also


XLSheetCollection.Add Method

XLSheetCollection.Add Method

Overload List

Creates a new XLSheet and appends it to the collection.

[Visual Basic] Overloads Public Function Add() As XLSheet

[C#] public XLSheet Add();

[Delphi] public function Add() : XLSheet; overload;

Creates a new XLSheet with a given name and appends it to the collection.

[Visual Basic] Overloads Public Function Add(String) As XLSheet

[C#] public XLSheet Add(string);

[Delphi] public function Add(String) : XLSheet; overload;

Appends an existing XLSheet to the collection.

[Visual Basic] Overloads Public Function Add(XLSheet) As XLSheet

[C#] public XLSheet Add(XLSheet);

[Delphi] public function Add(XLSheet) : XLSheet; overload;

See Also


XLSheetCollection.Add Method ()

XLSheetCollection.Add Method ()

Creates a new XLSheet and appends it to the collection.

[Visual Basic]

Overloads Public Function Add() As XLSheet

[C#]

public XLSheet Add()

[Delphi]

public function Add(): XLSheet; overload;

Return Value

A reference to the new XLSheet object.

See Also


XLSheetCollection.Add Method (String)

XLSheetCollection.Add Method (String)

Creates a new XLSheet with a given name and appends it to the collection.

[Visual Basic]

Overloads Public Function Add( _

ByVal name As String _

) As XLSheet

[C#]

public XLSheet Add(

string name

);

[Delphi]

public function Add(

name: String

): XLSheet; overload;

Parameters

name

The name of the new XLSheet.

Return Value

A reference to the new XLSheet object.

See Also


XLSheetCollection.Add Method (XLSheet)

XLSheetCollection.Add Method (XLSheet)

Appends an existing XLSheet to the collection.

[Visual Basic]

Overloads Public Function Add( _

ByVal sheet As XLSheet _

) As XLSheet

[C#]

public XLSheet Add(

XLSheet sheet

);

[Delphi]

public function Add(

sheet: XLSheet

): XLSheet; overload;

Parameters

sheet

The object to add to the collection.

Return Value

A reference to the object that was added to the collection (in this case, always the sheet parameter).

See Also


XLSheetCollection.Clear Method

XLSheetCollection.Clear Method

Removes all items from the collection.

[Visual Basic]

Public Sub Clear()

[C#]

public void Clear()

[Delphi]

public procedure Clear();

See Also


XLSheetCollection.Contains Method

XLSheetCollection.Contains Method

Overload List

Determines whether the collection contains an XLSheet object with a given name.

[Visual Basic] Overloads Public Function Contains(String) As Boolean

[C#] public bool Contains(string);

[Delphi] public function Contains(String) : Boolean; overload;

Determines whether the collection contains a specific XLSheet object.

[Visual Basic] Overloads Public Function Contains(XLSheet) As Boolean

[C#] public bool Contains(XLSheet);

[Delphi] public function Contains(XLSheet) : Boolean; overload;

See Also


XLSheetCollection.Contains Method (String)

XLSheetCollection.Contains Method (String)

Determines whether the collection contains an XLSheet object with a given name.

[Visual Basic]

Overloads Public Function Contains( _

ByVal sheetName As String _

) As Boolean

[C#]

public bool Contains(

string sheetName

);

[Delphi]

public function Contains(

sheetName: String

): Boolean; overload;

Parameters

sheetName

The name of the sheet to look for (case-insensitive).

Return Value

True if the collection contains an XLSheet, with the given sheetName, False otherwise.

See Also


XLSheetCollection.Contains Method (XLSheet)

XLSheetCollection.Contains Method (XLSheet)

Determines whether the collection contains a specific XLSheet object.

[Visual Basic]

Overloads Public Function Contains( _

ByVal sheet As XLSheet _

) As Boolean

[C#]

public bool Contains(

XLSheet sheet

);

[Delphi]

public function Contains(

sheet: XLSheet

): Boolean; overload;

Parameters

sheet

The object to look for in the collection.

Return Value

True if the collection contains the object, False otherwise.

See Also


XLSheetCollection.IndexOf Method

XLSheetCollection.IndexOf Method

Overload List

Gets the position of the sheet with the specified name in the collection.

[Visual Basic] Overloads Public Function IndexOf(String) As Integer

[C#] public int IndexOf(string);

[Delphi] public function IndexOf(String) : Int32; overload;

Gets the index of a given XLSheet in the collection.

[Visual Basic] Overloads Public Function IndexOf(XLSheet) As Integer

[C#] public int IndexOf(XLSheet);

[Delphi] public function IndexOf(XLSheet) : Int32; overload;

See Also


XLSheetCollection.IndexOf Method (String)

XLSheetCollection.IndexOf Method (String)

Gets the position of the sheet with the specified name in the collection.

[Visual Basic]

Overloads Public Function IndexOf( _

ByVal name As String _

) As Integer

[C#]

public int IndexOf(

string name

);

[Delphi]

public function IndexOf(

name: String

): Int32; overload;

Parameters

name

Name of the object to look for (case-insensitive).

Return Value

The index of the sheet in the collection, or -1 if the sheet cannot be found in the collection.

See Also


XLSheetCollection.IndexOf Method (XLSheet)

XLSheetCollection.IndexOf Method (XLSheet)

Gets the index of a given XLSheet in the collection.

[Visual Basic]

Overloads Public Function IndexOf( _

ByVal sheet As XLSheet _

) As Integer

[C#]

public int IndexOf(

XLSheet sheet

);

[Delphi]

public function IndexOf(

sheet: XLSheet

): Int32; overload;

Parameters

sheet

The object to look for.

Return Value

The index of the object in the collection, or -1 if the object is not a member of the collection.

See Also


XLSheetCollection.Insert Method

XLSheetCollection.Insert Method

Overload List

Creates a new XLSheet and inserts it at a specific position in the collection.

[Visual Basic] Overloads Public Function Insert(Integer) As XLSheet

[C#] public XLSheet Insert(int);

[Delphi] public function Insert(Int32) : XLSheet; overload;

Inserts an XLSheet object into the collection at the specified position.

[Visual Basic] Overloads Public Function Insert(Integer, XLSheet) As XLSheet

[C#] public XLSheet Insert(int, XLSheet);

[Delphi] public function Insert(Int32; XLSheet) : XLSheet; overload;

See Also


XLSheetCollection.Insert Method (Int32)

XLSheetCollection.Insert Method (Int32)

Creates a new XLSheet and inserts it at a specific position in the collection.

[Visual Basic]

Overloads Public Function Insert( _

ByVal index As Integer _

) As XLSheet

[C#]

public XLSheet Insert(

int index

);

[Delphi]

public function Insert(

index: Int32

): XLSheet; overload;

Parameters

index

Index where the new XLSheet will be added.

Return Value

A reference to the new XLSheet object.

See Also


XLSheetCollection.Insert Method (Int32, XLSheet)

XLSheetCollection.Insert Method (Int32, XLSheet)

Inserts an XLSheet object into the collection at the specified position.

[Visual Basic]

Overloads Public Function Insert( _

ByVal index As Integer, _

ByVal sheet As XLSheet _

) As XLSheet

[C#]

public XLSheet Insert(

int index,

XLSheet sheet

);

[Delphi]

public function Insert(

index: Int32;

sheet: XLSheet

): XLSheet; overload;

Parameters

index

Position where the item will be inserted.

sheet

XLSheet object to add to the collection.

Return Value

A reference to the object that was added to the collection (in this case, always the sheet parameter).

See Also


XLSheetCollection.Remove Method

XLSheetCollection.Remove Method

Overload List

Removes the XLSheet with the specified name from the collection.

[Visual Basic] Overloads Public Sub Remove(String)

[C#] public Remove(string);

[Delphi] public procedure Remove(String); overload;

Removes an XLSheet from the collection.

[Visual Basic] Overloads Public Sub Remove(XLSheet)

[C#] public Remove(XLSheet);

[Delphi] public procedure Remove(XLSheet); overload;

See Also


XLSheetCollection.Remove Method (String)

XLSheetCollection.Remove Method (String)

Removes the XLSheet with the specified name from the 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

Name of the sheet to remove from the collection (case-insensitive).

See Also


XLSheetCollection.Remove Method (XLSheet)

XLSheetCollection.Remove Method (XLSheet)

Removes an XLSheet from the collection.

[Visual Basic]

Overloads Public Sub Remove( _

ByVal sheet As XLSheet _

)

[C#]

public void Remove(

XLSheet sheet

);

[Delphi]

public procedure Remove(

sheet: XLSheet

); overload;

Parameters

sheet

The XLSheet object to remove from the collection.

See Also


XLSheetCollection.RemoveAt Method

XLSheetCollection.RemoveAt Method

Removes the XLSheet at a specific index from the collection.

[Visual Basic]

Public Sub RemoveAt( _

ByVal index As Integer _

)

[C#]

public void RemoveAt(

int index

);

[Delphi]

public procedure RemoveAt(

index: Int32

);

Parameters

index

Index of the object to remove from the collection.

See Also


XLStyle Class

XLStyle Class

Contains style elements used to define the appearance of the cells.

For a list of all members of this type, see XLStyle Members.

System.Object

C1.C1Excel.XLStyle

[Visual Basic]

Public Class XLStyle

Implements ICloneable

[C#]

public class XLStyle : ICloneable

[Delphi]

type XLStyle = class (TObject, ICloneable);

Remarks

Each XLStyle object may define one or more of the following elements: font, format, background color, background pattern, foreground color, alignment, text direction, and word wrapping.

When displaying a cell, Excel combines the row, column, and cell styles and merges the style elements defined in each one in order to determine how the cell should be displayed. The precedence of the styles is: (1) cell, (2) row, (3) column, (4) default style.

Every XLStyle belongs to a C1XLBook, and may be assigned to one or more XLRow, XLColumn, and XLCell objects through their Style property.

Namespace: C1.C1Excel

Assembly: C1.C1Excel (in c1.c1excel.dll)

See Also


XLStyle Members

XLStyle Members

XLStyle overview

Public Constructors

XLStyle Constructor

Creates a new instance of XLStyle and adds it to the specified C1XLBook.

Public Properties

AlignHorz | Gets or sets the horizontal alignment for this XLStyle.
AlignVert | Gets or sets the vertical alignment for this XLStyle.
BackColor | Gets or sets the background color for this XLStyle.
BackPattern | Gets or sets the background pattern for this XLStyle.
BorderBottom | Gets or sets the line style used to draw the bottom border.
BorderColorBottom | Gets or sets the color used to draw the bottom border.
BorderColorLeft | Gets or sets the color used to draw the left border.
BorderColorRight | Gets or sets the color used to draw the right border.
BorderColorTop | Gets or sets the color used to draw the top border.
BorderLeft | Gets or sets the line style used to draw the left border.
BorderRight | Gets or sets the line style used to draw the right border.
BorderTop | Gets or sets the line style used to draw the top border.
Diagonal | Gets or sets which diagonal lines to display (none, forward, backward).
DiagonalColor | Gets or sets the color used to draw the diagonal lines.
DiagonalStyle | Gets or sets the line style used to draw the diagonal lines.
Font | Gets or sets the font for this XLStyle.
ForeColor | Gets or sets the foreground color for this XLStyle.
Format | Gets or sets the format associated with this XLStyle.
Locked | Gets or sets whether the cell should be locked for editing when the XLSheet is protected.
PatternColor | Gets or sets the color of the background pattern for this XLStyle.
Rotation | Gets or sets the rotation for this XLStyle, in degrees.
WordWrap | Gets or sets whether this XLStyle causes cell contents to wrap.

Public Methods

Clone | Creates a new XLStyle object that is a copy of the current instance.
Equals | Overriden. Determines whether two XLStyle objects are equivalent.
FormatDotNetToXL | Overloaded. Converts a .NET-style format string into an Excel format string.
FormatXLToDotNet | Converts a Excel-style format string into a .NET-style format string.
GetHashCode | Overriden. Serves as a hash function suitable for use in hashing algorithms and data structures like a hash table.
SetBorderColor | Sets the border color for this XLStyle.
SetBorderStyle | Sets the border style for this XLStyle.

See Also


XLStyle Constructor

XLStyle Constructor

Creates a new instance of XLStyle and adds it to the specified C1XLBook.

[Visual Basic]

Public Function New( _

ByVal book As C1XLBook _

)

[C#]

public XLStyle(

C1XLBook book

);

[Delphi]

public constructor Create(

book: C1XLBook

); overload;

Parameters

book

Parent C1XLBook.

See Also


XLStyle Properties

XLStyle Properties

The properties of the XLStyle class are listed here. For a complete list of XLStyle class members, see the XLStyle Members topic.

Public Properties

AlignHorz | Gets or sets the horizontal alignment for this XLStyle.
AlignVert | Gets or sets the vertical alignment for this XLStyle.
BackColor | Gets or sets the background color for this XLStyle.
BackPattern | Gets or sets the background pattern for this XLStyle.
BorderBottom | Gets or sets the line style used to draw the bottom border.
BorderColorBottom | Gets or sets the color used to draw the bottom border.
BorderColorLeft | Gets or sets the color used to draw the left border.
BorderColorRight | Gets or sets the color used to draw the right border.
BorderColorTop | Gets or sets the color used to draw the top border.
BorderLeft | Gets or sets the line style used to draw the left border.
BorderRight | Gets or sets the line style used to draw the right border.
BorderTop | Gets or sets the line style used to draw the top border.
Diagonal | Gets or sets which diagonal lines to display (none, forward, backward).
DiagonalColor | Gets or sets the color used to draw the diagonal lines.
DiagonalStyle | Gets or sets the line style used to draw the diagonal lines.
Font | Gets or sets the font for this XLStyle.
ForeColor | Gets or sets the foreground color for this XLStyle.
Format | Gets or sets the format associated with this XLStyle.
Locked | Gets or sets whether the cell should be locked for editing when the XLSheet is protected.
PatternColor | Gets or sets the color of the back ground pattern for this XLStyle.
Rotation | Gets or sets the rotation for this XLStyle, in degrees.
WordWrap | Gets or sets whether this XLStyle causes cell contents to wrap.

See Also


XLStyle.AlignHorz Property

XLStyle.AlignHorz Property

Gets or sets the horizontal alignment for this XLStyle.

[Visual Basic]

Public Property AlignHorz As XLAlignHorzEnum

[C#]

public XLAlignHorzEnum AlignHorz {get;set;}

[Delphi]

public property AlignHorz: XLAlignHorzEnum read get_AlignHorz write set_AlignHorz;

Remarks

Set the AlignHorz property to Undefined to suppress this style element and use the default horizontal alignment instead (General).

See Also


XLStyle.AlignVert Property

XLStyle.AlignVert Property

Gets or sets the vertical alignment for this XLStyle.

[Visual Basic]

Public Property AlignVert As XLAlignVertEnum

[C#]

public XLAlignVertEnum AlignVert {get;set;}

[Delphi]

public property AlignVert: XLAlignVertEnum read get_AlignVert write set_AlignVert;

Remarks

Set the AlignVert property to Undefined to suppress this style element and use the default horizontal alignment instead (Bottom).

See Also


XLStyle.BackColor Property

XLStyle.BackColor Property

Gets or sets the background color for this XLStyle.

[Visual Basic]

Public Property BackColor As Color

[C#]

public Color BackColor {get;set;}

[Delphi]

public property BackColor: Color read get_BackColor write set_BackColor;

Remarks

Set the BackColor property to Color.Transparent to suppress this style element and use the default background color instead (white).

All colors on the C1XLBook are mapped onto a palette. This means that is you assign colors to styles, save the book, and then load it back, you probably won't get exactly the same colors used when the book was created. You will get a fairly close approximation though.

See Also


XLStyle.BackPattern Property

XLStyle.BackPattern Property

Gets or sets the background pattern for this XLStyle.

[Visual Basic]

Public Property BackPattern As XLPatternEnum

[C#]

public XLPatternEnum BackPattern {get;set;}

[Delphi]

public property BackPattern: XLPatternEnum read get_BackPattern write set_BackPattern;

See Also


XLStyle.BorderBottom Property

XLStyle.BorderBottom Property

Gets or sets the line style used to draw the bottom border.

[Visual Basic]

Public Property BorderBottom As XLLineStyleEnum

[C#]

public XLLineStyleEnum BorderBottom {get;set;}

[Delphi]

public property BorderBottom: XLLineStyleEnum read get_BorderBottom write set_BorderBottom;

Remarks

Use the SetBorderStyle method to set all borders at once.

See Also


XLStyle.BorderColorBottom Property

XLStyle.BorderColorBottom Property

Gets or sets the color used to draw the bottom border.

[Visual Basic]

Public Property BorderColorBottom As Color

[C#]

public Color BorderColorBottom {get;set;}

[Delphi]

public property BorderColorBottom: Color read get_BorderColorBottom write set_BorderColorBottom;

Remarks

Use the SetBorderColor method to set all borders at once.

See Also


XLStyle.BorderColorLeft Property

XLStyle.BorderColorLeft Property

Gets or sets the color used to draw the left border.

[Visual Basic]

Public Property BorderColorLeft As Color

[C#]

public Color BorderColorLeft {get;set;}

[Delphi]

public property BorderColorLeft: Color read get_BorderColorLeft write set_BorderColorLeft;

Remarks

Use the SetBorderColor method to set all borders at once.

See Also


XLStyle.BorderColorRight Property

XLStyle.BorderColorRight Property

Gets or sets the color used to draw the right border.

[Visual Basic]

Public Property BorderColorRight As Color

[C#]

public Color BorderColorRight {get;set;}

[Delphi]

public property BorderColorRight: Color read get_BorderColorRight write set_BorderColorRight;

Remarks

Use the SetBorderColor method to set all borders at once.

See Also


XLStyle.BorderColorTop Property

XLStyle.BorderColorTop Property

Gets or sets the color used to draw the top border.

[Visual Basic]

Public Property BorderColorTop As Color

[C#]

public Color BorderColorTop {get;set;}

[Delphi]

public property BorderColorTop: Color read get_BorderColorTop write set_BorderColorTop;

Remarks

Use the SetBorderColor method to set all borders at once.

See Also


XLStyle.BorderLeft Property

XLStyle.BorderLeft Property

Gets or sets the line style used to draw the left border.

[Visual Basic]

Public Property BorderLeft As XLLineStyleEnum

[C#]

public XLLineStyleEnum BorderLeft {get;set;}

[Delphi]

public property BorderLeft: XLLineStyleEnum read get_BorderLeft write set_BorderLeft;

Remarks

Use the SetBorderStyle method to set all borders at once.

See Also


XLStyle.BorderRight Property

XLStyle.BorderRight Property

Gets or sets the line style used to draw the right border.

[Visual Basic]

Public Property BorderRight As XLLineStyleEnum

[C#]

public XLLineStyleEnum BorderRight {get;set;}

[Delphi]

public property BorderRight: XLLineStyleEnum read get_BorderRight write set_BorderRight;

Remarks

Use the SetBorderStyle method to set all borders at once.

See Also


XLStyle.BorderTop Property

XLStyle.BorderTop Property

Gets or sets the line style used to draw the top border.

[Visual Basic]

Public Property BorderTop As XLLineStyleEnum

[C#]

public XLLineStyleEnum BorderTop {get;set;}

[Delphi]

public property BorderTop: XLLineStyleEnum read get_BorderTop write set_BorderTop;

Remarks

Use the SetBorderStyle method to set all borders at once.

See Also


XLStyle.Diagonal Property

XLStyle.Diagonal Property

Gets or sets which diagonal lines to display (none, forward, backward).

[Visual Basic]

Public Property Diagonal As XLDiagonalFlags

[C#]

public XLDiagonalFlags Diagonal {get;set;}

[Delphi]

public property Diagonal: XLDiagonalFlags read get_Diagonal write set_Diagonal;

See Also


XLStyle.DiagonalColor Property

XLStyle.DiagonalColor Property

Gets or sets the color used to draw the diagonal lines.

[Visual Basic]

Public Property DiagonalColor As Color

[C#]

public Color DiagonalColor {get;set;}

[Delphi]

public property DiagonalColor: Color read get_DiagonalColor write set_DiagonalColor;

See Also


XLStyle.DiagonalStyle Property

XLStyle.DiagonalStyle Property

Gets or sets the line style used to draw the diagonal lines.

[Visual Basic]

Public Property DiagonalStyle As XLLineStyleEnum

[C#]

public XLLineStyleEnum DiagonalStyle {get;set;}

[Delphi]

public property DiagonalStyle: XLLineStyleEnum read get_DiagonalStyle write set_DiagonalStyle;

See Also


XLStyle.Font Property

XLStyle.Font Property

Gets or sets the font for this XLStyle.

[Visual Basic]

Public Property Font As Font

[C#]

public Font Font {get;set;}

[Delphi]

public property Font: Font read get_Font write set_Font;

Remarks

Set the Font property to null in order to suppress this style element and use the default font instead. The default font is determined by the book's DefaultFont property.

See Also


XLStyle.ForeColor Property

XLStyle.ForeColor Property

Gets or sets the foreground color for this XLStyle.

[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

Set the ForeColor property to Color.Transparent to suppress this style element and use the default foreground color instead (black).

All colors on the C1XLBook are mapped onto a palette. This means that is you assign colors to styles, save the book, and then load it back, you probably won't get exactly the same colors used when the book was created. You will get a fairly close approximation though.

See Also


XLStyle.Format Property

XLStyle.Format Property

Gets or sets the format associated with this XLStyle.

[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

Excel uses formats similar, but not identical to .NET. Refer to the Excel documentation for details on how to create format strings.

You can use the FormatXLToDotNet and FormatDotNetToXL (String, Type)methods to convert common Excel format strings to and from .NET format strings.

See Also


XLStyle.Locked Property

XLStyle.Locked Property

Gets or sets whether the cell should be locked for editing when the XLSheet is protected.

[Visual Basic]

Public Property Locked As Boolean

[C#]

public bool Locked {get;set;}

[Delphi]

public property Locked: Boolean read get_Locked write set_Locked;

See Also


XLStyle.PatternColor Property

XLStyle.PatternColor Property

Gets or sets the color of the background pattern for this XLStyle.

[Visual Basic]

Public Property PatternColor As Color

[C#]

public Color PatternColor {get;set;}

[Delphi]

public property PatternColor: Color read get_PatternColor write set_PatternColor;

See Also


XLStyle.Rotation Property

XLStyle.Rotation Property

Gets or sets the rotation for this XLStyle, in degrees.

[Visual Basic]

Public Property Rotation As Integer

[C#]

public int Rotation {get;set;}

[Delphi]

public property Rotation: Int32 read get_Rotation write set_Rotation;

Remarks

This property should be set to values between 0 and 180, or 255, as explained below:

Zero means no rotation.

1-90 means 1 to 90 degrees counter-clockwise (90 causes text to be displayed in the vertical direction going up the cell)

91-180 means 1 to 90 degrees clockwise (180 causes text to be displayed in the vertical direction going down the cell)

255 causes letters are stacked top to bottom and not rotated.

See Also


XLStyle.WordWrap Property

XLStyle.WordWrap Property

Gets or sets whether this XLStyle causes cell contents to wrap.

[Visual Basic]

Public Property WordWrap As Boolean

[C#]

public bool WordWrap {get;set;}

[Delphi]

public property WordWrap: Boolean read get_WordWrap write set_WordWrap;

Remarks

Cells that do not wrap will spill onto adjacent cells, and will be kept on a single line even if they contain line-break characters.

See Also


XLStyle Methods

XLStyle Methods

The methods of the XLStyle class are listed here. For a complete list of XLStyle class members, see the XLStyle Members topic.

Public Methods

Clone | Creates a new XLStyle object that is a copy of the current instance.
Equals | Overriden. Determines whether two XLStyle objects are equivalent.
FormatDotNetToXL | Overloaded. Converts a .NET-style format string into an Excel format string.
FormatXLToDotNet | Converts a Excel-style format string into a .NET-style format string.
GetHashCode | Overriden. Serves as a hash function suitable for use in hashing algorithms and data structures like a hash table.
SetBorderColor | Sets the border color for this XLStyle.
SetBorderStyle | Sets the border style for this XLStyle.

See Also


XLStyle.Clone Method

XLStyle.Clone Method

Creates a new XLStyle object that is a copy of the current instance.

[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

A new XLStyle object that is a copy of the current instance.

See Also


XLStyle.Equals Method

XLStyle.Equals Method

Determines whether two XLStyle objects are equivalent.

[Visual Basic]

Overrides Public Function Equals( _

ByVal obj As Object _

) As Boolean

[C#]

override public bool Equals(

object obj

);

[Delphi]

public function Equals(

obj: Object

): Boolean; override;

Parameters

obj

XLStyle object to compare to the current instance.

Return Value

True if the styles are equivalent, False otherwise.

See Also


XLStyle.FormatDotNetToXL Method

XLStyle.FormatDotNetToXL Method

Overload List

Converts a .NET-style format string into an Excel format string.

[Visual Basic] Overloads Public Shared Function FormatDotNetToXL(String) As String

[C#] public static string FormatDotNetToXL(string);

[Delphi] public class function FormatDotNetToXL(String) : String; overload;

Converts a .NET-style format string into an Excel format string.

[Visual Basic] Overloads Public Shared Function FormatDotNetToXL(String, Type) As String

[C#] public static string FormatDotNetToXL(string, Type);

[Delphi] public class function FormatDotNetToXL(String; Type) : String; overload;

See Also


XLStyle.FormatDotNetToXL Method (String)

XLStyle.FormatDotNetToXL Method (String)

Converts a .NET-style format string into an Excel format string.

[Visual Basic]

Overloads Public Shared Function FormatDotNetToXL( _

ByVal fmt As String _

) As String

[C#]

public static string FormatDotNetToXL(

string fmt

);

[Delphi]

public class function FormatDotNetToXL(

fmt: String

): String; overload;

Parameters

fmt

.NET-style format to convert.

Return Value

An Excel-style format string.

See Also


XLStyle.FormatDotNetToXL Method (String, Type)

XLStyle.FormatDotNetToXL Method (String, Type)

Converts a .NET-style format string into an Excel format string.

[Visual Basic]

Overloads Public Shared Function FormatDotNetToXL( _

ByVal fmt As String, _

ByVal dataType As Type _

) As String

[C#]

public static string FormatDotNetToXL(

string fmt,

Type dataType

);

[Delphi]

public class function FormatDotNetToXL(

fmt: String;

dataType: Type

): String; overload;

Parameters

fmt

.NET-style format to convert.

dataType

Data type to be formatted.

Return Value

An Excel-style format string.

See Also


XLStyle.FormatXLToDotNet Method

XLStyle.FormatXLToDotNet Method

Converts a Excel-style format string into a .NET-style format string.

[Visual Basic]

Public Shared Function FormatXLToDotNet( _

ByVal fmt As String _

) As String

[C#]

public static string FormatXLToDotNet(

string fmt

);

[Delphi]

public class function FormatXLToDotNet(

fmt: String

): String;

Parameters

fmt

Excel-style format to convert.

Return Value

A .NET-style format string.

See Also


XLStyle.GetHashCode Method

XLStyle.GetHashCode Method

Serves as a hash function suitable for use in hashing algorithms and data structures like a hash table.

[Visual Basic]

Overrides Public Function GetHashCode() As Integer

[C#]

override public int GetHashCode()

[Delphi]

public function GetHashCode(): Int32; override;

Return Value

A hash code for the current XLStyle.

See Also


XLStyle.SetBorderColor Method

XLStyle.SetBorderColor Method

Sets the border color for this XLStyle.

[Visual Basic]

Public Sub SetBorderColor( _

ByVal color As Color _

)

[C#]

public void SetBorderColor(

Color color

);

[Delphi]

public procedure SetBorderColor(

color: Color

);

Parameters

color

Color used to draw the border.

Remarks

This method applies the setting to all four borders.

See Also


XLStyle.SetBorderStyle Method

XLStyle.SetBorderStyle Method

Sets the border style for this XLStyle.

[Visual Basic]

Public Sub SetBorderStyle( _

ByVal style As XLLineStyleEnum _

)

[C#]

public void SetBorderStyle(

XLLineStyleEnum style

);

[Delphi]

public procedure SetBorderStyle(

style: XLLineStyleEnum

);

Parameters

style

Line style used to draw the border.

Remarks

This method applies the setting to all four borders.

See Also


AddThreeSheetsC1Excel - C#

C#

// create book (will have a single sheet by default)

C1XLBook book = new C1XLBook();

// add three blank sheets

for (int i = 0; i < 3; i++)

book.Sheets.Add();

// show sheet names and dimensions

foreach (XLSheet sheet in book.Sheets)

Console.WriteLine("Sheet {0} has {1} rows and {2} columns",

sheet.Name, sheet.Rows.Count, sheet.Columns.Count);


AddThreeSheetsC1Excel - Delphi

Delphi

var

book: C1XLBook;

i: Integer;

sheet: XLSheet;

begin

// create book (will have a single sheet by default)

book := C1XLBook.Create;

// add three blank sheets

for i := 0 to 2 do

book.Sheets.Add;

// show sheet names and dimensions

for i := 0 to book.Sheets.Count - 1 do

begin

sheet := book.Sheets[i];

Console.WriteLine('Sheet {0} has {1} rows and {2} columns', sheet.Name, sheet.Rows.Count, sheet.Columns.Count);

end;

end;


AddThreeSheetsC1Excel - Visual Basic

Visual Basic

' create book (will have a single sheet by default)

Dim book As New C1XLBook()

' add three blank sheets

Dim i As Integer

For i = 0 To 2

book.Sheets.Add()

Next i

' show sheet names and dimensions

Dim sheet As XLSheet

For Each sheet In book.Sheets

Console.WriteLine("Sheet {0} has {1} rows and {2} columns", _

sheet.Name, sheet.Rows.Count, sheet.Columns.Count)

Next sheet


C1.C1Excel Hierarchy

C1.C1Excel Hierarchy

System.Object

System.MarshalByRefObject

System.ComponentModel.Component

C1.C1Excel.C1XLBook

C1.C1Excel.XLCell

C1.C1Excel.XLCellRange

C1.C1Excel.XLCellRangeCollection ---- System.Collections.ICollection, System.Collections.IEnumerable

C1.C1Excel.XLColumn

C1.C1Excel.XLColumnCollection ---- System.Collections.ICollection, System.Collections.IEnumerable

C1.C1Excel.XLPrintSettings

C1.C1Excel.XLRow

C1.C1Excel.XLRowCollection ---- System.Collections.ICollection, System.Collections.IEnumerable

C1.C1Excel.XLSheet

C1.C1Excel.XLSheetCollection ---- System.Collections.ICollection, System.Collections.IEnumerable

C1.C1Excel.XLStyle ---- System.ICloneable

System.ValueType

System.Enum

C1.C1Excel.XLAlignHorzEnum

C1.C1Excel.XLAlignVertEnum

C1.C1Excel.XLDiagonalFlags

C1.C1Excel.XLLineStyleEnum

C1.C1Excel.XLPatternEnum

See Also

C1.C1Excel Namespace


C1ExcelBookObject - C#

C#

C1XLBook book = new C1XLBook();

book.DefaultFont = new Font("Tahoma", 10);


C1ExcelBookObject - Delphi

Delphi

var

book: C1XLBook;

begin

book := C1XLBook.Create;

book.DefaultFont := System.Drawing.Font.Create('Tahoma', 10);

end;


C1ExcelBookObject - Visual Basic

Visual Basic

Dim book As New C1XLBook()

book.DefaultFont = New Font("Tahoma", 10)


FormatDotNetToXLC1Excel - C#

C#

// load a book from a file

C1XLBook book = new C1XLBook();

book.Load(@"c:\temp\test.xls");

// loop through all the cells in the first sheet

XLSheet sheet = book.Sheets[0];

for (int r = 0; r < sheet.Rows.Count; r++)

{

for (int c = 0; c < sheet.Columns.Count; c++)

{

XLCell cell = sheet.GetCell(r, c);

if (cell != null && cell.Style != null)

{

string fmtXL = cell.Style.Format;

string fmtNET = XLStyle.FormatXLToDotNet(fmtXL);

Console.WriteLine("Excel fmt: '{0}', .NET fmt '{1}'",

fmtXL, fmtNET);

}

}

}


FormatDotNetToXLC1Excel - Delphi

Delphi

var

book: C1XLBook;

sheet: XLSheet;

r: Integer;

c: Integer;

cell: XLCell;

fmtXL, fmtNET: String;

begin

// load a book from a file

book := C1XLBook.Create;

book.Load('c:\temp\test.xls');

// loop through all the cells in the first sheet

sheet := book.Sheets[0];

for r := 0 to sheet.Rows.Count - 1 do

begin

for c := 0 to sheet.Columns.Count - 1 do

begin

cell := sheet.GetCell(r, c);

if (cell <> nil) And (cell.Style <> nil) then

begin

fmtXL := cell.Style.Format;

fmtNET := XLStyle.FormatXLToDotNet(fmtXL);

Console.WriteLine('Excel fmt: ''{0}'', .NET fmt ''{1}''', fmtXL, fmtNET);

end;

end;

end;

end;


FormatDotNetToXLC1Excel - Visual Basic

Visual Basic

' load a book from a file

Dim book As New C1XLBook()

book.Load("c:\temp\test.xls")

' loop through all the cells in the first sheet

Dim sheet As XLSheet = book.Sheets(0)

Dim r As Integer

For r = 0 To sheet.Rows.Count - 1

Dim c As Integer

For c = 0 To sheet.Columns.Count - 1

Dim cell As XLCell = sheet.GetCell(r, c)

If Not (cell Is Nothing) And Not (cell.Style Is Nothing) Then

Dim fmtXL As String = cell.Style.Format

String fmtNET = XLStyle.FormatXLToDotNet(fmtXL)

Console.WriteLine("Excel fmt: '{0}', .NET fmt '{1}'", fmtXL, fmtNET)

End If

Next c

Next r


HeightPropertyC1Excel - C#

C#

// get book and sheet

C1XLBook book = new C1XLBook();

XLSheet sheet = book.Sheets[0];

// prepare to calculate total height

int totalHeight = 0;

int defHeight = sheet.DefaultRowHeight;

// loop through the rows and add row heights

foreach (XLRow row in sheet.Rows)

{

if (!row.Visible)

continue; // skip invisible rows

if (row.Height < 0) // < 0 means default height

totalHeight += defHeight;

else

totalHeight += row.Height;

}

// convert twips to pixels

totalHeight = (int)(totalHeight * 96f / 1440f);


HeightPropertyC1Excel - Delphi

Delphi

var

book: C1XLBook;

sheet: XLSheet;

totalHeight: Integer;

defHeight: Integer;

i: Integer;

row: XLRow;

begin

// get book and sheet

book := C1XLBook.Create;

sheet := book.Sheets[0];

// prepare to calculate total height

totalHeight := 0;

defHeight := sheet.DefaultRowHeight;

// loop through the rows and add row heights

for i := 0 to sheet.Rows.Count - 1 do

begin

row := sheet.Rows[i];

if not row.Visible then

continue; // skip invisible rows

if row.Height < 0 then // < 0 means default height

begin

totalHeight := totalHeight + defHeight;

end

else

begin

totalHeight := totalHeight + row.Height;

end;

end;

// convert twips to pixels

totalHeight := Round(totalHeight * 96 / 1440);

end;


HeightPropertyC1Excel - Visual Basic

Visual Basic

' get book and sheet

Dim book As New C1XLBook()

Dim sheet As XLSheet = book.Sheets(0)

' prepare to calculate total height

Dim totalHeight As Integer = 0

Dim defHeight As Integer = sheet.DefaultRowHeight

' loop through the rows and add row heights

Dim row As XLRow

For Each row In sheet.Rows

If row.Visible Then

If row.Height < 0 Then ' < 0 means default height

totalHeight += defHeight

Else

totalHeight += row.Height

End If

End If

Next row

' convert twips to pixels

totalHeight = CInt(totalHeight * 96F / 1440F)


LoadExcelFileC1Excel - C#

C#

C1XLBook book = new C1XLBook();

book.Load(@"c:\temp\test.xls");

XLSheet sheet = book.Sheets[0];

for (int r = 0; r < sheet.Rows.Count; r++)

{

for (int c = 0; c < sheet.Columns.Count; c++)

{

XLCell cell = sheet.GetCell(r, c);

if (cell != null && cell.Value != null)

{

Console.WriteLine("cell({0},{1}) = {2}", r, c, cell.Value);

}

}

}


LoadExcelFileC1Excel - Delphi

Delphi

var

book: C1XLBook;

sheet: XLSheet;

r: Integer;

c: Integer;

cell: XLCell;

begin

book := C1XLBook.Create;

book.Load('c:\temp\test.xls');

sheet := book.Sheets[0];

for r := 0 to sheet.Rows.Count - 1 do

begin

for c := 0 to sheet.Columns.Count - 1 do

begin

cell := sheet.GetCell(r, c);

if (cell <> nil) And (cell.Value <> nil) then

Console.WriteLine('cell({0},{1}) = {2}', r, c, cell.Value);

end;

end;

end;


LoadExcelFileC1Excel - Visual Basic

Visual Basic

Dim book As New C1XLBook()

book.Load("c:\temp\test.xls")

Dim sheet As XLSheet = book.Sheets(0)

Dim r As Integer

For r = 0 To sheet.Rows.Count - 1

Dim c As Integer

For c = 0 To sheet.Columns.Count - 1

Dim cell As XLCell = sheet.GetCell(r, c)

If Not (cell Is Nothing) And Not (cell.Value Is Nothing) Then

Console.WriteLine("cell({0},{1}) = {2}", r, c, cell.Value)

End If

Next c

Next r


Namespaces - C#

C#

C1.C1Excel.C1XLBook xlbook1;


Namespaces - C#2

C#

// Define a new XLSheet object (custom XLSheet class)

XLSheet MyXLSheet;

// Define a new C1Excel.XLSheet object.

C1.C1Excel.XLSheet XLSheet;


Namespaces - C#3

C#

using C1XLSheet = C1.C1Excel.XLSheet;

using MyXLSheet = MyProject.XLSheet;

C1XLSheet s1;

MyXLSheet s2;


Namespaces - Delphi

Delphi

var

xlbook1: C1.C1Excel.C1XLBook;


Namespaces - Delphi2

Delphi

var

MyXLSheet: C1.C1Excel.XLSheet;

MyXLSheet: XLSheet;

begin

MyXLSheet := XLSheet.Create;

MyXLSheet := C1.C1Excel.XLSheet.Create;

end;


Namespaces - Delphi3

Delphi

uses

C1XLSheet, MyXLSheet;

var

s2: MyXLSheet;

s1: C1XLSheet;

begin

C1XLSheet := C1.C1Excel.XLSheet;

MyXLSheet := MyProject.XLSheet;

end;


Namespaces - Visual Basic

Visual Basic

Dim xlbook1 As C1.C1Excel.C1XLBook


Namespaces - Visual Basic2

Visual Basic

' Define a new XLSheet object (custom XLSheet class)

Dim MyXLSheet as XLSheet

' Define a new C1Excel.XLSheet object.

Dim XLSheet as C1.C1Excel.XLSheet


Namespaces - Visual Basic3

Visual Basic

Imports C1XLSheet = C1.C1Excel.XLSheet

Imports MyXLSheet = MyProject.XLSheet

Dim s1 As C1XLSheet

Dim s2 As MyXLSheet


NewC1ExcelFile - C#

C#

// step 1: create a new workbook

C1XLBook book = new C1XLBook();

// step 2: write content into some cells

XLSheet sheet = book.Sheets[0];

for (int i = 0; i < 100; i++)

sheet[i, 0].Value = i + 1;

// step 3: save the file

book.Save(@"c:\temp\hello.xls");


NewC1ExcelFile - Delphi

Delphi

var

book: C1XLBook;

sheet: XLSheet;

i: Integer;

begin

// step 1: create a new workbook

book := C1XLBook.Create;

// step 2: write content into some cells

sheet := book.Sheets[0];

for i = 0 to 99 do

sheet[i, 0].Value := i + 1;

// step 3: save the file

book.Save('c:\temp\hello.xls');

end;


NewC1ExcelFile - Visual Basic

Visual Basic

' step 1: create a new workbook

Dim book As New C1XLBook()

' step 2: write content into some cells

Dim sheet As XLSheet = book.Sheets(0)

Dim i As Integer

For i = 0 To 99

sheet(i, 0).Value = i + 1

Next i

' step 3: save the file

book.Save("c:\temp\hello.xls")


NewExcelWorkBookC1Excel - C#

C#

C1XLBook book = new C1XLBook();

XLSheet sheet = book.Sheets[0];

for (int r = 0; r < 10; r++)

{

for (int c = 0; c < 10; c++)

{

XLCell cell = sheet[r, c];

cell.Value = (r+1) * (c+1);

}

}

book.Save(@"c:\temp\test.xls");


NewExcelWorkBookC1Excel - Delphi

Delphi

var

book: C1XLBook;

sheet: XLSheet;

r: Integer;

c: Integer;

cell: XLCell;

begin

book := C1XLBook.Create;

sheet := book.Sheets[0];

for r := 0 to 9 do

begin

for c := 0 to 9 do

begin

cell := sheet[r, c];

cell.Value := (r + 1) * (c + 1);

end;

end;

book.Save('c:\temp\test.xls');

end;


NewExcelWorkBookC1Excel - Visual Basic

Visual Basic

Dim book As New C1XLBook()

Dim sheet As XLSheet = book.Sheets(0)

Dim r As Integer

For r = 0 To 9

Dim c As Integer

For c = 0 To 9

Dim cell As XLCell = sheet(r, c)

cell.Value =(r + 1) *(c + 1)

Next c

Next r

book.Save("c:\temp\test.xls")


RetrievingCellsC1Excel - C#

C#

C1XLBook book = new C1XLBook();

book.Load(@"c:\temp\test.xls");

XLSheet sheet = book.Sheets[0];

for (int r = 0; r < sheet.Rows.Count; r++)

{

for (int c = 0; c < sheet.Columns.Count; c++)

{

XLCell cell = sheet.GetCell(r, c);

if (cell != null && cell.Value != null)

{

Console.WriteLine("cell({0},{1}) = {2}", r, c, cell.Value);

}

}

}


RetrievingCellsC1Excel - Delphi

Delphi

var

book: C1XLBook;

sheet: XLSheet;

r: Integer;

c: Integer;

cell: XLCell;

begin

book := C1XLBook.Create;

book.Load('c:\temp\test.xls');

sheet := book.Sheets[0];

for r := 0 to sheet.Rows.Count - 1 do

begin

for c := 0 to sheet.Columns.Count - 1 do

begin

cell := sheet.GetCell(r, c);

if (cell <> nil) and (cell.Value <> nil) then

Console.WriteLine('cell({0},{1}) = {2}', r, c, cell.Value);

end;

end;

end;


RetrievingCellsC1Excel - Visual Basic

Visual Basic

Dim book As New C1XLBook()

book.Load("c:\temp\test.xls")

Dim sheet As XLSheet = book.Sheets(0)

Dim r As Integer

For r = 0 To sheet.Rows.Count - 1

Dim c As Integer

For c = 0 To sheet.Columns.Count - 1

Dim cell As XLCell = sheet.GetCell(r, c)

If Not (cell Is Nothing) And Not (cell.Value Is Nothing) Then

Console.WriteLine("cell({0},{1}) = {2}", r, c, cell.Value)

End If

Next c

Next r


SheetClassC1Excel - C#

C#

C1XLBook book = new C1XLBook();

XLSheet sheet = book.Sheets[0];

Console.WriteLine("Sheet has {0} rows and {1} columns",_

sheet.Rows.Count, sheet.Columns.Count);


SheetClassC1Excel - Delphi

Delphi

var

sheet: XLSheet;

book: C1XLBook;

begin

book := C1XLBook.Create;

sheet := book.Sheets[0];

Console.WriteLine('Sheet has {0} rows and {1} columns',_

sheet.Rows.Count, sheet.Columns.Count);

end;


SheetClassC1Excel - Visual Basic

Visual Basic

Dim book As New C1XLBook()

Dim sheet As XLSheet = book.Sheets(0)

Console.WriteLine("Sheet has {0} rows and {1} columns",_

sheet.Rows.Count, sheet.Columns.Count)


SheetsCollectionC1Excel - C#

C#

C1XLBook book = new C1XLBook();

XLSheet sheet = book.Sheets[0];

Console.WriteLine(sheet.Name);


SheetsCollectionC1Excel - Delphi

Delphi

var

sheet: XLSheet;

book: C1XLBook;

begin

book := C1XLBook.Create;

sheet := book.Sheets[0];

Console.WriteLine(sheet.Name);

end;


SheetsCollectionC1Excel - Visual Basic

Visual Basic

Dim book As New C1XLBook()

Dim sheet As XLSheet = book.Sheets(0)

Console.WriteLine(sheet.Name)


StylesforOddandEvenC1Excel - C#

C#

// step 1: create a new workbook

C1XLBook book = new C1XLBook();

// step 2: create styles for odd and even values

XLStyle styleOdd = new XLStyle(book);

styleOdd.Font = new Font("Tahoma", 9, FontStyle.Italic);

styleOdd.ForeColor = Color.Blue;

XLStyle styleEven = new XLStyle(book);

styleEven.Font = new Font("Tahoma", 9, FontStyle.Bold);

styleEven.ForeColor = Color.Red;

// step 3: write content and styles into some cells

XLSheet sheet = book.Sheets[0];

for (int i = 0; i < 100; i++)

{

XLCell cell = sheet[i, 0];

cell.Value = i + 1;

cell.Style = ((i+1) % 2 == 0)? styleEven: styleOdd;

}

// step 4: save the file

book.Save(@"c:\temp\hello.xls");


StylesforOddandEvenC1Excel - Delphi

Delphi

var

book: C1XLBook;

styleOdd: XLStyle;

styleEven: XLStyle;

sheet: XLSheet;

i: Integer;

cell: XLCell;

begin

// step 1: create a new workbook

book := C1XLBook.Create;

styleOdd := XLStyle.Create(book);

styleEven := XLStyle.Create(book);

// step 2: create styles for odd and even values

styleOdd.Font := System.Drawing.Font.Create('Tahoma', 9, FontStyle.Italic);

styleOdd.ForeColor := Color.Blue;

styleEven.Font := System.Drawing.Font.Create('Tahoma', 9, FontStyle.Bold);

styleEven.ForeColor := Color.Red;

// step 3: write content and styles into some cells

sheet := book.Sheets[0];

for i := 0 to 99 do

begin

cell := sheet(i, 0);

cell.Value := i + 1;

if (i + 1) mod 2 = 0 then

cell.Style := styleEven

else

cell.Style := styleOdd;

end;

// step 4: save the file

book.Save('c:\temp\hello.xls');

end;


StylesforOddandEvenC1Excel - Visual Basic

Visual Basic

' step 1: create a new workbook

Dim book As New C1XLBook()

' step 2: create styles for odd and even values

Dim styleOdd As New XLStyle(book)

styleOdd.Font = New Font("Tahoma", 9, FontStyle.Italic)

styleOdd.ForeColor = Color.Blue

Dim styleEven As New XLStyle(book)

styleEven.Font = New Font("Tahoma", 9, FontStyle.Bold)

styleEven.ForeColor = Color.Red

' step 3: write content and styles into some cells

Dim sheet As XLSheet = book.Sheets(0)

Dim i As Integer

For i = 0 To 99

Dim cell As XLCell = sheet(i, 0)

cell.Value = i + 1

If i + 1 Mod 2 = 0 Then

cell.Style = styleEven

Else

cell.Style = styleOdd

EndIf

Next i

' step 4: save the file

book.Save("c:\temp\hello.xls")


TotalWidthC1Excel - C#

C#

// get book and sheet

C1XLBook book = new C1XLBook();

XLSheet sheet = book.Sheets[0];

// prepare to calculate total width

int totalWidth = 0;

int defWidth = sheet.DefaultColumnWidth;

// loop through the columns and add column widths

foreach (XLColumn col in sheet.Columns)

{

if (!col.Visible)

continue; // skip invisible columns

if (col.Width < 0) // < 0 means default width

totalWidth += defWidth;

else

totalWidth += col.Width;

}

// convert twips to pixels

totalWidth = (int)( totalWidth * 96f / 1440f);


TotalWidthC1Excel - Delphi

Delphi

var

book: C1XLBook;

sheet: XLSheet;

totalWidth: Integer;

defWidth: Integer;

col: XLColumn;

i: Integer;

begin

// get book and sheet

book := C1XLBook.Create;

sheet := book.Sheets[0];

// prepare to calculate total width

totalWidth := 0;

defWidth := sheet.DefaultColumnWidth;

// loop through the columns and add column widths

for i := 0 to sheet.Columns.Count - 1 do

begin

col := sheet.Columns[i];

if not col.Visible then

continue; // skip invisible columns

if col.Width < 0 then // < 0 means default width

begin

totalWidth := totalWidth + defWidth;

end

else

begin

totalWidth := totalWidth + col.Width;

end;

end;

// convert twips to pixels

totalWidth := Round(totalWidth * 96 / 1440);

end;


TotalWidthC1Excel - Visual Basic

Visual Basic

' get book and sheet

Dim book As New C1XLBook()

Dim sheet As XLSheet = book.Sheets(0)

' prepare to calculate total width

Dim totalWidth As Integer = 0

Dim defWidth As Integer = sheet.DefaultColumnWidth

' loop through the columns and add column widths

Dim col As XLColumn

For Each col In sheet.Columns

If col.Visible Then

If col.Width < 0 Then ' < 0 means default width

totalWidth += defWidth

Else

totalWidth += col.Width

End If

End If

Next col

' convert twips to pixels

totalWidth = CInt(totalWidth * 96F / 1440F)


WorkSheetsC1Excel - C#

C#

XLSheet sheet = book.Sheets[0];

XLRow row = sheet.Rows[1000];


WorkSheetsC1Excel - Delphi

Delphi

var

row: XLRow;

sheet: XLSheet;

begin

sheet := book.Sheets[0];

row := sheet.Rows[1000];

end;


WorkSheetsC1Excel - Visual Basic

Visual Basic

Dim sheet As XLSheet = book.Sheets(0)

Dim row As XLRow = sheet.Rows(1000)


XLCellClassC1Excel - C#

C#

C1XLBook book = new C1XLBook();

XLSheet sheet = book.Sheets[0];

for (int r = 0; r < 10; r++)

{

for (int c = 0; c < 10; c++)

{

XLCell cell = sheet[r, c];

cell.Value = (r+1) * (c+1);

}

}

book.Save(@"c:\temp\test.xls");


XLCellClassC1Excel - Delphi

Delphi

var

book: C1XLBook;

sheet: XLSheet;

r: Integer;

c: Integer;

cell: XLCell;

begin

book := C1XLBook.Create;

sheet := book.Sheets[0];

for r := 0 to 9 do

begin

for c := 0 to 9 do

begin

cell := sheet[r, c];

cell.Value := (r + 1) * (c + 1);

end;

end;

book.Save('c:\temp\test.xls');

end;


XLCellClassC1Excel - Visual Basic

Visual Basic

Dim book As New C1XLBook()

Dim sheet As XLSheet = book.Sheets(0)

Dim r As Integer

For r = 0 To 9

Dim c As Integer

For c = 0 To 9

Dim cell As XLCell = sheet(r, c)

cell.Value =(r + 1) *(c + 1)

Next c

Next r

book.Save("c:\temp\test.xls")


XLCellObjectC1Excel - C#

C#

XLCell cell = sheet[10,10];


XLCellObjectC1Excel - Delphi

Delphi

var

cell: XlCell;

begin

cell := sheet[10,10];

end;


XLCellObjectC1Excel - Visual Basic

Visual Basic

Dim cell As XLCell = sheet(10, 10)


XLColumnCollectionClassC1Excel - C#

C#

C1XLBook book = new C1XLBook();

XLSheet sheet = book.Sheets[0];

XLCell cell = sheet[3,3]; // creates 4 rows and 4 columns


XLColumnCollectionClassC1Excel - Delphi

Delphi

var

book: C1XLBook;

sheet: XLSheet;

cell: XLCell;

begin

book := C1XLBook.Create;

sheet := book.Sheets[0];

cell := sheet[3,3]; //creates 4 rows and 4 columns

end;


XLColumnCollectionClassC1Excel - Visual Basic

Visual Basic

Dim book As New C1XLBook()

Dim sheet As XLSheet = book.Sheets(0)

Dim cell As XLCell = sheet(3, 3) ' creates 4 rows and 4 columns


XLRow1CollectionIndexerC1Excel - C#

C#

C1XLBook book = new C1XLBook();

XLSheet sheet = book.Sheets[0];

Console.WriteLine("Before: {0} rows", sheet.Rows.Count);

XLRow row = sheet.Rows[10];

Console.WriteLine("row height {0}", row.Height);

Console.WriteLine("After: {0} rows", sheet.Rows.Count);


XLRow1CollectionIndexerC1Excel - Delphi

Delphi

var

row: XLRow;

sheet: XLSheet;

book: C1XLBook;

begin

book := C1XLBook.Create;

sheet := book.Sheets[0];

Console.WriteLine('Before: {0} rows', sheet.Rows.Count);

row := sheet.Rows[10];

Console.WriteLine('row height {0}', row.Height);

Console.WriteLine('After: {0} rows', sheet.Rows.Count);

end;


XLRow1CollectionIndexerC1Excel - Visual Basic

Visual Basic

Dim book As New C1XLBook()

Dim sheet As XLSheet = book.Sheets(0)

Console.WriteLine("Before: {0} rows", sheet.Rows.Count)

Dim row As XLRow = sheet.Rows(10)

Console.WriteLine("row height {0}", row.Height)

Console.WriteLine("After: {0} rows", sheet.Rows.Count)


XLRowCollectionClassC1Excel - C#

C#

C1XLBook book = new C1XLBook();

XLSheet sheet = book.Sheets[0];

XLCell cell = sheet[3,3]; // creates 4 rows and 4 columns


XLRowCollectionClassC1Excel - Delphi

Delphi

var

book: C1XLBook;

sheet: XLSheet;

cell: XLCell;

begin

book := C1XLBook.Create;

sheet := book.Sheets[0];

//creates 4 rows and 4 columns;

cell := sheet[3, 3];

end;


XLRowCollectionClassC1Excel - Visual Basic

Visual Basic

Dim book As New C1XLBook()

Dim sheet As XLSheet = book.Sheets(0)

Dim cell As XLCell = sheet(3, 3) ' creates 4 rows and 4 columns


XLSheetLocked - C#

C#

// start with a single locked sheet

_c1xl.Clear();

XLSheet sheet = _c1xl.Sheets[0];

sheet.Locked = true;

// create an unlocked style

XLStyle dataEntry = new XLStyle(_c1xl);

dataEntry.Locked = false;

dataEntry.BackColor = Color.Beige;

// create data entry titles

sheet[0,0].Value = "Name:";

sheet[1,0].Value = "Address:";

sheet[2,0].Value = "Phone #:";

// create data entry cells (unlocked)

sheet[0,1].Style = dataEntry;

sheet[1,1].Style = dataEntry;

sheet[2,1].Style = dataEntry;

// save the book

_c1xl.Save(@"c:\temp\Protected.xls");


XLSheetLocked - Delphi

Delphi

var

sheet: XLSheet;

dataEntry: XLStyle;

begin

// start with a single locked sheet

_c1xl.Clear;

sheet := _c1xl.Sheets[0];

sheet.Locked := true;

// create an unlocked style

dataEntry := XLStyle.Create(_c1xl);

dataEntry.Locked := false;

dataEntry.BackColor := Color.Beige;

// create data entry titles

sheet[0,0].Value := "Name:";

sheet[1,0].Value := "Address:";

sheet[2,0].Value := "Phone #:";

// create data entry cells (unlocked)

sheet[0,1].Style := dataEntry;

sheet[1,1].Style := dataEntry;

sheet[2,1].Style := dataEntry;

// save the book

_c1xl.Save('c:\temp\Protected.xls');

end;


XLSheetLocked - Visual Basic

Visual Basic

' start with a single locked sheet

_c1xl.Clear()

Dim sheet As XLSheet = _c1xl.Sheets(0)

sheet.Locked = True

' create an unlocked style

Dim dataEnTry As XLStyle = New XLStyle(_c1xl)

dataEnTry.Locked = False

dataEnTry.BackColor = Color.Beige

' create data entry titles

sheet(0,0).Value = "Name:"

sheet(1,0).Value = "Address:"

sheet(2,0).Value = "Phone #:"

' create data enTry cells (unlocked)

sheet(0,1).Style = dataEnTry

sheet(1,1).Style = dataEnTry

sheet(2,1).Style = dataEnTry

' save the book

_c1xl.Save("c:\temp\Protected.xls")


XLSheetPrintSettings - C#

C#

XLPrintSettings pp = sheet.PrintSettings();

pp.Landscape = true;

pp.Header = "&LLeft Header&CCenter Header&RRight Header";


XLSheetPrintSettings - Delphi

Delphi

var

pp: XLPrintSettings;

begin

pp := sheet.PrintSettings;

pp.Landscape := true;

pp.Header := '&LLeft Header&CCenter Header&RRight Header';

end;


XLSheetPrintSettings - Visual Basic

Visual Basic

Dim pp As XLPrintSettings = sheet.PrintSettings()

pp.Landscape = True

pp.Header = "&LLeft Header&CCenter Header&RRight Header"


XLStyleClassC1Excel - C#

C#

// create a new book

C1XLBook book = new C1XLBook();

// create some styles

XLStyle styleOdd = new XLStyle(book);

styleOdd.Font = new Font("Tahoma", 9, FontStyle.Italic);

styleOdd.ForeColor = Color.Blue;

XLStyle styleEven = new XLStyle(book);

styleEven.Font = new Font("Tahoma", 9, FontStyle.Bold);

styleEven.ForeColor = Color.Red;

// write content and style into some cells

XLSheet sheet = book.Sheets[0];

for (int i = 0; i < 100; i++)

{

XLCell cell = sheet[i, 0];

cell.Value = i + 1;

if ((i+1) % 2 == 0)

cell.Style = styleEven;

else

cell.Style = styleOdd;

}


XLStyleClassC1Excel - Delphi

Delphi

var

book: C1XLBook;

styleOdd: XLStyle;

styleEven: XLStyle;

sheet: XLSheet;

i: Integer;

cell: XLCell;

begin

// create a new book

book := C1XLBook.Create;

styleOdd := XLStyle.Create(book);

styleEven := XLStyle.Create(book);

// create some styles

styleOdd.Font := System.Drawing.Font.Create('Tahoma', 9, FontStyle.Italic);

styleOdd.ForeColor := Color.Blue;

styleEven.Font := System.Drawing.Font.Create('Tahoma', 9, FontStyle.Bold);

styleEven.ForeColor := Color.Red;

// write content and style into some cells

sheet := book.Sheets[0];

for i := 0 to 99 do

begin

cell := sheet(i, 0);

cell.Value := i + 1;

If (i + 1) mod 2 = 0 Then

cell.Style := styleEven

else

cell.Style := styleOdd;

end;

end;


XLStyleClassC1Excel - Visual Basic

Visual Basic

' create a new book

Dim book As New C1XLBook()

' create some styles

Dim styleOdd As New XLStyle(book)

styleOdd.Font = New Font("Tahoma", 9, FontStyle.Italic)

styleOdd.ForeColor = Color.Blue

Dim styleEven As New XLStyle(book)

styleEven.Font = New Font("Tahoma", 9, FontStyle.Bold)

styleEven.ForeColor = Color.Red

' write content and style into some cells

Dim sheet As XLSheet = book.Sheets(0)

Dim i As Integer

For i = 0 To 99

Dim cell As XLCell = sheet(i, 0)

cell.Value = i + 1

If (i + 1) Mod 2 = 0 Then

cell.Style = styleEven

Else

cell.Style = styleOdd

End If

Next i


Untitled Document

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


Untitled Document

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